Mapa mental
Programming
Contenido del mapa
Programming
Programming is simply providing instructions to a computer to solve a problem
The main skill that programming requires is problem solving
Import turtle
- wn = turtle.Screen()
- daisy = turtle.Turtle()
- These three lines of code are essential. Without them the code will fail.
- daisy = turtle.Turtle()
- wn = turtle.Screen()
daisy.forward(150)
- Name followed by dot and instruction then brackets and the amount of pixels.
- daisy.left(90)
- daisy.right(90)
- Basic movement commands
- Also include goto(coorodinates)
- turtle.pensize()
- turtle.widthe()
- daisy.goto(300,-300)
- turtle.pensize()
- Also include goto(coorodinates)
- Basic movement commands
- daisy.right(90)
daisy.penup()
- daisy.pendown()
- Allows pen to be lifted to correct location without drawing and then put back down again
- daisy.pendown()
daisy.pencolor("red")
- makes pen a certain colour and when you want to change the colour you reinsert this line of code with a different colour in the brackets.
daisy.fillcolor("yellow")
- fills in the inside of an object with that colour. Also changeable
- Before filling needs the line of code daisy.begin_fill()
- After fill is complete the line daisy.end_fill() is required.
For x in range(5):
- daisy.forward(200)
- daisy.left(72)
- This line of code is repeated however many times is in the bracket to make a shape quicker.
- daisy.left(72)
- daisy.forward(200)
We can use procedures to make more efficient code.
- DrawPentagon can be used
- def drawPentagon():
- for x in range(5):
- daisy.forward(200)
- daisy.left(72)
- This code is now under drawPentagon so whenever drawPentagon is called up it will do what the code at the start says.
- daisy.left(72)
- daisy.forward(200)
- for x in range(5):
- Always put any new procedures at the top of the code.
- def drawPentagon():
- DrawPentagon can be used
Información
- Descripción
- Computer Science Mapa Mental sobre Programming, creado por monty adams el 24/05/2021.
- Creado por
- monty adams · may 2021
- Actualizado
- 7 jun 2021
- Visitas
- 2
- Valoración