Maze movement, mobile maze movie
{"■", "■ ","", "■ "},
{"■", "■ "},
{"■", "", "■ "},
{"■", "", "■", "■", "", "■ "},
{"■", "", "■", "", "■", "■ "},
{"■", "", "■", "", "■", "■ "},
{"■", "", "■", "," ■ "},
{"■", "", "■", "," ■ "},
{"■", "", "■", "■ ", "■ "},
{"■ ","", "■ "},
{"■", "■", "", "■ "},
{"■", "■ ", "■", "■ "}
};
Int reny = 9;
Int renx = 9;
Erwei [reny, renx] = "persons ";
While (true)
{
For (int j = 0; j <12; j ++)
{
For (int I = 0; I <11; I ++)
{
Console. Write (erwei [j, I]);
}
Console. Write ("\ n ");
}
Erwei [reny, renx] = "";
Console. Write ("Enter :");
String caozuo = Console. ReadLine ();
If (caozuo = "w ")
{
If (erwei [reny-1, renx] = "")
{
Reny = reny-1;
}
}
If (caozuo = "")
{
If (erwei [reny, renx-1] = "")
{
Renx = renx-1;
}
}
If (caozuo = "s ")
{
If (erwei [reny + 1, renx] = "")
{
Reny = reny + 1;
}
}
If (caozuo = "d ")
{
If (erwei [reny, renx + 1] = "")
{
Renx = renx + 1;
}
}
Erwei [reny, renx] = "persons ";
Console. Clear ();
If (reny = 0 & renx = 9)
{
Console. Write ("end of game ");
Break;
}
}
Console. ReadLine ();