Skip to content

Instantly share code, notes, and snippets.

@bootandy
Last active April 28, 2016 10:12
Show Gist options
  • Select an option

  • Save bootandy/2706b26187e7981be466cef61487d986 to your computer and use it in GitHub Desktop.

Select an option

Save bootandy/2706b26187e7981be466cef61487d986 to your computer and use it in GitHub Desktop.
simple_turtle_puzzle.py
# This task is meant to simulate tiling a wall.
# It uses Turtle also known as Logo.
# Turtle instructions
# https://docs.python.org/2/library/turtle.html
# Sample code:
import turtle
turtle.position()
turtle.forward(50)
turtle.right(90)
turtle.forward(50)
turtle.penup()
turtle.forward(50)
turtle.pendown()
turtle.forward(50)
exit = input('Press a key to quit')
# Task 1:
# Draw a square. Put the code in a function. This square is a 'tile'.
# Task 2:
# Draw a square 800 X 800 pixels wide. This is the 'wall'
# Draw a grid of tiles spaced 1 pixel apart on the 800 X 800 'wall'
# Task 3:
# 'Cut' the tile so it fills the 800 X 800 space exactly and does not overlap. Mark the cut edge with a different colour.
# Task 4:
# Allow user to enter the size of a tile, draw a grid of tiles this size.
# Task 5:
# Allow User can specify square tiles or hexagon tiles as well as size.
# Random Bonus Tasks:
# Make every 5th tile a different colour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment