if you want to solve the 'The Old Switcheroo' programmatically,copy the following code to notepad++, save it as html file (since it is JS script) and follow the Note and Credits below
i try to solve the switch/bulb satisfiability problem using JS code. the main problem was how to represent the information. each time the 'The OLD Switcheroo!' project is run, it is needed to set the values of a,b,c,d,e in light() function.it shall be set according to the switch operation . the left switch is X1 and the right most switch is X5 for example if X1 is turn on and the left most bulb and the right most bulb are turn on, then 'a' shall be a=17; ( 0x11) so after run the scratch project, you shall turn on only one switch and find which bulbs are light ans set a,b,c,d,e accordingly See https://scratch.mit.edu/discuss/topic/224661/