README

The game is called Adam Says, named after the creator: Adam Speichigner

the firt file 'AdamProject' contains the server program
the second file 'AdamRaspberryCode' contains the client program

The way that I went about implementing the first function of the game, playing against a computer, was to first set up how the user would interact if they were the master.  First the user would be prompted to input a pattern with the correct amount of letters, and after checking that they used valid letters and had the appropriate length a simulated computer function would go about guessing the correct pattern.  This function had a 70 percent probability rate of guessing the correct pattern.  The reason for the 70 percent is since it was a computer the user was playing against it should be challenging to beat the computer but at the same time not impossible.  If the computer was successful then the length of the pattern would be increased, once the length of the pattern had gone past 12 letters then the length would be reset to three and a new valid letter would be allowed.  This is to continue until all six valid letters (A, S, D, W, Q, E) had been used.  If all six letters were in the pattern and the length surpassed 12, the user would win the game.  After every even round though the master should be switched up in order to provide a fair challenge.
This leads to the second half of the first feature.  If the user is not the master then the computer would be required to simulate a random pattern, flash it on the screen briefly to the user, and then wait for the user to respond with what they saw.  The random pattern generated by the computer was implemented by creating random probabilities for the valid letters each time the computer had to implement a pattern.  The random numbers for the probabilities would not be higher than the length of the pattern though to give all valid letters an opportunity to be used.  The first letter of the computer’s pattern would be the highest probable valid letter, after placing the letter into the pattern the probability for that letter would then be reduced by one.  After reducing the probability it would look for the highest probability again and repeat the process until it had filled up the pattern.  Once the computer generated it’s pattern it would prompt the user to input a response, check if the response was correct or not.  If it was correct then the game would continue as described earlier where the length of the pattern would increase by one, after a 12 letter pattern a new valid letter would be introduced and the pattern length would be reset to 3.  Also the same rule about after every even turn, the master would be switched, going back to the first half of the first feature.  Again the game would continue like this until a winner was chosen.
The second feature of the game is the multiplayer aspect.  This implementation of the game is where the real purpose of the game came into play.  By using UDP connectionless socket communication, the players are able to pass patterns back and forth to each other following the same functionality as the player versus computer implementation.  The main reason the computer implementation came first was because the algorithm was originally designed to work on my Raspberry Pi which I was testing at my home and couldn’t set up a connection to another board easily so the computer simulated player aspect came about as an added idea to the game.  So just like playing against the computer the users would try to input a pattern that would be flashed across the screen of the opponent and then they would have to mimic the pattern in order to continue the game.  After every even turn the master that chooses the pattern was switched up from player to player, and after every correct guess at the opponents pattern then there would be an increase in the length of the pattern.  I didn’t get to fully implement this multiplayer game since I had some complications originally and then didn’t have much time to implement this functionality properly.
