19 lines
419 B
Haskell
19 lines
419 B
Haskell
|
|
|
|
module AI (aimove) where
|
|
|
|
import Eval
|
|
import Lambda
|
|
import GoalTransform
|
|
|
|
cannon 1 = "dec"
|
|
cannon 2 = "S dec dec"
|
|
cannon n = "S(" ++ cannon (n-1) ++ ") dec"
|
|
|
|
keepalive func 0 = "S(" ++ func ++ ")(get)0"
|
|
keepalive func 1 = "S(K(S(" ++ func ++ ")(get)))(succ)0"
|
|
keepalive func slot = "S(" ++ func ++ ")(S (K get) (K " ++ show slot ++ "))0"
|
|
|
|
aimove :: Turn Goal
|
|
aimove = return (Just 1, read $ keepalive (cannon 200) 1)
|