Coder Social home page Coder Social logo

turtle's Introduction

turtle

Crates.io Docs.rs Crates.io Crates.io Build Status Zulip Tokei Line Count

Tweet your drawings to us on Twitter at @RustTurtle and follow us to see what is being created!

Create animated drawings with the Rust programming language. This crate is a tool for teaching programming by drawing pictures. Learning this way is fun and interesting for people of all ages!

The idea: You control a turtle with a pen tied to its tail. As it moves across the screen, it draws the path that it follows. You can use this to draw any picture you want just by moving the turtle across the screen.

turtle moving forward

Documentation

Example

As a simple example, you can draw a circle with only the following code:

use turtle::Turtle;

fn main() {
    let mut turtle = Turtle::new();

    for _ in 0..360 {
        // Move forward three steps
        turtle.forward(3.0);
        // Rotate to the right (clockwise) by 1 degree
        turtle.right(1.0);
    }
}

This will produce the following:

turtle drawing a circle

See the examples/ directory for more examples of how to use this crate.

Need help?

The following are some resources you can use to find help when you run into a problem. The links are listed in the order you should try each one, but feel free to come to the Turtle Zulip anytime if you are lost.

Contributing

See CONTRIBUTING.md for information about contributing to this project including how to build and test the project, submit new examples, report bugs, and more.

Inspiration & Goals

This crate is inspired by the Logo educational programming language. Many languages contain implementations of Logo's "turtle graphics". For example, the Python programming language comes with a built-in turtle module. This crate is largely inspired by the Python implementation, but uses Rust conventions and best practices to provide the best possible platform for learning Rust.

The goal of this crate is to be as easy to approach as possible and also provide the opportunity to explore Rust's most advanced features. We welcome contributions from anyone and everyone, including those that are new to the Rust programming language.

turtle's People

Contributors

sunjay avatar noeddl avatar stevepentland avatar jay9596 avatar myrrlyn avatar arkada38 avatar dependabot-preview[bot] avatar dependabot[bot] avatar scompo avatar zachlute avatar sathwikmatsa avatar ben-ph avatar dave-tucker avatar piripant avatar dependabot-support avatar exoticorn avatar

Watchers

James Cloos avatar  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.