An implementation of Mastermind algorithm with constant-size memory 2