Java uses of for loops?


#1

int points= 0;
for (int i = 6; i >= 1; i--) {
	if (Collections.frequency(list, i) >= 3) {
		points= i * 3;
		return points;
	}
return points;

Is this the right way to find three equal numbers in a list. I am making a yatzy game. Is it the right way of using a for loop or should I use a while loop?


#2

Is it JavaScript code? It looks like Java. You need to ask your question at Java forum.


#3

Ok sorry, I am new here so I am not sure were to find the right forums.


#4

#5

So can you answer the question now? "poƤng" should say "points".


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.