Skip to content

Instantly share code, notes, and snippets.

@ethagnawl
Created January 25, 2018 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethagnawl/2302a77d598a64019330e6940c89fdd3 to your computer and use it in GitHub Desktop.
Save ethagnawl/2302a77d598a64019330e6940c89fdd3 to your computer and use it in GitHub Desktop.
code world example animation
{-# LANGUAGE OverloadedStrings #-}
-- https://code.world/haskell#PixXtGR4nGRgWBfvNFl9M9g
import CodeWorld
main = do
let animFunc = (\x -> rotated x $ rectangle (x * x) (x * 3))
expand = (\x y -> x + y)
contract = (\x y -> x - y)
step = (\x y -> if y > 4 then (contract x y) else (expand x y))
simulationOf 1.1 step animFunc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment