Advertisement
TheFastFish

elon-deadfish

Apr 13th, 2016
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. $ Deadfish interpreter $
  2. {
  3. "cmd" define
  4. cmd "i" equal { x 1 add "x" define } do
  5. cmd "d" equal { x 1 subtract "x" define } do
  6. cmd "s" equal { x x multiply "x" define } do
  7. cmd "o" equal dup
  8. { x print } do { "\n" print } do-not
  9. "cmd" undefine
  10. } "parse" define
  11.  
  12. 0 "x" define
  13. set
  14. "\n>>" print
  15. "String" input
  16. untie
  17. length 0 not-equal { set
  18. shift parse
  19. x 256 equal x -1 equal or
  20. { 0 "x" define } do
  21. length 0 not-equal { repeat } do
  22. pop
  23. forget } do
  24. repeat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement