cleanup etc/tak.scm
This commit is contained in:
parent
aeff650ccf
commit
70fbe46dc1
15
etc/tak.scm
15
etc/tak.scm
|
@ -1,16 +1,12 @@
|
||||||
(define start #f)
|
|
||||||
|
|
||||||
(define end #f)
|
|
||||||
|
|
||||||
(define (time f)
|
(define (time f)
|
||||||
(set! start (current-jiffy))
|
(let ((start (current-jiffy)))
|
||||||
(f)
|
(f)
|
||||||
(set! end (current-jiffy))
|
(/ (- (current-jiffy) start)
|
||||||
(/ (- end start) (jiffies-per-second)))
|
(jiffies-per-second))))
|
||||||
|
|
||||||
(define (tak x y z)
|
(define (tak x y z)
|
||||||
(if (> x y)
|
(if (> x y)
|
||||||
(tak (tak (- x 1) y z)
|
(tak (tak (- x 1) y z)
|
||||||
(tak (- y 1) z x)
|
(tak (- y 1) z x)
|
||||||
(tak (- z 1) x y))
|
(tak (- z 1) x y))
|
||||||
y))
|
y))
|
||||||
|
@ -19,3 +15,4 @@
|
||||||
(tak 12 6 0))
|
(tak 12 6 0))
|
||||||
|
|
||||||
(write (time f))
|
(write (time f))
|
||||||
|
(newline)
|
||||||
|
|
Loading…
Reference in New Issue