brainfuck_to_comun.cmn 494 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Program that takes brainfuck program and translates it to comun.
  2. 0 "$>0 " --> # go one address up, in case first command is read
  3. @@
  4. <? ?
  5. <-
  6. $0 "+" = $1 "-" = | ?
  7. $0 -> $0 -> " " ->
  8. .
  9. $0 "<" = $1 ">" = | ?
  10. "$" -> $0 -> "0" -> " " ->
  11. .
  12. $0 "." = ?
  13. 0 "->' " -->
  14. .
  15. $0 "," = ?
  16. 0 "$<0 <- " -->
  17. .
  18. $0 91 = ? # left bracket
  19. 0 "@' " -->
  20. .
  21. $0 93 = ? # right bracker
  22. 0 ". " -->
  23. .
  24. ^
  25. ;
  26. !@
  27. .
  28. .