1
switch (a) { case 1: { }break; case 4: { for (int i=0;i<2;i++) { for (int j=0;j<2;j++) { UILabel *la=[[UILabel alloc]init]; la.backgroundColor=[UIColor blackColor]; la.frame=CGRectMake(100+j*35,100+i*35,30,30); [self.window addSubview:la]; } } }break; case 2: case 3: case 5: case 6: case 7: case 8: case 9: { int x; for (int i=0;i<3;i++) { if (i==x) { break; } for (int j=0;j<3;j++) { if (i*3+j==a) { x=i+1; break; } UILabel *la=[[UILabel alloc]init]; la.backgroundColor=[UIColor blackColor]; la.frame=CGRectMake(100+j*35,100+i*35,30,30); [self.window addSubview:la]; } } }break; default: break; }