lab08: init
This commit is contained in:
15
lab08/bender.hs
Normal file
15
lab08/bender.hs
Normal file
@@ -0,0 +1,15 @@
|
||||
type Pos = (Int, Int)
|
||||
|
||||
start = (0,0)
|
||||
|
||||
up (x, y) = (x, y+1)
|
||||
down (x, y) = (x, y-1)
|
||||
left (x, y) = (x-1, y)
|
||||
right (x, y) = (x+1, y)
|
||||
|
||||
x -: f = f x
|
||||
|
||||
-- Using the "-:" operator, we can chain movements together
|
||||
test1 = start -: up -: right
|
||||
test2 = start -: up -: left -: left -: right -: down
|
||||
|
||||
Reference in New Issue
Block a user