Last active
August 29, 2015 14:01
-
-
Save lipemat/63eebd59c43da1c697a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import turtle; | |
t = turtle.Turtle(); | |
w = turtle.Screen(); | |
def right(): | |
t.right(45); | |
def left(): | |
t.left(45); | |
def up(): | |
t.forward( 2 ); | |
def down(): | |
t.back( 2 ); | |
w.onkey( right, "Right" ); | |
w.onkey( left, "Left" ); | |
w.onkey( up, "Up" ); | |
w.onkey( down, "Down" ); | |
w.listen(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is like the most basic arbitrary example of turtle screen events. It is used strictly for teaching a beginner programmer some python basics.
Not to be used as a reference for my coding ability. I mean seriously guys. I would have to drink about 10 shots to numb my brain to the level of actually doing something useful with python.