Skip to content

Instantly share code, notes, and snippets.

@MohamedRamadanSaad
Created May 19, 2015 20:48
Show Gist options
  • Save MohamedRamadanSaad/f1c89cdc9989617f5de1 to your computer and use it in GitHub Desktop.
Save MohamedRamadanSaad/f1c89cdc9989617f5de1 to your computer and use it in GitHub Desktop.
Connect the solitaire image view by an id to access them , manually
public void initGame()
{
field1=0;
field2=0;
field3=0;
if(random_first_im1==1||random_first_im1==3){
first_im1.setImageResource(R.drawable.one_black);
}else if(random_first_im1==2||random_first_im1==4){
first_im1.setImageResource(R.drawable.one_red);
}else if(random_first_im1==5||random_first_im1==7){
first_im1.setImageResource(R.drawable.two_black);
}else if(random_first_im1==6||random_first_im1==8){
first_im1.setImageResource(R.drawable.two_red);
}else if(random_first_im1==9||random_first_im1==11){
first_im1.setImageResource(R.drawable.three_black);
}else if(random_first_im1==10||random_first_im1==12){
first_im1.setImageResource(R.drawable.three_red);
}else if(random_first_im1==13||random_first_im1==15){
first_im1.setImageResource(R.drawable.four_black);
}else if(random_first_im1==12||random_first_im1==16){
first_im1.setImageResource(R.drawable.four_red);
}else if(random_first_im1==17||random_first_im1==19){
first_im1.setImageResource(R.drawable.five_black);
}else if(random_first_im1==18||random_first_im1==20){
first_im1.setImageResource(R.drawable.five_red);
}else if(random_first_im1==21||random_first_im1==23){
first_im1.setImageResource(R.drawable.six_black);
}else if(random_first_im1==22||random_first_im1==24){
first_im1.setImageResource(R.drawable.six_red);
}else if(random_first_im1==25||random_first_im1==27){
first_im1.setImageResource(R.drawable.seven_black);
}else if(random_first_im1==26||random_first_im1==28){
first_im1.setImageResource(R.drawable.seven_red);
}else if(random_first_im1==29||random_first_im1==31){
first_im1.setImageResource(R.drawable.eight_black);
}else if(random_first_im1==28||random_first_im1==32){
first_im1.setImageResource(R.drawable.eight_red);
}else if(random_first_im1==33||random_first_im1==35){
first_im1.setImageResource(R.drawable.nine_black);
}else if(random_first_im1==34||random_first_im1==36){
first_im1.setImageResource(R.drawable.nine_red);
}else if(random_first_im1==37||random_first_im1==39){
first_im1.setImageResource(R.drawable.ten_black);
}else if(random_first_im1==38||random_first_im1==40){
first_im1.setImageResource(R.drawable.ten_red);
}else if(random_first_im1==41||random_first_im1==43){
first_im1.setImageResource(R.drawable.k_black);
}else if(random_first_im1==42||random_first_im1==44){
first_im1.setImageResource(R.drawable.k_red);
}else if(random_first_im1==45||random_first_im1==47){
first_im1.setImageResource(R.drawable.q_black);
}else if(random_first_im1==46||random_first_im1==48){
first_im1.setImageResource(R.drawable.q_red);
}else if(random_first_im1==49||random_first_im1==51){
first_im1.setImageResource(R.drawable.j_black);
}else if(random_first_im1==50||random_first_im1==52){
first_im1.setImageResource(R.drawable.j_red);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment