From 70fbe46dc17c0fa8377d5fec663b53c0ce0e0cdb Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Mon, 4 Nov 2013 13:19:04 -0500 Subject: [PATCH] cleanup etc/tak.scm --- etc/tak.scm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/etc/tak.scm b/etc/tak.scm index b3c4d46b..8453a4a7 100644 --- a/etc/tak.scm +++ b/etc/tak.scm @@ -1,16 +1,12 @@ -(define start #f) - -(define end #f) - (define (time f) - (set! start (current-jiffy)) - (f) - (set! end (current-jiffy)) - (/ (- end start) (jiffies-per-second))) + (let ((start (current-jiffy))) + (f) + (/ (- (current-jiffy) start) + (jiffies-per-second)))) (define (tak x y z) (if (> x y) - (tak (tak (- x 1) y z) + (tak (tak (- x 1) y z) (tak (- y 1) z x) (tak (- z 1) x y)) y)) @@ -19,3 +15,4 @@ (tak 12 6 0)) (write (time f)) +(newline)