Here there is a memory restriction for the algorithm, where we are allowed only two strings, viz. x and y in the memory to store our data.
The main strategy would be that of figuring the right combination of block string from the x memory and forgetting the data from x memory after that.
Instructions to run the file :
- Put your input file inside the 'input' folder.
- Run the command "python mastermind.py your_input_file_name" where your_input_file_name is the name of the input file
- 3 input files are already there in the input folder. So you can run "python mastermind.py input1.txt" , "python mastermind.py input2.txt" and "python mastermind.py input3.txt".
- input1.txt is a short string where the length is 10 and the number of colors,k = 4.
- input2.txt is a very long string where length is 4000 and number of colors, k = 4.
- input3.txt is a very long string where length is 4000 and number of colors, k = 10.
To run the modified algorithm which has an intelligent guess function, run "python mastermind.py <input_file> --n"
Click here to learn more about the original Mastermind game.