Archive for category Java

.Net vs Java

Java mastermind game win check algorithm

I coded this Mastermind game in Java while working on a project at work. This is the method that checks the players answer to the color question.

public void winCheck(int id[]) {
int black = 0;
int white = 0;
colorAnswer = colorAnswerList.get(id[0]);
hitBox = hitboxList.get(id[0]);

// Schwarz : Richtige Farbe und Position
for (int i = 0; i < 4; i++) [...]

Tags: ,