I have a little problem with a C-programm, I wrote. It should be like "you go in a room.. is there a wall? no? then move on.. is there a wall? yes? then turn around" and so on. I am stucked, I go in the room and turn around but do not know how to go further.
#include <stdio.h>
void main()
{
char answer[2];
answer[0] = "Y";
answer[1] = "N";
do
{
printf("Move!\n");
printf("Is there a wall?\n");
scanf("%s",answer);
}
while (answer[0] != 'Y' );
printf("Turn around!");
}
I read about loops and ifs, but my head do not make klick. Thanks for reading, hjerteblod