Giter Club home page Giter Club logo

pxt-microturtle's Introduction

micro turtle Build Status

A LOGO-like turtle library for the micro:bit in MakeCode.

turtle.setPosition(0, 0)
turtle.setSpeed(45)
basic.forever(() => {
    turtle.forward(4)
    turtle.turnLeft()
})

The turtle is a single pixel moving on the micro:bit screen. It starts in the center at 2,2, pointing up.

Reference

forward #turtle-forward

Moves the turtle forward by the given amount of steps. If the turtle goes out of the screen, it wraps around.

turtle.forward(1)

back #turtle-back

Moves the turtle backward by the given amount of steps. If the turtle goes out of the screen, it wraps around.

turtle.back(1)

turn left #turtle-turnleft

Turns the turtle in a clockwise fashion by 90 degrees.

turtle.turnLeft()

turn right #turtle-turnright

Turns the turtle in a counter-clockwise fashion by 90 degrees.

turtle.turnRight()

pen #turtle-pen

Sets the drawing mode of the turtle.

  • up, the turtle leaves no trail (this is the default)
  • down, the turtle paints the LEDs
turtle.pen(TurtlePenMode.Down)

set position #turtle-setposition

Moves the turtle to a particular location

turtle.setPosition(1,1)

home #turtle-home

Moves the turtle to the center of the screen, pointing up.

turtle.home()

set speed #turtle-setspeed

Determines how many steps per second a trutle may take.

turtle.setSpeed(50)

License

MIT

Supported targets

  • for PXT/microbit
  • for PXT/calliope

(The metadata above is needed for package search.)

pxt-microturtle's People

Contributors

pelikhan avatar microsoftopensource avatar srietkerk avatar msftgits avatar almasy avatar microsoft-github-policy-service[bot] 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.