PC Nim in Terraria

Programmatic

Steampunker
Nim is a very simple game that involves two players taking turns subtracting items from some list. Each player must subtract between 1 and some upper limit on their turn, and whoever removes the last item on their turn wins. In the game of Nim that I created, the position of a torch represents the current remaining units. You can start with between 6 and 15 units, and you and the AI may subtract between 1 and 3 on your turn.
To start the game, flip one of the switches beneath the 6th to 15th torch, and then flip the left lever to start the game, with the AI always going first. The torch between the levers will light up when it is your turn, and you can flip the right lever between 1 and 3 times to subtract a unit. If you subtract less than 3 units, flip the left lever give the AI its turn. If you win, the green block will light up, and if you lose, the red block will light up.
Here is an example of me losing one game, and winning the next:


Try it out yourself, and see if you can find a way to beat the AI:
 

Attachments

  • Nim.wld
    11.8 KB · Views: 90
I remember seeing a video on youtube that explained a strategy to always beat this game. Apparently this game was on that one tv show where people travel the world in teams and compete against each other for a chance to win money, but they used red flags. This is a very cool interpretation!
 
I remember seeing a video on youtube that explained a strategy to always beat this game. Apparently this game was on that one tv show where people travel the world in teams and compete against each other for a chance to win money, but they used red flags. This is a very cool interpretation!

I actually learned about Nim from the exact same video.
 
Yeah, it is cool to build these things, props, but Nim is boring because of the lack or replayability.

 
Last edited:
Back
Top Bottom