In class we have been learning to demonstrate coding concepts. While I was playing Code Combat we were using the For loop and the While loop. Today we have also been making on a maze game using Python, Trinket, we added a character that could move using the Down, Up, Left and Right keys.
I really like Code Combat and Trinket, I like Code Combat because it is fun and we are also learning more about coding. I like Trinket because we get to make whatever and the end products always look professional and well layed-out.
Thursday, 29 June 2017
Thursday, 22 June 2017
Programming concepts
I am using Python Trinket to work. I can use the For loop to write efficiently. Today we are learning to demonstrate Programming Concepts. I have learned how to make the turtle go through the maze using the For loop.
The 'For' loop is our friend and we are discovering that instead of writing the same code over and over again we can use the 'for i in range'.
in the Maze Challenge the turtle has to navigate its way through the Maze and instead of using three lots of code we can trim it down to;
for i in range(0,3):
myPen.forward(70)
myPen.right(90)
myPen.forward(120)
myPen.left(90)
myPen.forward(45)
myPen.left(90)
myPen.forward(120)
myPen.right(90)
myPen.forward(30)
Here is what the challenge looks like on the Python trinket.
The 'For' loop is our friend and we are discovering that instead of writing the same code over and over again we can use the 'for i in range'.
in the Maze Challenge the turtle has to navigate its way through the Maze and instead of using three lots of code we can trim it down to;
for i in range(0,3):
myPen.forward(70)
myPen.right(90)
myPen.forward(120)
myPen.left(90)
myPen.forward(45)
myPen.left(90)
myPen.forward(120)
myPen.right(90)
myPen.forward(30)
Here is what the challenge looks like on the Python trinket.
Thursday, 8 June 2017
Working with Python Trinket
As a year 7 student at Cobden school I am learning to use Python to design a simple Turtle game. I will learn how to import the turtle graphics and then program the turtle to do various activities. I will be using a Python IDLE window to run my game.
Subscribe to:
Posts (Atom)