aboutsummaryrefslogtreecommitdiff
path: root/ex/str2rip.rip
blob: 1b5b369407b1c712c83ee14696a0d5268555639e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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]