16 lines
230 B
Crystal
16 lines
230 B
Crystal
File.write("input.txt", "a\nb\nc")
|
|
|
|
lines = Channel(String).new
|
|
|
|
spawn do
|
|
File.each_line("input.txt") do |line|
|
|
lines.send(line)
|
|
end
|
|
lines.close
|
|
end
|
|
|
|
while line = lines.receive?
|
|
puts line
|
|
end
|
|
|
|
File.delete("input.txt")
|