23 lines
398 B
Plaintext
23 lines
398 B
Plaintext
!import "base" !Local
|
|
!import "list" !Local
|
|
|
|
incDecRev = y (self : matchList
|
|
"1"
|
|
(digit rest :
|
|
matchBool
|
|
(pair 48 (self rest))
|
|
(pair (succ digit) rest)
|
|
(equal? digit 57)))
|
|
|
|
showNumberRev_ = y (self n acc :
|
|
matchBool
|
|
acc
|
|
(self (pred n) (incDecRev acc))
|
|
(equal? n 0))
|
|
|
|
showNumber = (n :
|
|
matchBool
|
|
"0"
|
|
(reverse (showNumberRev_ n t))
|
|
(equal? n 0))
|