Hier oben ist die Frage & col1, col2, col3, col4 diese r die Antworten, die r die Randomaly kommen
int num ist die vollständige Fragen & d Antworten
int top,col1,col2,col3,col4,num=8;
top=(int)Math.floor(Math.random()*num);
col1=(int)Math.floor(Math.random()*num);
col2=(int)Math.floor(Math.random()*num);
col3=(int)Math.floor(Math.random()*num);
col4=(int)Math.floor(Math.random()*num);
Nach dieser int String konvertieren
String topstr, col1str, col2str, col3str, col4str;
topstr=String.valueOf(top);
col1str=String.valueOf(col1);
col2str=String.valueOf(col2);
col3str=String.valueOf(col3);
col4str=String.valueOf(col4);
Prüfbedingung durch, wenn Schleife
hier Imageview imgtopcolor, imgcolortap1, imgcolortap2, imgcolortap3, imgcolortap4; hier int Toppickid [] = new int [num]; int Colpickid [] = neuer int [num];
Toppickid[0]=R.drawable.img0;
//...
Toppickid[7]=R.drawable.img7;
Gleiche wie Colpickid []
if(topstr.equalsIgnoreCase(col1str) || topstr.equalsIgnoreCase(col2str) || topstr.equalsIgnoreCase(col3str) || topstr.equalsIgnoreCase(col4str))
{if(!col1str.equalsIgnoreCase(col2str))
{ if(!col1str.equalsIgnoreCase(col3str))
{if(!col1str.equalsIgnoreCase(col4str))
{if(!col2str.equalsIgnoreCase(col3str))
{if(!col2str.equalsIgnoreCase(col4str))
{if(!col3str.equalsIgnoreCase(col4str))
{
imgtopcolor.setImageResource(Toppickid[top]);
imgcolortap1.setImageResource(Colpickid[col1]);
imgcolortap2.setImageResource(Colpickid[col2]);
imgcolortap3.setImageResource(Colpickid[col3]);
imgcolortap4.setImageResource(Colpickid[col4]);
} } } } } } } }