2019-02-03 04:39:34 +01:00
|
|
|
#!/usr/bin/env retro
|
2017-10-16 18:09:39 +02:00
|
|
|
|
|
|
|
This is a simple `echo` style example.
|
|
|
|
|
|
|
|
~~~
|
2020-10-07 14:25:56 +02:00
|
|
|
#0 script:arguments
|
2017-10-16 18:09:39 +02:00
|
|
|
~~~
|
|
|
|
|
|
|
|
Then a simple loop:
|
|
|
|
|
|
|
|
- duplicate the argument number
|
|
|
|
- get the argument as a string
|
|
|
|
- display it, followed by a space
|
|
|
|
- increment the argument number
|
|
|
|
|
|
|
|
~~~
|
2020-09-14 21:55:02 +02:00
|
|
|
[ dup script:get-argument s:put sp n:inc ] times
|
2017-10-16 18:09:39 +02:00
|
|
|
~~~
|
|
|
|
|
|
|
|
And at the end, discard the argument number and inject a
|
|
|
|
newline.
|
|
|
|
|
|
|
|
~~~
|
|
|
|
drop nl
|
|
|
|
~~~
|