File tree Expand file tree Collapse file tree 4 files changed +47
-0
lines changed Expand file tree Collapse file tree 4 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ (define (clockhands i)
2+ (define t (floor (/ (+ (* 43200 i) 21600 ) 11 )))
3+ (define-values (h m s)
4+ (values (floor (/ t 3600 ))
5+ (remainder (floor (/ t 60 )) 60 )
6+ (remainder t 60 )))
7+ (printf "~a:~a:~a~n "
8+ (~a (if (= h 0 ) 12 h) #:width 2 #:align 'right #:left-pad-string "0 " )
9+ (~a m #:width 2 #:align 'right #:left-pad-string "0 " )
10+ (~a s #:width 2 #:align 'right #:left-pad-string "0 " ))
11+ (when (< i 10 ) (clockhands (+ i 1 ))))
12+
13+ (clockhands 0 )
Original file line number Diff line number Diff line change 1+ (println "Hello, World! " )
Original file line number Diff line number Diff line change 1+ function Assert-MatchTests {
2+ param (
3+ [Parameter (Mandatory = $true , ValueFromPipeline )] $TestResult
4+ )
5+
6+ if ($TestResult ) {
7+ Write-Error " Output does not match expected results."
8+ }
9+ }
10+
11+ $Error.clear ()
12+ racket -f " $PSScriptRoot \clockhands.rkt" |
13+ Compare-Object (Get-Content " $PSScriptRoot \..\test\clockhands_expected" ) |
14+ Assert-MatchTests &&
15+ racket -f " $PSScriptRoot \hello.rkt" &&
16+ racket -f " $PSScriptRoot \triple_imperative.rkt" |
17+ Compare-Object (Get-Content " $PSScriptRoot \..\test\triple_expected" ) |
18+ Assert-MatchTests &&
19+ ForEach-Object ' foo' ;
20+
21+ if ($Error -or ! $? ) {
22+ " *** RACKET TESTS FAILED ***"
23+ }
24+ else {
25+ " RACKET TESTS PASSED"
26+ }
27+
28+
Original file line number Diff line number Diff line change 1+ (for* ([c (in-range 1 41 )]
2+ [b (in-range 1 c)]
3+ [a (in-range 1 b)]
4+ #:when (= (+ (sqr a) (sqr b)) (sqr c)))
5+ (printf "~v, ~v, ~v~n " a b c))
You can’t perform that action at this time.
0 commit comments