@masonjargon/

chinese checkers

Python (with Turtle)

No description

fork
loading
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from turtle import *





shape('turtle')
speed(0)
size = 20

pendown()
circle(10)

def draw_hex(radius):
  r = size * radius - 0.5*size + radius * size
  print (r)
  if radius == 0:
    forward(r)
    right(90)
    circle(size)
    left(90)
    return

  for i in range(6*radius):      
      forward(r)
      right(90)
      pendown()
      begin_fill()
      circle(size)
      end_fill()
      #penup()
      for j in range(radius - 1):
        right(60)
        forward(1.5 * size)
        pendown()
        #begin_fill()
        circle(size)
        #end_fill()
        #penup()
      left(90)
      backward(r)
      left(60)


draw_hex(0)
draw_hex(1)
draw_hex(2)


forward(100)
result
console