{"id":21319111,"url":"https://github.com/kongnet/turtle","last_synced_at":"2025-07-12T04:31:31.702Z","repository":{"id":184577941,"uuid":"672137082","full_name":"kongnet/turtle","owner":"kongnet","description":"Simulate Turtle Geometry","archived":false,"fork":false,"pushed_at":"2024-07-07T13:36:24.000Z","size":937,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-07T14:52:24.177Z","etag":null,"topics":["animation","fractal","js","logo","turtle"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kongnet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-29T03:40:07.000Z","updated_at":"2024-07-07T13:36:28.000Z","dependencies_parsed_at":"2023-07-29T05:29:43.297Z","dependency_job_id":"50e7fd47-b62c-47ef-a5bb-b51d7cecfb3d","html_url":"https://github.com/kongnet/turtle","commit_stats":null,"previous_names":["kongnet/turtle"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kongnet%2Fturtle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kongnet%2Fturtle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kongnet%2Fturtle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kongnet%2Fturtle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kongnet","download_url":"https://codeload.github.com/kongnet/turtle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225792661,"owners_count":17524991,"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":["animation","fractal","js","logo","turtle"],"created_at":"2024-11-21T19:34:08.210Z","updated_at":"2025-07-12T04:31:31.689Z","avatar_url":"https://github.com/kongnet.png","language":"HTML","readme":"# Turtle\n\n\u003e I enjoy the turtle geometry, so I implemented a simplified version using vanilla JavaScript.\n\n\u003e Simulate Turtle Geometry\n\n- fd() forward\n- bk() backward\n- rt() right\n- lt() left\n- pu() penup\n- pd() pendown\n- repeat()\n- setxy() put the turtle at coordinate(x, y)\n- home() bring the turtle at the center\n- cs() clearscreen\n\n\u003e run() vs go(), go() can clear atction queue, run() not\n\n```javascript\nconst t = new Turtle({ debug: false })\nt.fd(10).rt(90).repeat(4).go() // draw a square\n```\n\n```javascript\n/*\n  combine t0, t1\n  t0,t1 can play solo, use t.to('t0').run()\n*/\nconst t = new Turtle({ debug: false })\n\nt.to('t0').fd(0.1).rt(2).repeat(90)\nt.to('t1').fd(0.1).lt(2).repeat(90)\nt.to().add('t0').add('t1').rt(90).repeat(4).rt(36).repeat(10).go()\n\nconsole.log(t.list) // ['_mainproc', 't0', 't1']\n```\n\n- demo1 regular polygon\n- demo2 regular star polygon\n- demo3 constant velocity helix + golden spiral\n- demo4 variable speed helix\n- demo5 Koch curve\n- demo6 Fractal Tree\n- demo7 Sierpinski triangle\n- demo8 Leaf\n\n![screenshot](https://github.com/kongnet/turtle/blob/main/screenshot/s1.png)\n\n## Animation\n\n```javascript\nlet t = new Turtle({ debug: false, animate: 2 }) // draw speed\nt.to('t0').fd(0.1).rt(2).repeat(90) // combine\nt.to('t1').fd(0.1).lt(2).repeat(90)\nt.to().add('t0').add('t1').rt(90).repeat(4).rt(36).repeat(10).go()\n```\n\n![Animation](https://github.com/kongnet/turtle/blob/main/screenshot/s3.gif)\n\n## turtle-maze.html\n\n![Maze](https://github.com/kongnet/turtle/blob/main/screenshot/s2.jpg)\n\n## Programming Learning Syllabus for Elementary Students\n\n![Maze](https://github.com/kongnet/turtle/blob/main/screenshot/s4.png)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkongnet%2Fturtle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkongnet%2Fturtle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkongnet%2Fturtle/lists"}