mirror of
https://github.com/urbit/ares.git
synced 2024-12-24 13:55:23 +03:00
test: replace print with call to Ackermann function
This commit is contained in:
parent
0480fe615b
commit
8816d470c9
@ -196,6 +196,10 @@
|
||||
::
|
||||
:: List logic
|
||||
::
|
||||
++ snoc :: append to end of list
|
||||
|* [a=(list) b=*]
|
||||
(weld a ^+(a [b]~))
|
||||
::
|
||||
++ flop :: reverse
|
||||
~/ %flop
|
||||
|* a=(list)
|
||||
|
@ -17,6 +17,12 @@
|
||||
++ pair |$ [head tail] [p=head q=tail]
|
||||
+$ path (list knot)
|
||||
+$ wire path
|
||||
++ ack
|
||||
|= [m=@ud n=@ud]
|
||||
?~ m +(n)
|
||||
?~ n
|
||||
$(m (dec m), n 1)
|
||||
$(m (dec m), n $(n (dec n)))
|
||||
-- =>
|
||||
::
|
||||
|%
|
||||
@ -28,7 +34,7 @@
|
||||
^- ^
|
||||
:: ~> %slog.[0 'got']
|
||||
:: ~> %slog.[0 -.card.ovo]
|
||||
=/ fec [//term/1 %blit [%put "effect"] [%nel ~] ~]
|
||||
=/ fec [//term/1 %blit [%put (snoc "A(2,1) = " (add 48 (ack 2 1)))] [%nel ~] ~]
|
||||
[[fec ~] ..poke]
|
||||
--
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user