Lights off! Puzzle

Hi all. As a homage to the mind-boggling Missing Wings @Carlos.R and following on some of the ideas of @Charles_Parkes’ recent thread, my daughter and I added another puzzle to our game, which I wanted to share. You have got to turn off all the lights. Compared to Missing Wings, every game is different and you can choose the complexity. There is a hint system and some *script magic to let you use the keyboard directly. Let me know what you think.

To manage arrays and loops, I created a small preprocessor (in Python) which extends the language with a *for command and an *unroll command. *unroll will repeat a block of code with a changing parameter. This is needed to work around the fact that some commands (*choice, *create) can’t be built programmatically (so, a *for loop wouldn’t work). I’ll be happy to share if there is interest.

Happy July 4th and stay safe!


Hum that remind me of kotor 2 lol there is an ithorian in a cell. And you gotta hit switch, if you succeed it open the cell and he can run away. If you fail, he get fried lol

It look fun though, gonna give it a try .

So, as far as I can tell, there are two stages to this game: a memory game where you experiment with all the switches and see what they do (as far as I can tell it’s randomly generated) and then once you’ve mapped them all out, you flip them until they’re all off.

I think I’d have more patience with the puzzle if the first half was removed, i.e. the light switches operate in predictable, systematic ways. The hint system tells you what the switches do, but it doesn’t feel like discovering the solution to a puzzle. I think the switches should be consistent and predictable and the puzzle could be solving it in the fewest steps.

Really impressive work with choicescript regardless. How’d you get it to not freak out that startup.txt doesn’t have a traditional format?

Hi @will , thanks for the message. Let me try to answer each question.

  • My idea was that, when you have the buttons mapped out, you can run the math to find the combination. Yes, they are randomly generated and every time the solution is different (you may need one or all buttons). Even with the hints, the solution can be very elusive. Would you start by always showing the hints?

  • If the buttons are predictable, the game would be very similar to Lights Out (see link below), right? Yes, that could be an option. But as soon as you learn the strategy, I believe all initial grids are similar. The “unpredictability” makes every game here very different (I believe this is a more complex Satisfiability problem).

  • Lights Out could be fun to implement. I’m thinking how to have an efficient way to choose a position in the grid - you’d need two choices. Or you may walk on the grid (N W E S) like in the game Kotor 2 @E_RedMark . I may look into that.

  • As I briefly mentioned, to manage the complexity of the game (boolean arrays, XOR etc) I had to build a preprocessor to render loops and unroll things like variable creation. My source (written in my extended CS) is 183 lines, expanded by my tool to 418 lines of standard CS. If you have more questions, I’ll be happy to give you more details.

1 Like

For those who asked @Charles_Parkes, the keyboard-based input requires some *script magic. You’ll need to add an event listener to your document. Also, you must remove it immediately after the choice, to avoid phantom clicks if somebody uses the form (choice + next). This is a simplified code snippet.

*script document.toggler =   
   function (e) {
     if (e.key > "0" && e.key <= "4"){
       document.getElementsByTagName("input")[e.key-1].checked = true;

*script document.addEventListener('keyup' ,document.toggler);

  #some choice
    *script document.removeEventListener('keyup', document.toggler);

Have fun with it, and let me know if you need help.