RosettaCodeData/Task/Input-loop/GDScript/input-loop.gd

14 lines
289 B
GDScript3
Raw Normal View History

2023-07-01 11:58:00 -04:00
extends MainLoop
func _process(_delta: float) -> bool:
while true:
# Read a line from stdin
var input: String = OS.read_string_from_stdin()
# Empty lines are "\n" whereas end of input will be completely empty.
if len(input) == 0:
break
printraw(input)
return true # Exit