#Read from STDIN
Read from STDIN
GolfScript can read from stdin:
"#{STDIN.read}"
This will continue reading from STDIN until the EOF is reached. Alternatively:
"#{STDIN.gets}"
or
"#{STDIN.readline}"
Other things available:
getbyte
getc
gets([sep])
gets(limit)
gets(sep, limit)
inspect # perhaps useful for an underhanded contest
isatty
read([length])
readbyte
readchar
readline([sep])
readline(limit)
readline(sep, limit)
readlines([sep])
readlines(limit)
readlines(sep, limit)
readpartial(maxlen [, outbuf])
For each of these, they can only be used once (and also once for each change of the parameter, also once more with empty parentheses); after that, the original value is what you'll get instead of a new value.
#Read from STDIN
GolfScript can read from stdin:
"#{STDIN.read}"
This will continue reading from STDIN until the EOF is reached. Alternatively:
"#{STDIN.gets}"
or
"#{STDIN.readline}"
Other things available:
getbyte
getc
gets([sep])
gets(limit)
gets(sep, limit)
inspect # perhaps useful for an underhanded contest
isatty
read([length])
readbyte
readchar
readline([sep])
readline(limit)
readline(sep, limit)
readlines([sep])
readlines(limit)
readlines(sep, limit)
readpartial(maxlen [, outbuf])
For each of these, they can only be used once (and also once for each change of the parameter, also once more with empty parentheses); after that, the original value is what you'll get instead of a new value.
Read from STDIN
GolfScript can read from stdin:
"#{STDIN.read}"
This will continue reading from STDIN until the EOF is reached. Alternatively:
"#{STDIN.gets}"
or
"#{STDIN.readline}"
Other things available:
getbyte
getc
gets([sep])
gets(limit)
gets(sep, limit)
inspect # perhaps useful for an underhanded contest
isatty
read([length])
readbyte
readchar
readline([sep])
readline(limit)
readline(sep, limit)
readlines([sep])
readlines(limit)
readlines(sep, limit)
readpartial(maxlen [, outbuf])
For each of these, they can only be used once (and also once for each change of the parameter, also once more with empty parentheses); after that, the original value is what you'll get instead of a new value.
#Read from STDIN
GolfScript can read from stdin:
"#{STDIN.read}"
"#{STDIN.read}"
This will continue reading from STDIN until the EOF is reached. Alternatively:
"#{STDIN.gets}"
"#{STDIN.gets}"
or
"#{STDIN.readline}"
"#{STDIN.readline}"
Other things available:
"#{STDIN.readlines}"
"#{STDIN.readchar}"
"#{STDIN.readbyte}"
"#{STDIN.readpartial(int)}" # int is any integer
getbyte
getc
gets([sep])
gets(limit)
gets(sep, limit)
inspect # perhaps useful for an underhanded contest
isatty
read([length])
readbyte
readchar
readline([sep])
readline(limit)
readline(sep, limit)
readlines([sep])
readlines(limit)
readlines(sep, limit)
readpartial(maxlen [, outbuf])
For each of these, they can only be used once (and also once for each change of the parameter, also once more with empty parentheses); after that, the original value is what you'll get instead of a new value.
#Read from STDIN
GolfScript can read from stdin:
"#{STDIN.read}"
This will continue reading from STDIN until the EOF is reached. Alternatively:
"#{STDIN.gets}"
or
"#{STDIN.readline}"
Other things available:
"#{STDIN.readlines}"
"#{STDIN.readchar}"
"#{STDIN.readbyte}"
"#{STDIN.readpartial(int)}" # int is any integer
For each of these, they can only be used once (and also once for each change of the parameter); after that, the original value is what you'll get instead of a new value.
#Read from STDIN
GolfScript can read from stdin:
"#{STDIN.read}"
This will continue reading from STDIN until the EOF is reached. Alternatively:
"#{STDIN.gets}"
or
"#{STDIN.readline}"
Other things available:
getbyte
getc
gets([sep])
gets(limit)
gets(sep, limit)
inspect # perhaps useful for an underhanded contest
isatty
read([length])
readbyte
readchar
readline([sep])
readline(limit)
readline(sep, limit)
readlines([sep])
readlines(limit)
readlines(sep, limit)
readpartial(maxlen [, outbuf])
For each of these, they can only be used once (and also once for each change of the parameter, also once more with empty parentheses); after that, the original value is what you'll get instead of a new value.
#Read from STDIN
GolfScript can read from stdin:
"#{STDIN.read}"
This will continue reading from STDIN until the EOF is reached. Alternatively:
"#{STDIN.readlinegets}"
This reads only one line from STDIN. This will only read the first line, so with "#{STDIN.readline}""#{STDIN.readline}" and an input ofor
apple
banana "#{STDIN.readline}"
the output isOther things available:
apple"#{STDIN.readlines}"
apple"#{STDIN.readchar}"
"#{STDIN.readbyte}"
"#{STDIN.readpartial(int)}" # int is any integer
For each of these, they can only be used once (and also once for each change of the parameter); after that, the original value is what you'll get instead of a new value.
#Read from STDIN
GolfScript can read from stdin:
"#{STDIN.read}"
This will continue reading from STDIN until the EOF is reached. Alternatively:
"#{STDIN.readline}"
This reads only one line from STDIN. This will only read the first line, so with "#{STDIN.readline}""#{STDIN.readline}" and an input of
apple
banana
the output is
apple
apple
#Read from STDIN
GolfScript can read from stdin:
"#{STDIN.read}"
This will continue reading from STDIN until the EOF is reached. Alternatively:
"#{STDIN.gets}"
or
"#{STDIN.readline}"
Other things available:
"#{STDIN.readlines}"
"#{STDIN.readchar}"
"#{STDIN.readbyte}"
"#{STDIN.readpartial(int)}" # int is any integer
For each of these, they can only be used once (and also once for each change of the parameter); after that, the original value is what you'll get instead of a new value.