it's nearly 4am and I'm trying to implement a bool do while loop so that it can only accept certain keyboard input to exit the loop useing chars, F, B, L, R. The code's borrowed and modified by me(without success) but I must admit I don't really understand the bool reversal with the (!done) bit?
A quick fix would be nice (but I know I'm not getting that) so if someone could give me an explanation of if I even need the reversal (!done) or how it works.
Sorry for any bother but I'm flumoxed!
Here's the code.
! returns the inverted value of the bool it's given. true becomes false and false becomes true, but the variable (if that's what's given) isn't modified.
1 2 3 4 5
if get_input == F
elseif get_input == R
elseif get_input == B
else get_input == L
done true;
That's.... 4 semi-colons missing and one = sign missing. That, and I think you're missing some curly brackets around some stuff... http://cplusplus.com/doc/tutorial/control/