## Project 1: CS 3700 Socket Basics #### Michelle Zinger ### This README covers Project 1. #### Description: Implement a client program that plays a variant of the recently-popular game Wordle. ## High-Level Overview The high-level approach that I used was to break up the project into major pieces. The first step was in connecting the client to the server, sending out a hello message, and ensuring the correct start message was received. Then, I went about with the main portion of the project, which was responding to and sending the different message 'types' from Client to Server in order to guess the correct word. I downloaded and imported the wordlist that we were given so that my client could make guesses off of there. Then, I figured out how to process each message, determine what the type was, and ensured the client continued making guesses on receiving the 'retry' message. From there, I focused on making my client program smarter by keeping track of the information that we gained after each subsequent guess and printing out the flag once a successful 'bye' message was received. ## Challenges Some challenges I faced were in the initial setup. Getting myself refamiliarized with the basics of Python (lists, arrays, dicts) and working with JSON objects was a slight learning curve. I also hadn't worked with socket connections, so I had to do a bit of outside research and reading on this before I could get the hang of it. Finally, I ran into some challenge with making my client 'smarter' because it was taking too long to guess the word and wasn't really utilizing previous information it had gained from other guesses. I had to reapproach my methodolgy for determining letters that should not be guessed again because I realized it was possible to get a '2' and a '0' for the same letter within one word. ## Guessing Strategy The strategy used was to create three different arrays (notInWord, inWord, and inPlace) to track the guessing progress. notInWord held letters that should not be guessed again, inWord held letters that could be reguessed in different positions, and inPlace held letters that needed to be exactly in that position in the next word to be guessed. Based on the marks given after each sequential guess, I would add to each of these arrays (0 meant the letter goes in notInword, 1 meant it goes in inWord, and 2 meant it goes in inPlace). Then, before sending any guesses to the server, if the current randomly chosen word had any characters that didn't align with these three arrays/specifications, I would select a different word to guess/check and remove it from the existing wordlist. ## Testing Code The main way in which I tested my code was by testing and submitting against the server often. After submitting against the server multiple times, I was able to score full marks on the tests and used this as guidance for passing. I used the original information given by the server as guidance on where I was erring in terms of my guessing strategy. I also setup intermediary tests and log statements to help me make sure that I was receiving the correct messages and that my variables were storing the correct information.