2

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?

tohanov
  • 36
  • 2

1 Answers1

1

try running it like this:

 >echo 4 | ruby golfscript.rb prnt.gs
AndoDaan
  • 111
  • 2