Code Monkey home page Code Monkey logo

logo-code-editor's Introduction

Turtle Path Editor

inspired by: Daniel Shiffman

Turtles can't speak and don't understand human language, except there is one who also doesn't understand human language, but she understands something. The language she speaks is strange, but it can be mastered relatively fast and after that you will wield the turtle the way you always desired. See the rest of this documentation to learn her tongue.

Features

  • uses a version of Logo programming language;
  • random example is shown each time webpage is reloaded;
  • there is an option to save both your code and a generated image;
  • you can Drag and Drop .logocode file right into the editor;
  • works Offline after first load.

Turtle words

  • fd followed by a number (ex.: fd 50, fd 87):
    turtle will move forward number of times;
  • bd means the same as fd but backwards (ex.: bd 10);
  • rt followed by an angle (ex.: rt 45, rt 120):
    turtle will turn right by the angle;
  • lt means the same as rt but the other way (ex.: lt 90);
  • pu:
    turtle stops drawing and moves more secretive;
  • pd:
    turtle starts drawing the line after itself;
  • clr followed by a color (ex.: clr cyan, clr #fff):
    turtle changes line color to a new one;
  • repeat followed by a number and [array of commands]:
    turtle will repeat commands in the array number of times (can be nested).
    Examples: repeat 3 [fd 100 rt 120], repeat 4 [rt 90 repeat 36 [fd 10 rt 10] ];
  • bckgr followed by a color (ex.: bckgr purple, bckgr #022a42):
    image will be filled with the new color ;
  • save:
    save an image drawn by the turtle (be careful with this one);
  • to followed by a name:
    create a method, callable by the name. To use the method call it by name.
    Example:
    to triangle repeat 3 [fd 100 rt 120] end
    triangle.

Go, try them out!

Usage locally

  1. Clone this repo (or obtain in other way);
  2. In terminal go to the directory you have files in;
  3. Enter python3 -m http.server;
  4. Visit localhost:8000 in your browser;

or just double click on index.html after saving and unzipping this repo.

Possible improvements

  • add more examples into ./examples directory
  • add cheatsheet with commands to the web page (improve editor further).

Links

logo-code-editor's People

Contributors

fabritsius avatar shiffman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.