Posted 18 March 2012 - 04:22 PM
Hi,
sorry if this is a noob question, but I can't figure this out :/
I've written a little program for the turtle, which makes it move until it hits an obstacle. If it hits one, it starts turning around, until the way is free again. Up to now, I used an infinite loop for that, but this isn't a really nice way to go, so I want the turtle to write something like: "Shut this unit down?:" , if you type nothing, the turtle continues to work, if you type "yes", the loop breaks.
My problem is now, that when I use io.read() to get the input, the turtle stops working until I type something in. I hope it's clear what i mean. Basically, I want the turtle to work until i type "yes".
thanks for any help!
sorry if this is a noob question, but I can't figure this out :/
I've written a little program for the turtle, which makes it move until it hits an obstacle. If it hits one, it starts turning around, until the way is free again. Up to now, I used an infinite loop for that, but this isn't a really nice way to go, so I want the turtle to write something like: "Shut this unit down?:" , if you type nothing, the turtle continues to work, if you type "yes", the loop breaks.
My problem is now, that when I use io.read() to get the input, the turtle stops working until I type something in. I hope it's clear what i mean. Basically, I want the turtle to work until i type "yes".
thanks for any help!