Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import *
- def count_coords(st, f):
- global dots, answ
- for x in range(int(st[0]), int(f[0]) + 1, k):
- for y in range(int(st[1]), int(f[1]) + 1, k):
- if (x, y) in dots:
- answ += 1
- else:
- dots.add((x, y))
- screensize(1000, 1000)
- tracer(0)
- k = 35
- #shearfactor(0.5)
- dots = set([])
- answ = 0
- for i in range(4):
- for i in range(4):
- s = (xcor(), ycor())
- forward(k * 6)
- f = (xcor(), ycor())
- count_coords(s, f)
- right(90)
- s = (xcor(), ycor())
- forward(k * 10)
- f = (xcor(), ycor())
- count_coords(s, f)
- right(90)
- s = (xcor(), ycor())
- forward(k * 3)
- f = (xcor(), ycor())
- count_coords(s, f)
- up()
- for x in range(-100, 100):
- for y in range(-100, 100):
- goto(x * k, y * k)
- dot(4, 'blue')
- print(answ)
- done()
Advertisement
Add Comment
Please, Sign In to add comment