Exemplo n.º 1
0
 private void doTheShift(MasterMindGame game) {
   for (int i = 0; i < CodePin.values().length; i++) {
     List<CodePin> nextGuess = new ArrayList<CodePin>();
     for (int x = 0; x < game.getSecretCodeLength(); x++) {
       nextGuess.add(CodePin.values()[(i + x) % CodePin.values().length]);
     }
     game.submitAttempt(nextGuess);
   }
   learn();
 }
Exemplo n.º 2
0
  public boolean play(MasterMindGame game) {
    Response finalOutcome = new Response(0, 0);

    doTheShift(game);

    //		while(!game.isGameOver()) {
    //			learn();
    //			finalOutcome = submitAttempt(game);
    //		}
    return game.codeFound(finalOutcome);
  }
Exemplo n.º 3
0
 private Response submitAttempt(MasterMindGame game) {
   CodePin attemptArgs = createAttempt();
   return game.submitAttempt(attemptArgs);
 }