How will you solve the division sum: 84/4 in KTurtle using arithmetic operators with the print command?
Answers
Commands
Using commands you tell the turtle or KTurtle to do something. Some commands need input, some give output. In this section we explain all the built-in commands of KTurtle. Alternatively, using learn, you can create your own commands. Built-in commands we discuss here are highlighted with dark blue.
Moving the turtle
There are several commands to move the turtle over the screen.
forward (fw)
forward X
forward moves the turtle forward by the amount of X pixels. When the pen is down the turtle will leave a trail. forward can be abbreviated to fw.
backward (bw)
backward X
backward moves the turtle backward by the amount of X pixels. When the pen is down the turtle will leave a trail. backward can be abbreviated to bw.
turnleft (tl)
turnleft X
turnleft commands the turtle to turn an amount of X degrees to the left. turnleft can be abbreviated to tl.
turnright (tr)
turnright X
turnright the turtle to turn an amount of X degrees to the right. turnright can be abbreviated to tr.
direction (dir)
direction X
direction set the turtle's direction to an amount of X degrees counting from zero, and thus is not relative to the turtle's previous direction. direction can be abbreviated to dir.
getdirection
getdirection
getdirection returns the turtle's direction as an amount of degrees counting from zero, where zero is the direction when the turtle is pointing upwards.
center
center
center moves the turtle to the center on the canvas.
go
go X,Y
go commands the turtle to go to a certain place on the canvas. This place is X pixels from the left of the canvas, and Y pixels from the top of the canvas.
gox
gox X
gox using this command the turtle will move to X pixels from the left of the canvas whilst staying at the same height. gox can be abbreviated to gx.
goy
goy Y
goy using this command the turtle will move to Y pixels from the top of the canvas whilst staying at the same distance from the left border of the canvas. goy can be abbreviated to gy.
Note
Using the commands go, gox, goy and center the turtle will not draw a line, no matter if the pen is up or down.