Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 56d2e5c

Browse files
Merge pull request avinashkranjan#1092 from anumshka/LineSketch
LineSketch
2 parents 5f499cd + 901d0ab commit 56d2e5c

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

‎LineSketch/LineSketch.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import turtle as t
2+
3+
tim = t.Turtle()
4+
scr = t.Screen()
5+
6+
7+
def move_forward():
8+
tim.forward(10)
9+
10+
11+
def move_backward():
12+
tim.backward(10)
13+
14+
15+
def clockwise():
16+
tim.setheading(tim.heading() - 10)
17+
18+
19+
def anticlockwise():
20+
tim.setheading(tim.heading() + 10)
21+
22+
23+
def clear():
24+
tim.clear()
25+
tim.penup()
26+
tim.home()
27+
tim.pendown()
28+
29+
30+
scr.listen()
31+
scr.onkey(key="f", fun=move_forward)
32+
scr.onkey(key="d", fun=move_backward)
33+
scr.onkeypress(key="c", fun=clockwise)
34+
scr.onkeypress(key="a", fun=anticlockwise)
35+
scr.onkey(key="x", fun=clear)
36+
scr.exitonclick()

‎LineSketch/readme.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Package/Script Name
2+
3+
The script name is LineSketch.py
4+
5+
## Setup instructions
6+
7+
python file.py
8+
9+
## Detailed explanation of script, if needed
10+
11+
Who doesn't love scribbling? So, If you are bored and want to draw something really funny and random,You can play this.
12+
Just follow some instructions for directions, and you can end up with a new art.
13+
14+
## Output
15+
16+
![img](sketch.png)
17+
18+
19+
## Author(s)
20+
21+
[Anushka Pathak](https://github.com/anumshka)
22+

‎LineSketch/sketch.png

28.3 KB
Loading[フレーム]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /