Home > Back-end >  Tuixiangzi how to enter the next level, some problems, why my two go box number code doesn't wo
Tuixiangzi how to enter the next level, some problems, why my two go box number code doesn't wo

Time:10-02

Int boxs;
Void initData (int map [] [16])
{
int i, j;

//load the data allows users to wait for, in general, load data faster
Printf (" the load of the game, please later... ");

//traverse map data in a
for(i=0; I & lt; 14. I++)
{
For (j=0; J & lt; 16. J++)
{
//traverse to 2 (people), the recorder, the coordinates of x, y is the previously defined global variable
//traverse to 3, the increase in the number of boxes, boxs is the previously defined global variable
If (map [I] [j]==52 | | map [I] [j]==103)
{
Boxs++;
}
}
}
}
Int main ()
{
Int map [14] [16].
For (int n=1; N<44. N++)
{
ReadMap (map, n);//read from the file map
InitData (map);
While (1)
{
System (" CLS ");//clear screen
PrintMap (map);
If (boxs==0)
{
break;
}
KeyDown (map);
No (map);
}
}
System (" pause ");
}
Void no (int map [] [16])
{
Printf (" better ");
For (int I=0; I & lt; 14. I++)
{
For (int j=0; J & lt; 16. J++)
{
//traverse to 2 (people), the recorder, the coordinates of x, y is the previously defined global variable
//traverse to 3, the increase in the number of boxes, boxs is the previously defined global variable
If (map [I] [j]==103)
{
Boxs,;
}
}
}

}

CodePudding user response:

No project background, no data, example
Strong lu incomplete code, is really a waste of time, usually one who is, won't dry

CodePudding user response:

reference 1st floor yukint response:
no project background, there is no data, example
Strong lu incomplete code, is really a waste of time, usually one who is, won't dry

Educated, thanks
  • Related