Skip to content

Commit 75273a9

Browse files
committed
many
1 parent 6a83667 commit 75273a9

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

zella-graphics/draw-lines/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
![#1](images/screenshot.png?raw=true)
17.9 KB
Loading

zella-graphics/draw-lines/main.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env python3
2+
3+
from graphics import *
4+
5+
STEP = 10
6+
7+
win = GraphWin('Example', 300, 300)
8+
9+
for x1 in range(0, 301, STEP):
10+
x2 = x1 + STEP
11+
Line(Point(x1, 0), Point(300, x2)).draw(win)
12+
Line(Point(300-x1, 0), Point(0, x2)).draw(win)
13+
Line(Point(0, x2), Point(x1, 300)).draw(win)
14+
Line(Point(300, x2), Point(300-x1, 300)).draw(win)
15+
16+
win.getMouse()
17+
win.close()

0 commit comments

Comments
 (0)