Skip to main content

IPythonDisplayTurtles edited for my school's python courses

Project description

SSSsnake

IPythonDisplayTurtle with addded functionality for our schools python classes.

How to install from a terminal/command prompt:

pip install SSSsnake

To install from a jupyter notebook cell:

!pip install SSSsnake

How to use:

# Code adapted from one of the exercises made for my school

from SSSsnake import SSSsnake 
### VVV this segment can be hidden from students!
snake = SSSsnake(homeX = 0, homeY = 7) 
def houseAtXY(x,y):
    return [[x-1,y,3],[x+1,y,1],[x+2,y,4],[x+2,y+1,0],[x+2,y+2,0],[x+2,y+3,5],[x+1,y+3,1],[x,y+3,1],[x-1,y+3,2],[x-1,y+2,0],[x-1,y+1,0]]
walls = [];doors = [];walls.extend(houseAtXY(2,0));doors.append([2,0,1]);walls.extend(houseAtXY(7,1));doors.append([7,1,1]);walls.extend(houseAtXY(12,2));doors.append([12,2,1])
snake.drawLevel(xSize=16, ySize=8, gridSize=25, walls=walls, doors=doors)
snake.speed(10)

snake.pendown() # the snake can do more than you think! It can Draw!

# --------------------- vv Work zone vv --------------------- 

def smartmove(amount):
    for i in range(amount):
        snake.forward()

# TODO: define a function, Hint: you can use the smart move from before here as well!
# Also this snake knows how to turn left :)
### you would leave the function empty for the students to fill!
def drawncolumn(height):
    snake.left()
    smartmove(height)
    snake.right()
    snake.forward()
    snake.right()
    smartmove(height)
    snake.left()


# TODO: draw 3 collumns of length 3, 2, and 1, under the houses! 

smartmove(2)
drawncolumn(3)  
smartmove(4)
drawncolumn(2)  
smartmove(4)
drawncolumn(1) 
smartmove(2)



# --------------------- ^^ Work zone ^^ ---------------------

snake.display()

Example Turtle

Binder

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SSSsnake-0.0.24.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

SSSsnake-0.0.24-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file SSSsnake-0.0.24.tar.gz.

File metadata

  • Download URL: SSSsnake-0.0.24.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for SSSsnake-0.0.24.tar.gz
Algorithm Hash digest
SHA256 ec382cda644d906eb17e5742b713da3dc6ae9f64875f72d37bef6e81e3c1842c
MD5 0939b7a5aa6016180ddf043a4393b61b
BLAKE2b-256 843a6f66f089db2d1452e21853b3a92578613b8fc5ca8a1779704a0d10dfe073

See more details on using hashes here.

File details

Details for the file SSSsnake-0.0.24-py3-none-any.whl.

File metadata

  • Download URL: SSSsnake-0.0.24-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for SSSsnake-0.0.24-py3-none-any.whl
Algorithm Hash digest
SHA256 d5974389e6517001742c3ad6bb58581dd9f5242d14dd82d2f4ac9cad136c16f9
MD5 5f4514d4ac7a80831bcc2d6fac1c7ef3
BLAKE2b-256 c227f482efb8edac46b8aff832da28550d9fa232dbdb91797a261e19b49fa93a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page