0

I need help!!!

I want to write a small game in C, the game is to move in a labyrinth, the labyrinth is big 20x20 and I use gotoxy for move in horizontal and vertical. I want X and Y not to exceed the size of the labyrinth (20 x 20)! how can I do?

13th Feb 2020, 11:26 AM
Nicola
Nicola  - avatar
3 Respuestas
+ 4
Try make your code and share here. There is a limit then you can write... if(x>20) { x=20; } else if(x<0) { x=0; }
13th Feb 2020, 11:48 AM
Pedro H.J
Pedro H.J - avatar
0
yes thank you
13th Feb 2020, 12:20 PM
Nicola
Nicola  - avatar
0
I suggest you to use floodfill algorithm
13th Feb 2020, 1:34 PM
LastSecond959
LastSecond959 - avatar