Showcase [Showcase] Lights Out Minigame

idkwhoiam129

Steampunker
Lights Out is based on a simple concept. Clicking on a cell toggles that cell and each of its immediate neighbors. The goal is to turn out all the lights, ideally with the minimum number of clicks.

Download link: http://bit.ly/292sV4N

b0043a9a9e.png
abc2703006.png
119397e88c.png
 
Last edited:
Interesting. That's one of the few games that are possible to implement with very little logic, making it suitable for implementation in terraria.

With some careful wiring, you could probably reduce it to 2 or 3 gates per cell. That could make it more compact, allowing the player to see more of the playing field at once.

Or you could keep it this big, run some additional wires between the cells and add a global reset switch, or a randomizer so you can solve random games, or some fireworks that go off when the game is solved, or ... ;)
 
Interesting. That's one of the few games that are possible to implement with very little logic, making it suitable for implementation in terraria.

With some careful wiring, you could probably reduce it to 2 or 3 gates per cell. That could make it more compact, allowing the player to see more of the playing field at once.

Or you could keep it this big, run some additional wires between the cells and add a global reset switch, or a randomizer so you can solve random games, or some fireworks that go off when the game is solved, or ... ;)
Yeah, it definitely could be compacted a bit I'm sure. It's just very tall so I added wires horizontally to make each cell in to a square. There are many possibilities I could do with it, but I don't think I could do a randomizer. I have't discovered or seen a good method for calling a randomized value. A reset switch wouldn't be too easy either.. I'm using T-Flip Flops instead of D-Flop Flops because they are more compact. But with this, I'd have to know which cells are on and which are off. If I had D-Flip Flops, I could just set them to be off. It's a bit of a trade-off. I could probably do a way to tell when it's solved, but that would probably break the tile-ability of the cells.
 
There are many possibilities I could do with it, but I don't think I could do a randomizer. I have't discovered or seen a good method for calling a randomized value.
Faulty gate lamps. They will propagate a signal with a chance equal to the ratio of on lamps to all lamps below them. Put a faulty lamp on top of an on lamp, an off lamp and a gate, and you have your randomizer with a 50/50 chance.
A reset switch wouldn't be too easy either..
All you need is a faulty lamp connected to the reset switch, a lamp that is toggled each time the switch is clicked, and a gate that'll click the switch. If the cell was played an odd number of times, the lamp will be on. Thus, when the faulty lamp gets a signal, the gate will emit a signal with 100% chance, toggling the cell again, and it's off. One of these on each cell and you're done.
But with this, I'd have to know which cells are on and which are off.
Precisely. You store that information in the lamp I mentioned.

I don't mean to plug my own project in your thread, but I made a reset-switch for my Tic Tac Toe. Maybe you can draw inspiration from that. The randomizer works just the same, except you replace the faulty lamp/toggled lamp/gate with faulty/on/off/gate.
I could probably do a way to tell when it's solved, but that would probably break the tile-ability of the cells.
Just feed each column downwards with a single wire and AND gates in between, and you maintain tileability across the playing field. You will need to AND all the columns below the field, but that can also be extended indefinitely.

It's all solvable without limiting board size, but will take some planning when limited to four wire colors. Junction boxes ahoy.
 
Just feed each column downwards with a single wire and AND gates in between, and you maintain tileability across the playing field. You will need to AND all the columns below the field, but that can also be extended indefinitely.

It's all solvable without limiting board size, but will take some planning when limited to four wire colors. Junction boxes ahoy.
So in other words, an AND gate for each column, and the number of lamps on there equal to the number of rows, then each of those and gates get fed to the lamps of a final AND gate to determine if all tiles are off (as such, turning all lamps ON to represent tiles that are Off)
 
So in other words, an AND gate for each column, and the number of lamps on there equal to the number of rows
Oh no, that takes way too much space. That way you would need to run n wires for n rows, and you don't have the space or the colors for that.

Every cell gets an AND gate with two lamps. The top lamp is connected to the output of the AND gate from the cell above, the other lamp is toggled along with the cell. The whole thing is just 1 tile wide, alternating wire and lamps/gate.

Basically, replace (A AND B AND C AND D ..) with (((A AND B) AND C) AND D) ... and you'll get the same result with simpler wiring.
 
Oh no, that takes way too much space. That way you would need to run n wires for n rows, and you don't have the space or the colors for that.

Every cell gets an AND gate with two lamps. The top lamp is connected to the output of the AND gate from the cell above, the other lamp is toggled along with the cell. The whole thing is just 1 tile wide, alternating wire and lamps/gate.

Basically, replace (A AND B AND C AND D ..) with (((A AND B) AND C) AND D) ... and you'll get the same result with simpler wiring.


I understand how that would work... it's just, it loses tile-ability, in a sense. It may be tileable vertically but... the AND gates wouldn't tile horizontality because you'd need to add more AND gates to only the bottom row. I don't know why I seem to care about tile-ability though. Maybe for if I wanted to expand it. I rely had to care about it for my cellular automaton builds. I'll take a look at the tic tic toe, but I think I'm starting to understand what you're getting at.
 
Back
Top Bottom