Good afternoon guys, I'm doing the General game (of data in Java). I am in doubt on how to compare the data between them.
Sequence Possible sequences: 1-2-3-4-5 / 2-3-4-5-6 / 3-4-5-6-1 Number of points: 20
Full-Hand The number x in 3 data and the number y in the remaining two (for x other than y) Number of points: (3 * x + 2 * y) + 30
Quadra The number x in four different data Number of points: (4 * x) + 40
General The number x in the five dice Number of points: (5 * x) + 50
Simple Combinations For each number from 1 to 6 the player can score points as in the example: Ex: If the player obtains the following sequence of numbers: 2 3 2 2 5
So far I've been able to test to see if it's General:
public int VerificarDados()
{
int aux=1;
int q=0,u;
for(q=0;q<5;q++)
{
if(dados[q]==dados[q+1])
{
aux++;
}
}
numRept=dados[1];
if(aux==5)
{
return 5; //general
}
Could anyone give me any tips how to make the other comparisons? Thank you!