Mastermind

LoneAssassinC's picture
Build image: 
In-game name (NO VISITORS! Must be LEARNER rank or higher!): 
LoneAC
Builder name(s) and current ranks: 
LoneAC: Builder
Creation location: 
/plot tp LoneAC x:718, y:184, z:-644
Machine Features: 

This is based on the board game of the same name, but this is singleplayer. When you start a new game, a random number between 1-8 is generated for each digit and the board is cleared. The RNG I used is 3-bit binary converted to analog and incremented by 1 to get the number between 1-8. The user inputs are immediately sent to the board and to the logic unit beneath. The logic unit compares the generated code to the user's guess. It does this by comparing every digit in the code to the guess, which is easiest using a grid-like architecture where the columns and rows are from the 2 codes. I'm using analog "comparators" at each intersection in the grid. The logic unit only allows 1 match per row and per column, which allows for duplicate colors in the code. It does this by effectively disabling the other possible matches except for where a correct placement could occur. Once it's done matching, the LU adds the number of correct placements and misplacements (again in analog) and sends that data to the board. The signal strength of that data ranges from 1-5 so as to display the proper information on the board.

The board only allows the user inputs and data from the LU to be saved to 1 row at a time. This is done through rising-edge monostables that give 2-tick off pulses that allow the information to pass into the memory cells. It knows which row to save to through an analog counter that loses 1 signal strength per row. The counter is incremented each time the user hits the "Set as Guess" button and is displayed on a 7 segment display on the board.

Once the code is randomly generated, it is immediately sent to the displays at the top of the board but isn't allowed through until the user wins or until they run out of guesses. The game keeps track of the guesses through the analog counter mentioned above. When that counter reached 10, the correct code will be displayed. The win detect is handled by the correct placement memory cells on the board. If any are equal to 5 then the user has won. Once either the player has won or run out of guesses, the signal from the "Set as Guess" button is disabled by disabling a comparator.

I haven't gone over the selector panels or displays, but I hope those are self-explanatory.

How To Use: 

It's very easy to use. Hit the "Reset and Restart" button to begin! There are 4 selectors where you select the color for that digit (4 digit code -> 4 selectors). When you're confident in your guess, hit the "Set as Guess" button. The board will display your guess, your total number of guesses, how many colors were misplaced and how many are in the correct position. Keep going until you win or you used all 10 tries. You'll know when this happens because the correct code will be displayed on the top of the board and you'll no longer be able to set a guess. Have fun!

Request status: 
Approved

Comments

LoneAssassinC's picture

Gort moved my plot (thanks Gort <3). New coordinates are x:584, y:185, z:-642. Or just fly to the top of my plot xD

By LoneAssassinC
MeSoLost's picture

You have made an impressive build and I'd gladly approve this for builder rank without fail. However you are attempting for senior rank and have some ground to make up for that rank. Your plot, or rather 4 plots, are a bit barren of builds. We'd like you to make some more things as equally or more so impressive in the quality you have demonstrated on this build. Once you have a few more creations and your plots are a bit more full please ask a senior staff to re-asses your plot as a whole for your senior rank. ^_^

By MeSoLost
LoneAssassinC's picture

Thanks MeSo. I will do that ^_^

By LoneAssassinC