Example #1
0
def draw():
  "Draw maze."
  color('black')
  width(5)

  for x in range(-200,200,40):
    for y in range(-200,200,40):
      if random() > 0.5:
        line(x,y, x + 40 ,y + 40)
      else:
        line(x,y+40, x+40 , y)
Example #2
0
def drawmaze():
    color('red')
    width(5)

    for i in range(-200, 200, 40):
        for j in range(-200, 200, 40):
            if random() > 0.5:
                line(i, j, i + 40, j + 40)
            else:
                line(i, j + 40, i + 40, j)
    update()
Example #3
0
def draw():
    t.color('black')
    t.width(5)

    for x in range(-200, 200, 40):
        for y in range(-200, 200, 40):
            if random() > 0.5:
                line(x, y, x + 40, y + 40)
            else:
                line(x, y + 40, x + 40, y)

    t.update()
Example #4
0
def draw():
    "Make Maze"
    color('black')
    width(5)

    for a in range(-200, 200, 40):
        for b in range(-200, 200, 40):
            if random() > 0.5:
                line(a, b, a + 40, b + 40)
            else:
                line(a, b + 40, a + 40, b)
    update()
Example #5
0
def draw():

    color("green")
    width(5)

    for x in range(-200, 200, 40):
        for y in range(-200, 200, 40):
            if random() > 0.5:
                line(x, y, x + 40, y + 40)
            else:
                line(x, y + 40, x + 40, y)
    update()
def grid():
    bgcolor("light blue")

    for x in range(-150,200,50):
        line(x, -200,x,200)

    for x in range(-175,200,50):
        for y in range(-175,200,50):
            up()
            goto(x,y)
            dot(40, "white")

    update()
Example #7
0
def grid():
    bgcolor('blue')

    for x in range(-150, 200, 50):
        line(x, -200, x, 200)

    for x in range(-175, 200, 50):
        for y in range(-175, 200, 50):
            up()
            goto(x, y)
            dot(40, 'black')

    update()
Example #8
0
def grid():
    "Draw Connect Four grid."
    bgcolor('light blue')

    for x in range(-150, 200, 50):
        line(x, -200, x, 200)

    for x in range(-175, 200, 50):
        for y in range(-175, 200, 50):
            up()
            goto(x, y)
            dot(40, 'white')

    update()
Example #9
0
def grid():
    "Draw Connect Four grid."  # 배경이 되는 판 그리기 함수
    bgcolor('light blue')  # 배경색 설정

    for x in range(-150, 200, 50):  # 분할을 위한 세로선 그리기
        line(x, -200, x, 200)

    for x in range(-175, 200, 50):  # 원 주변 배경
        for y in range(-175, 200, 50):
            up()
            goto(x, y)
            dot(40, 'white')  # 원 그리기 (크기, 색깔)

    update()
Example #10
0
def grid():
    "Draw Connect Four grid."
    bgcolor('light blue')  #可以让我们将整个绘制屏幕调成任意颜色

    for x in range(-150, 200, 50):  #循环(-150,200),每隔50
        line(x, -200, x, 200)  #绘制一个线段

    for x in range(-175, 200, 50):  #进行一个嵌套循环
        for y in range(-175, 200, 50):
            up()  #抬起画笔,之后,移动画笔不绘制形状
            goto(x, y)  #让它到达坐标系的指定位置
            dot(40, 'white')  #绘制直径为四十,背景为白色的圆

    update()  #不懂什么意思
Example #11
0
def grid():
    "Draw Connect Four grid."
    bgcolor('light blue')  #颜色设置为浅蓝色

    for x in range(-150, 200, 50):  #(-150:从左竖计数3列, 200:从左竖第3列开始后4列, 50:竖间隔距离
        line(x, -200, x, 200)  #(循环x,下橫4列,循环x,上橫4列)

    for x in range(-175, 200, 50):
        for y in range(-175, 200, 50):
            up()
            goto(x, y)
            dot(40, 'white')

    update()
Example #12
0
def draw():  #After starting the project firstly this function will be called
    "Draw maze."
    color('black')
    width(5)

    for x in range(-200, 200, 40):
        for y in range(-200, 200, 40):
            if random() > 0.5:  #drawing the maze randomly
                line(
                    x, y, x + 40, y + 40
                )  #line function will draw the line from (x,y) to (x+40,y+40)
            else:
                line(x, y + 40, x + 40, y)

    update()  #for making updates into the screen
Example #13
0
def draw():  # maze를 그리는 함수
    "Draw maze."  # 너비는 5로 하고 색깔은 검은색으로 해준다
    color('black')
    width(5)

    for x in range(-200, 200, 40):  # 각각 x와 y를 (-200, 200) 사이의 40간격으로 for문을 돌리고
        for y in range(
                -200, 200, 40
        ):  # random 함수를 통해 나온 값이 0.5보다 크면 (x, y)에서 (x + 40, y + 40)까지 직선을 그리고
            if random(
            ) > 0.5:  # 값이 0.5보다 작거나 같으면 (x, y + 40)에서 (x + 40, y)까지 직선을 그려준다
                line(x, y, x + 40, y + 40)
            else:
                line(x, y + 40, x + 40, y)

    update()  # 화면을 갱신해준다
Example #14
0
def grid():
    "Draw tic-tac-toe grid."
    line(-67, 200, -67, -200)
    line(67, 200, 67, -200)
    line(-200, -67, 200, -67)
    line(-200, 67, 200, 67)
def drawx(x, y):
    "Draw X player."
    pensize(10)
    line(x, y, x + 133, y + 133)
    line(x, y + 133, x + 133, y)
Example #16
0
def drawx(x, y):
    "Draw X player."
    line(x, y, x + 133, y + 133)
    line(x, y + 133, x + 133, y)
Example #17
0
def drawx(x, y):
    line(x, y, x + 133, y + 133)
    line(x - 0.5, y - 0.5, x + 132.5, y + 132.5)
    line(x + 0.5, y + 0.5, x + 133.5, y + 133.5)
    line(x, y + 133, x + 133, y)
    line(x - 0.5, y + 132.5, x + 132.5, y - 0.5)
    line(x + 0.5, y + 133.5, x + 133.5, y + 0.5)
Example #18
0
def grid():
    "Draw tic-tac-toe grid."
    line(-67, 200, -67, -200)
    line(67, 200, 67, -200)
    line(-200, -67, 200, -67)
    line(-200, 67, 200, 67)
Example #19
0
def drawx(x, y):
    "Draw X player."
    line(x, y, x + 133, y + 133)
    line(x, y + 133, x + 133, y)
Example #20
0
def grid():
    line(-67, 200, -67, -200)
    line(67, 200, 67, -200)
    line(-200, -67, 200, -67)
    line(-200, 67, 200, 67)
Example #21
0
def drawx(x,y):
    line(x, y, x+133, y+133)
    line(x, y+133, x+133, y)