Computational Thinking is solving problems in a logical way, especially so the solution can be executed by a computer.
There are 4 key parts of computational thinking:
Decomposition - breaking a large problem down into smaller problems to make the large problem easier to solve.
Abstraction - hiding unnecessary parts of a problem to make the problem easier to solve.
Pattern recognition - looking for patterns to make the solution more efficient
Creating an algorithm - writing step to solve the problem.
On paper, draw the envelope starting at the bottom left IN ONE SINGLE MOVEMENT AND WITHOUT GOING OVER ANY OTHER LINES.
Now we will use Python Turtle to create this image.
Turtle is a drawing module in Python.
It works using the co-ordinates of the screen.
The centre of the screen is x 0, y 0.
See the image on the right to see how this works in practice.
To the right is some code to start you off.
-------------------------------->
Copy and paste this into Thonny (find it in the Computer Science apps folder)
Once you have completed your code, screenshot the result AND the code to your PowerPoint.
Explain how you used decomposition to solve the problem.
On a new Python file (Thonny - File - New) - use turtle to draw your initials on screen. Remember to import turtle first using
import turtle.
Loops allow programmers to shorten code.
We use them when we recognise a pattern of repeated code.
On the left you will see the code to draw a rectangle.
<---------------------
Remember that to fill the square with colour you need to 'wrap' the shape with the colour and begin_fill() and end_fill()
Then try to create some of the flags above. ^^^^^
You can now create all kinds of shapes - it's just a question of how many sides and what angle to turn.
The code below will draw a 5 point star.
What happens if you increase the number of sides and change the angle???
Your teacher will give you the class code for your class.
Now have some fun and learn some more Python!
turtle.write("Happy Christmas!", align="center", font=("Courier", 16, "bold"))
# note the American spelling of center.