Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. {%}+")1$~":x`+0x
  2.  
  3. {%}+")1$~":n`+0
  4.  
  5. $ echo -n 3 | golfscript quining.gs
  6. {3 % ")1$~"}0)1$~
  7. $ echo -n 3 | golfscript quining.gs | golfscript
  8. {3 % ")1$~"}1)1$~
  9. $ echo -n 3 | golfscript quining.gs | golfscript | golfscript
  10. {3 % ")1$~"}2)1$~
  11. $ echo -n 3 | golfscript quining.gs | golfscript | golfscript | golfscript
  12. {3 % ")1$~"}0)1$~
  13.  
  14. # (implicit) Read from STDIN.
  15. {%}+ # Concatenate the read input with the block.
  16. # For example, "3"{%}+ -> {3 %}.
  17. ")1$~":x # Push that string and save it in the the variable `x'.
  18. `+ # Inspect the string and concatenate it with the block.
  19. # For example, {3 %}'")1$~"'+ -> {3 % ")1$~"}
  20. 0x # Push a 0 and the string stored in `x'.
  21.  
  22. { } # Define a block.
  23. 3 % # Take the integer on the stack modulo 3.
  24. ")1$~" # Push that string.
  25. 0) # Push 0 and increment. Pushes 1.
  26. 1$~ # Copy the block from the bottom of the stack and execute it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement