HaikuArchives / LightsOff

Lights Off! is a rendition of the original handheld game "Lights Out!", manufactured by Tiger Electronics.
MIT License
2 stars 3 forks source link

Implement the random puzzle feature #33

Closed owenca closed 6 years ago

owenca commented 6 years ago

Also, clean up integral types int8, uint8, int32, and uint32.

Note: the feature is turned off for now because the GUI side is not done yet.

owenca commented 6 years ago

Uncomment this line to play with the random puzzle feature, which only works for the 5x5 grid size with the minimum number of moves set to 5.

humdingerb commented 6 years ago

It's randomizing alright. :) Merge?

Idea: instead of another menu "Random" in the bar, you could move it into the "Game" menu as "Random game >" and have it behave like e.g. the "Open >" menu of ShowImage: A submenu holds the different grid sizes (with a checkmark of the currently used size). Selecting a grid size starts a random game with that size. Clicking directly on the "Random game >" menu item does so directly.

owenca commented 6 years ago

Yes, please merge.

you could move it into the "Game" menu as "Random game >" and have it behave like e.g.�� the "Open >" menu of ShowImage: A submenu holds the different grid sizes (with a checkmark of the currently used size). Selecting a grid size starts a random game with that size. Clicking directly on the "Random game >" menu item does so directly.

I did it exactly the same way before (except that I had "New >" instead of "Random game >"). For some reason, I felt it was awkward with "Puzzle pack" and "Level" on the menu bar. I still have the code and can merge it if necessary. :)

humdingerb commented 6 years ago

You decide what's best. :) Maybe keep the code around, just in case...

owenca commented 6 years ago

Some facts about the game:

Dimension Fraction of solvable puzzles Maximum number of moves required
3x3 All 9
4x4 1/16 7
5x5 1/4 15
6x6 All 36