Skip to content

Implementation of the Mastermind algorithm with constant memory

Notifications You must be signed in to change notification settings

gsingharoy/mastermind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

This is a Mastermind algorithm implementation with constant size memory.
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.

About

Implementation of the Mastermind algorithm with constant memory

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages