Created
October 16, 2012 05:43
-
-
Save pmichaud/3897389 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pmichaud@kiwi:~/p6/parrot$ git describe --tags | |
RELEASE_4_8_0-133-g1101abb | |
pmichaud@kiwi:~/p6/parrot$ cat z.pir | |
.sub 'main' :main | |
.local pmc stdin | |
stdin = getstdin | |
stdin.'encoding'('utf8') | |
sweep 1 | |
$I0 = 1000 | |
loop: | |
unless $I0 > 0 goto done | |
$S0 = $I0 | |
dec $I0 | |
goto loop | |
done: | |
print "Enter a line of text: " | |
$S1 = stdin.'readline'() | |
print "Your line is: " | |
say $S1 | |
.end | |
pmichaud@kiwi:~/p6/parrot$ ./parrot z.pir | |
Enter a line of text: hello | |
world | |
I already entered a line of text | |
Your line is: hello | |
world | |
I already entered a line of text | |
pmichaud@kiwi:~/p6/parrot$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment