I'd like to know how to pass arguments to a golfscript program from the command line. I'm using ruby interpreter that I downloaded from golfscript.com. From what I understood from googling a bit, in ruby you pass arguments like this ruby ./program.rb 4
, but doing ruby ./golfscript.rb prnt.gs 4
doesn't work (prints an empty string).
In golfscript the arguments are supposed to be made into a string and pushed to the stack.
prnt.gs
's code is just p
(it's supposed to print the top of the stack - the argument).
What am I doing wrong?