-2
Guys I’m having problems with my Bingo app
public class MainActivity extends AppCompatActivity {
int[] ids = {R.id.button2, R.id.button3, R.id.button4, R.id.button5, R.id.button6, R.id.button7,
R.id.button8, R.id.button9, R.id.button10, R.id.button11, R.id.button12, R.id.button13, R.id.button14,
R.id.button15, R.id.button16, R.id.button17, R.id.button18, R.id.button19, R.id.button20, R.id.button21,
R.id.button22, R.id.button23, R.id.button24, R.id.button25, R.id.button26};
int cont = 0;
int[] vetaux = new int[25];
boolean isRepetido = false;
Random sorteador = new Random();
int n1 = 0;
boolean y = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
do {
n1 = sorteador.nextInt(100);
for (int cont1 = 0; cont1 < cont; cont1++) {
if (vetaux[cont1] == n1) {
y = true;
break;
} else {
y = false;
}
}
if (y == false) {
vetaux[cont] = n1;
cont++;
}
while (cont < 25) ;
{
//int Nsorteado = sorteador.nextInt(100);//Nsorteado armzenou o numero
for (int cont = 0; cont < ids.length; cont++) {
int Id = ids[cont];
int n1 = vetaux[cont];
String txt1 = String.valueOf(n1);
Button button = (Button) findViewById(Id);
button.setText(txt1);
}
}
}
}
error : while expected error :reached end of file while Parsing
I advise you to read a little bit about https://answall.com/help/how-to-ask, and also to thank users who are taking the time to help with their questions.
– Dev
in front of your while has a dot and comma remove it and see if it works
– Ezequiel Messore
@Ezequielmessore if he removes ; where will know the end of "while..." ??
– Dev
@Matheus the scope of while is bounded by the example keys: while(i<10){ } vc do not need the dot and comma to know where the end is
– Ezequiel Messore
Yes while yes, but he is using a do.. while it is also used keys, but keys happen before calling while
– Dev
@Please ignore me Matheus now that I’ve noticed that it’s a do/while ...
– Ezequiel Messore
galara...problem solved ...the problem was in closing in
– Rafael Uemura
do{ }while;{ } thank you all...I’m new here and would like to know how to thank the users who helped me
– Rafael Uemura