Please register and start creating your own cool programs

TurtleAcademy learn programming for freeYour browser is not supporting canvasWe recomand you to use Chrome or Firefox browsers

Basic Commands

  • pf(x), parafrente(x)

    Moves the turtle x points

  • paratrás (x) , pt (x)

    The turtle back x points

  • giraesquerda(x) , ge (x)

    Rotate the turtle left x degrees

  • giradireita(x) , gd(x)

    Rotate the turtle left x degrees

  • tartaruga, tat

    Will clear the screen and return the turtle home

Controlling the Pen

  • usenada, un

    Turtle stops leaving a trail

  • uselápis, ul

    The turtle will leave a trail

  • mudelargura(x), mt (x)

    Will set the waiting time to x milliseconds

  • wait

    Will cause the turtle to wait before executing the command

  • mudelargura(x)

    Will set the pen width to X

  • ocultetat, ot

    Hide the turtle

  • mostretat, mt

    Show the turtle

  • paracentro

    Moves the turtle to center, pointing upwards

  • mudex(num), mudey(num)

    Move turtle to the specified location

  • mudexy (num1,num2)

    Move turtle to the specified location

  • mudedireção(x), muded (x)

    Rotate the turtle to the specified heading

  • arc (ANGLE, RADIUS)

    Will create an arc distance RADIUS covering ANGLE angle

  • ellipse (Width , Height)

    Will craete an ellipse width Width and height Height

  • pos, coorx, coory

    Outputs the current turtle position as [ x y ], x or y respectively

  • direção

    Outputs the current turtle heading

  • direçãopara

    Outputs the heading towards the specified [ x y ] coordinates

Loops and procedure

  • repeat x [ statements ... ]

    Repeat statements x times

  • contevezes

    Outputs the current iteration number of the current repeat or forever

  • for controllist [ statements ...]

    Typical for loop. The controllist specifies three or four members: the local varname, start value, limit value, and optional step size

  • to PROCNAME inputs ... statements ... end

    Define a new named procedure with optional inputs

  • make varname expr

    Update a variable or define a new global variable. The variable name must be quoted, e.g. make 'foo 5

  • : VARNAME

    access the content of VARNAME

Lists

  • list thing1 thing2 ...

    Create a new list from the inputs

  • primeiro listname

    Outputs the first item from the list

  • semprimeiro listname , sp listname

    Outputs all the items of listname except for the first item

  • último listname

    Outputs the last item from the list

  • semúltimo listname

    Outputs all the items of listname except for the last item

  • item index list

    Outputs the indexlist item of the list or array

  • escolha listname

    Outputs one item from a list, at random

Colors

  • mudecor(x)

    Will set the turtle color accroding to the following table

    0: preto 1: azul 2: verde
    3: ciano 4: vermelho 5: magenta
    6: amarelo 7: branco 8: marrom
    9: tan 10: verde 11: aqua
    12: salmão 13: roxo 14: laranja
    15: cinza

  • mudecor [r,g,b]

    Will set the turtle color accroding to the amount of red , green and blue for example setcolor [50 100 50]

  • pinte

    Does a paint bucket flood fill at the turtle's position

  • pintenofinal fillcolor [ statements ... ]

    Execute statements without drawing but keeping track of turtle movements. When complete, fill the region traced by the turtle with fillcolor and outline the region with the current pen style

Math

  • sum x y

    sum x y

  • minus x y

    return the distance between x and y

  • sorteie(x)

    Will choose a random number between 0 - (x-1)

  • modulo expr expr

    Outputs the remainder (modulus). For remainder and % the result has the same sign as the first input; for modulo the result has the same sign as a the second input.