Sync
This commit is contained in:
parent
6f050a029e
commit
776bba907c
3887 changed files with 59894 additions and 7280 deletions
|
|
@ -1,7 +1,3 @@
|
|||
#lang racket
|
||||
(define (fact n)
|
||||
(if (zero? n)
|
||||
1
|
||||
(* n (fact (sub1 n)))))
|
||||
|
||||
(define (fact n) (if (zero? n) 1 (* n (fact (sub1 n)))))
|
||||
(time (fact 5000))
|
||||
|
|
|
|||
21
Task/Time-a-function/Raven/time-a-function.raven
Normal file
21
Task/Time-a-function/Raven/time-a-function.raven
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
define doId use $x
|
||||
$x dup * $x /
|
||||
|
||||
define doPower use $v, $p
|
||||
$v $p pow
|
||||
|
||||
define doSort
|
||||
group
|
||||
20000 each choose
|
||||
list sort reverse
|
||||
|
||||
define timeFunc use $fName
|
||||
time as $t1
|
||||
$fName "" prefer call
|
||||
time as $t2
|
||||
$fName $t2 $t1 -"%.4g secs for %s\n" print
|
||||
|
||||
"NULL" timeFunc
|
||||
42 "doId" timeFunc
|
||||
12 2 "doPower" timeFunc
|
||||
"doSort" timeFunc
|
||||
Loading…
Add table
Add a link
Reference in a new issue