{"id":24787670,"url":"https://github.com/aneilmac/worldturtle-haskell","last_synced_at":"2025-10-12T11:31:53.591Z","repository":{"id":43217036,"uuid":"265720872","full_name":"aneilmac/worldturtle-haskell","owner":"aneilmac","description":"LOGO-like Turtle Graphics in the Haskell language using Monads.","archived":false,"fork":false,"pushed_at":"2022-04-03T19:55:44.000Z","size":2134,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-30T18:56:59.342Z","etag":null,"topics":["haskell","logo","monad","simulation","teaching","turtle","turtle-graphics"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aneilmac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-21T01:02:29.000Z","updated_at":"2024-02-20T22:19:44.000Z","dependencies_parsed_at":"2022-09-13T18:13:40.386Z","dependency_job_id":null,"html_url":"https://github.com/aneilmac/worldturtle-haskell","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneilmac%2Fworldturtle-haskell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneilmac%2Fworldturtle-haskell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneilmac%2Fworldturtle-haskell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneilmac%2Fworldturtle-haskell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aneilmac","download_url":"https://codeload.github.com/aneilmac/worldturtle-haskell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236210699,"owners_count":19112872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell","logo","monad","simulation","teaching","turtle","turtle-graphics"],"created_at":"2025-01-29T16:13:04.511Z","updated_at":"2025-10-12T11:31:47.906Z","avatar_url":"https://github.com/aneilmac.png","language":"Haskell","readme":"# WorldTurtle [![Hackage][Hackage badge]][Hackage page]\n\n## Turtle Animations in Haskell\n\nWorldTurtle is a Haskell take on [Turtle Graphics][Turtle graphics wiki].\n\nThe intent of this module is a teaching tool by using turtle commands to\nproduce animations.\n\n![parallel circles animation](worldturtle/docs/images/parallel_circles_animated.gif)\n\n## Features\n\n### Monadic commands\n\nTurtle commands are monads!\n\nThe following snippet produces a square:\n\n```haskell\nimport Graphics.WorldTurtle\n\nmain :: IO ()\nmain = runTurtle $\n  repeatFor 4 $ do\n    forward 90\n    right 90\n```\n\nLike so!\n\n![turtle drawing a square](worldturtle/docs/images/basic_turtle_square.gif)\n \n### Parallel animations\n\nUse of the parallel animation operator `(\u003e!\u003e)` allows animations to run in\nparallel. The\n  [parallel/serial comparison](worldturtle-examples/parallelserialcomparison/Main.hs)\nexample shows that when given this code:\n\n```haskell\nimport Graphics.WorldTurtle\n\nmain :: IO ()\nmain = runWorld $ do\n  turtle1 \u003c- makeTurtle' (0, 0) north green\n  turtle2 \u003c- makeTurtle' (0, 0) north red\n\n  -- Draw the anticlockwise and clockwise circles in sequence. \n  (turtle1 \u003e/\u003e circle 90) \u003e\u003e (turtle2 \u003e/\u003e circle (-90))\n  \n  clear\n\n  -- Draw the anticlockwise and clockwise circles in parallel.\n  (turtle1 \u003e/\u003e circle 90) \u003e!\u003e (turtle2 \u003e/\u003e circle (-90))\n```\n\nWe get this animation:\n\n![serial vs parallel comparison](worldturtle/docs/images/parallel_serial_turtles_2.gif)\n\n### Interactive Controls\n\nYou can interact with the animation window in the following ways:\n\n| Action                                  | Interaction        |\n|-----------------------------------------|--------------------|\n| Pan the viewport.                       | Click and drag     |\n| Zoom in/out.                            | Mousewheel up/down |\n| Reset the viewport to initial position. | Spacebar           |\n| Reset the animation.                    | `R` key            |\n| Pause the animation.                    | `P` key            |\n| Quit                                    | Escape key         |\n\n## Examples\n\nFor all examples, look [here](worldturtle-examples)!\n\n### [spiralstar](worldturtle-examples/spiralstar/Main.hs) example\n\n![spiralstar animation](worldturtle-examples/spiralstar/output.gif)\n\n### [spiralsquare](worldturtle-examples/spiralsquare/Main.hs) example\n\n![spiralsquare animation](worldturtle-examples/spiralsquare/output.gif)\n\n### [lsystem](worldturtle-examples/lsystem/Main.hs) example\n\n![lsystem animation](worldturtle-examples/lsystem/output.gif)\n\n## Building a project\n\n### Prerequisites\n\nTo build this project you need `stack` and `ghc`. If you don't\nalready have these, then you can install them easily from the\n[Haskell Platform](https://www.haskell.org/platform/)!\n\n#### Windows\n\nIf you get this error on startup:\n\n\u003e user error (unknown GLUT entry glutInit)\n\nThen this means you need the `freeglut MSVC` binaries which you can get\n[here](https://www.transmissionzero.co.uk/software/freeglut-devel/).\n\nExtract `freeglut\\bin\\x64\\freeglut.dll` to the same location as the executable\nyou wish to run, or place it in a folder that can be discovered by your `%PATH%` variable.\n([Here are some steps](https://docs.alfresco.com/4.2/tasks/fot-addpath.html) on how to add a new folder to your `%PATH%`.)\n\n### Making a new turtle project from a template\n\nUsing stack, you can create your own `worldturtle` project by using the provided\ntemplate.\n\nTo create and run your own project, use the following commands to get setup:\n\n```sh\nstack new my-new-project aneilmac/worldturtle\ncd my-new-project\nstack build\nstack exec my-new-project\n```\n\n## Building and running examples\n\nExamples can be built via [stack](https://docs.haskellstack.org/en/stable/README/).\n\n```sh\nstack setup\nstack build\n```\n\nAfter building, examples in the `worldturtle-examples` folder can then be\nexecuted from stack. To run `parallelcircles` try:\n\n```sh\nstack exec parallelcircles-exe\n```\n\n[Hackage page]: https://hackage.haskell.org/package/worldturtle\n[Hackage badge]: https://img.shields.io/hackage/v/worldturtle\n[Turtle graphics wiki]: https://en.wikipedia.org/wiki/Turtle_graphics\n\n## Transcoding from LOGO to WorldTurtle\n\nSee [here](LOGOTRANSCODE.md) for a detailed description on porting LOGO code to WorldTurtle.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faneilmac%2Fworldturtle-haskell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faneilmac%2Fworldturtle-haskell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faneilmac%2Fworldturtle-haskell/lists"}