美文网首页
啊哈编程星球-第1章-学习版

啊哈编程星球-第1章-学习版

作者: Mz_L | 来源:发表于2018-06-15 22:09 被阅读654次

第1关: 3行

move()
move()
move()

第2关: 7行

move()
move()
move()
turn("left")
move()
move()
move()

第3关: 7行

move()
move()
move()
turn("right")
move()
move()
move()

第4关: 5行

move()
turn("left")
move(2)
turn("left")
move(3)

第5关: 11行

move(2)
turn("right")
move(2)
turn("right")
move(2)
turn("left")
move(2)
turn("left")
move(2)
turn("right")
move(2)

第6关: 4行

move(5)
turn("left")
toggle()
move(2)

第7关: 12行

move(3)
turn("right")
move(2)
turn("right")
move(2)
turn("left")
move(3)
turn("left")
move(3)
turn("left")
move(2)
toggle()

第8关: 3行

for i in range(3):
    move(3)
    turn("right")

第9关: 9行 ?

for i in range(2):
    turn("right")
    move(2)
    turn("right")
    move(2)
    turn("left")
    move(2)
    turn("left")
    move(2)

第10关: 11行 ?

for i in range(3):
    toggle()
    turn("left")
    move()
    turn("right")
    move()
    turn("left")
    move()
    turn("right")
    move()
    turn("right")

第11关: 7行

move(2)
turn("right")
move()
turn("right")
toggle()
turn("left")
move(2)

第12关: 9行

for i in range(4):
    turn("left")
    turn("left")
    move(2)
    turn("left")
    move(2)
    turn("left")
    move(2)
    toggle()

相关文章

网友评论

      本文标题:啊哈编程星球-第1章-学习版

      本文链接:https://www.haomeiwen.com/subject/xdhveftx.html