Lab 01 done
This commit is contained in:
parent
13022f03d0
commit
f74b87b869
30
Labs/01.rkt
Normal file
30
Labs/01.rkt
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#lang plait
|
||||||
|
|
||||||
|
(define (And l r)
|
||||||
|
(cond
|
||||||
|
[l r]
|
||||||
|
[else #f]))
|
||||||
|
|
||||||
|
(define (Or l m r)
|
||||||
|
(cond
|
||||||
|
[l #t]
|
||||||
|
[m #t]
|
||||||
|
[r #t]
|
||||||
|
[else #f]))
|
||||||
|
|
||||||
|
(define (Not v)
|
||||||
|
(cond
|
||||||
|
[v #f]
|
||||||
|
[else #t]))
|
||||||
|
|
||||||
|
|
||||||
|
(test (And #f #f) #f)
|
||||||
|
(test (And #f #t) #f)
|
||||||
|
(test (And #t #f) #f)
|
||||||
|
(test (And #t #t) #t)
|
||||||
|
(test (Or #f #f #f) #f)
|
||||||
|
(test (Or #t #f #f) #t)
|
||||||
|
(test (Or #f #t #f) #t)
|
||||||
|
(test (Or #f #f #t) #t)
|
||||||
|
(test (Not #t) #f)
|
||||||
|
(test (Not #f) #t)
|
Loading…
x
Reference in New Issue
Block a user