Skip to content

Instantly share code, notes, and snippets.

@talbergs talbergs/

forked from robacarp/
Created Aug 3, 2018
What would you like to do?
crystal single character read from stdin
print "Type something: "
entered_chars = [] of Char
STDIN.raw do
loop do
char = STDIN.read_char
next if char.nil?
entered_chars << char
print char
# exit when user enters ^d
break if char.ord == 4
puts "You said: #{"")}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.