舵龟基于helm游戏引擎的Turtle模块。例子:
import FRP.Helm
import FRP.Helm.Window as Window
import FRP.Helm.Turtle
myprogram :: FieldAction
myprogram = do
setSpeed 20
penUp
goto ((-200), 0)
penDown
koch 500
koch :: Int -> FieldAction
koch n
| n <= 10 = fd 5
| otherwise = do
koch (n `div` 3)
lt 60
koch (n `div` 3)
rt 120
koch (n `div` 3)
暂无评论