When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
1 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
if you want to take input in a loop, you need to put the thing that takes input in a loop
read the letter separately then
yeah i thought of that
but ran into a bit of prob with it
wait lemme edit and send
still how do i get the while loop to work
you still aren't reading the letter again
so it's still the same infinite loop or no loop issue
but i am reading the letter with scanf
Separately
oh it might have been because of the space I left before %c
i removed it now but its not asking for the input at all
like it just says "Create the level" and prints the map without letting the user enter anything
oh its a working a bit now
Essentially i wrote it as scanf("%c ") now
space after %c not before
once, outside the loop
you aren't changing the value inside the loop, so the loop condition never changes
yeah i need to take multiple inputs
wait I am not?
i assigned it to WALL enum
where do you think you're changing the value of W_to_create inside the loop?
why do i need to change that
because that's your loop condition jfc
infinitely
if its S, we print map
your loop never stops if it's W
you just keep turning thigns into walls over and over until the end of time
no actually my loop is only running once
it stops automatically after running once
no matter what u enter
it does not
S or W
I tried to run it
so after assigning it to WALL, should i scanf characters again?
how else would you get new input
the wall assignment has nothing to do with your loop condition
your loop continues while W_to_create is W. You never change it after reading if the first time, so it will always keep being W, so the loop never stops
go back to what
like go back to get another scanf
the things inside your loop happen every loop
#287491279888318465 message
half an hour ago
oh
so after the for loop ended
i write another scanf
to get the char value
something like this?
instead of writing for loops, should i write while and if statements
!solved
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity