almost working something

This commit is contained in:
2024-01-03 20:31:37 +01:00
parent 7c54d16273
commit 2db8b5984f
9 changed files with 262 additions and 34 deletions

21
clitests/coffee.psil Normal file
View File

@@ -0,0 +1,21 @@
(define (getmax a b)
(if (> a b) a b)
)
(define (coffee-shop-impl times last cur max)
(if (= times (nil))
(getmax cur max)
(if (= last (car times))
(coffee-shop-impl (cdr times) last (+ cur 1) max)
(coffee-shop-impl (cdr times) (car times) 1 (getmax cur max))
)
)
)
(define (coffee-shop times)
(coffee-shop-impl times (nil) 0 0)
)
(coffee-shop (nil))
(coffee-shop (quote( (8 0) (8 10) (8 10) (8 45) )))
(coffee-shop (quote( (8 12) (10 11) (10 11) (15 15) (15 15) (15 15) (22 22) (22 22) (22 59) )))

3
clitests/coffee.res Normal file
View File

@@ -0,0 +1,3 @@
0
2
3

View File

@@ -20,6 +20,7 @@ for FILE in *.psil; do
continue
fi
echo "$FILE OK"
rm $FILE.res
done