Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Copy-stdin-to-stdout/Wren/copy-stdin-to-stdout.wren
Normal file
11
Task/Copy-stdin-to-stdout/Wren/copy-stdin-to-stdout.wren
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import "io" for Stdin, Stdout
|
||||
|
||||
Stdin.isRaw = true // prevents echoing to the terminal
|
||||
while (true) {
|
||||
var byte = Stdin.readByte() // read a byte from stdin
|
||||
if (byte == 13) break // break when enter key pressed
|
||||
System.write(String.fromByte(byte)) // write the byte (in string form) to stdout
|
||||
Stdout.flush() // flush output
|
||||
}
|
||||
System.print()
|
||||
Stdin.isRaw = false
|
||||
Loading…
Add table
Add a link
Reference in a new issue