diff options
author | tomsmeding <hallo@tomsmeding.nl> | 2015-10-04 21:01:12 +0200 |
---|---|---|
committer | tomsmeding <hallo@tomsmeding.nl> | 2015-10-04 21:01:12 +0200 |
commit | 7ceeb20b0aebe0eac8aeb9140f491973756c32bd (patch) | |
tree | f0c8cd3566f8239e6b8021a24e40d69ba45c4f93 /ex/str2rip.rip | |
parent | 82958a1498b3e2b3c4498120b97ca3133f660b50 (diff) |
Numbers and strings to rip code, on stdout and in memory!
Diffstat (limited to 'ex/str2rip.rip')
-rw-r--r-- | ex/str2rip.rip | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/ex/str2rip.rip b/ex/str2rip.rip new file mode 100644 index 0000000..1b5b369 --- /dev/null +++ b/ex/str2rip.rip @@ -0,0 +1,70 @@ +0I[ + F<reprnum>[ + 0I[[value]] + D9i9aGI[ 0I[{if value>19}] + D9iqD3r9ims 0I[[quotient modulus]] + S 0I[[modulus quotient]] + <reprnum> 0I[[modulus] -> "quotient"] + + 455mm5aD4aS87mi 0I[[modulus 'm' 'i' '9']] + ooo 0I[[modulus] -> "9im"] + D1GI[ 0I[{if modulus>1}] + <reprnum> 0I[[] -> "modulus"] + 99im7ao 0I[[] -> 'a'] + 0d 0I[[-1]] + ] + D0GI[ 0I[{if modulus>0, so =1}] + 9iDm5ao 0I[[modulus] -> 'i'] + ] + P0d 0I[[-1]] + ] + D9GI[ 0I[{if value>9, so 10..19}] + 455mm5a87mi 0I[[value 'i' '9']] + oo 0I[[value] -> "9i"] + D92aGI[ 0I[{if value>11, so 12..19}] + 9isD<reprnum> 0I[[value] -> repr(value-10)] + 99im7ao 0I[[value] -> 'a'] + ] + D9iGI[ 0I[{if value>10, so =11}] + 9iDm5ao 0I[[value] -> 'i'] + ] + P0d 0I[[-1]] + ] + D0dGI[ 0I[{if value>-1, so 0..9}] + 86mao 0I[[] -> value] + 0d 0I[[-1]] + ] + P + ] +] + + +F<reprnum>[D9i9aGI[D9iqD3r9imsS<reprnum>455mm5aD4aS87mioooD1GI[<reprnum>99im7ao0d]D0GI[9iDm5ao]P0d]D9GI[455mm5a87miooD92aGI[9isD<reprnum>99im7ao]D9iGI[9iDm5ao]P0d]D0dGI[86mao0d]P] + + + +0 + +86mo + +gD0dEnW[ + + SD3rs + + D0GI[ + D<reprnum> + 99im7ao + a + 1 + ] + D0LI[ + 0Ss + D<reprnum> + 278mm3ao + s + 1 + ] + P + 88m4ao + 278mmdo +gD0dEn] |