Hi,
Here is a little diversion inspired by an old HyperCard game and an old electronic game from Tiger Electronic. There is also a version in the LiveCode Sample Stacks named "LC Lights Out" by Andreas Strauch. BTW, you can play the HyperCard version at hcsimulator.com.
I am not sure you can actually get the lights all on or all off. During testing I swear I saw a couple of "You Win!"s, but only using the "solve" button. Best I can do now is leaving one light on or off.
The programming challenge here was to implement the "Chase the Lights" method for solving (or getting close to solving) the puzzle. I am also experimenting with behaviors in this stack.
I think the 5x5 game might lend itself to some interesting Halloween creations (25 jack o'lanterns stacked in a pile, a Haunted House with 25 windows, etc.)
Happy Coding,
Mike
Lights Out! 2024
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Lights Out! 2024
- Attachments
-
- Lights Out! 2024 version 1.0.livecode.zip
- (99.43 KiB) Downloaded 864 times
Re: Lights Out! 2024
How is the game played?
Craig
Craig
Re: Lights Out! 2024
Craig,
The game is played by trying to turn on all of the lights, meaning turning the squares all white (i.e. lights "on"). Alternatively you could try to turn all the squares blue (i.e. lights "off"), although my solve algorithm is set up to try and turn them all "on".
The goal is to do it in the fewest steps and least amount of time possible.
Of course, if you randomly flip squares it will be increasingly frustrating until you discover there is a successful approach to take ( you can study the pattern the algorithm takes with the solve button...I slowed it down a bit so you can see the flips occurring but not so slow as to be blatantly obvious).
The scripts are all open and pretty well documented if you want to tinker. Check out the "createGui" handler in the stack script and you will see all of the objects that will be recreated if you delete them, and only them, and then type "OpenStack" in the message box. [Best to do this on a copy of the stack].
Mike
P.S. Google "chase the lights, lights out" and find you'll find a wealth of info about versions of this game
The game is played by trying to turn on all of the lights, meaning turning the squares all white (i.e. lights "on"). Alternatively you could try to turn all the squares blue (i.e. lights "off"), although my solve algorithm is set up to try and turn them all "on".
The goal is to do it in the fewest steps and least amount of time possible.
Of course, if you randomly flip squares it will be increasingly frustrating until you discover there is a successful approach to take ( you can study the pattern the algorithm takes with the solve button...I slowed it down a bit so you can see the flips occurring but not so slow as to be blatantly obvious).
The scripts are all open and pretty well documented if you want to tinker. Check out the "createGui" handler in the stack script and you will see all of the objects that will be recreated if you delete them, and only them, and then type "OpenStack" in the message box. [Best to do this on a copy of the stack].
Mike
P.S. Google "chase the lights, lights out" and find you'll find a wealth of info about versions of this game