ICode国际青少年编程竞赛- Python-3级训练场-条件练习

ICode国际青少年编程竞赛- Python-3级训练场-条件练习

1、

python 复制代码
for i in range(5):
    Spaceship.step(2)
    Spaceship.turnLeft()
    Spaceship.step(2)
    Spaceship.turnRight()
    if i != 0:
        Dev.step(-2)
        Dev.step(2)

2、

python 复制代码
for i in range(6):
    Dev.step(i+1)
    Dev.turnLeft()
    if i != 0 and i != 1:
        Dev.step(-1)
        Dev.step()

3、

python 复制代码
for i in range(4):
    Dev.step(3)
    if i != 3:
        Dev.turnLeft()
        Dev.step(3)
        Dev.step(-3)
        Dev.turnRight()
        Dev.step(-3)
        Dev.turnRight()

4、

python 复制代码
for i in range(5):
    Dev.step(2)
    Dev.turnLeft()
    Dev.step(2)
    if i != 1:
        Dev.step(2)
        Dev.turnLeft()
        Dev.step()
        Dev.step(-1)
        Dev.turnRight()
        Dev.step(-2)
    Dev.turnRight()

5、

python 复制代码
for i in range(4):
    Spaceship.step(i+1)
    Spaceship.turnLeft()
    Spaceship.step(i+1)
    Spaceship.turnRight()
    Dev.step(2)
    if i != 1:
        Dev.turnLeft()
        Dev.step()
        Dev.step(-1)
        Dev.turnRight()
    Dev.step(-2)

6、

python 复制代码
for i in range(5):
    Spaceship.step()
    if i == 0 or i == 1 or i == 2:
        Dev.step(5)
        Dev.step(-5)
    Spaceship.step(2)
    Spaceship.turnLeft()
    Spaceship.step(3)
    Spaceship.turnRight()

7、

python 复制代码
for i in range(5):
    if Flyer[2*i].x != 6:
        Flyer[2*i].step(6 -Flyer[2*i].x)
Dev.turnRight()
for i in range(2):
    Dev.step(5+i*2)
    Dev.turnLeft()
Dev.step(5)

8、

python 复制代码
for i in range(7):
    Spaceship.step(i+2)
    Dev.step()
    if i > 3:
        Dev.step(i-3)
        Dev.step(3-i)
    Dev.step(-1)
    Dev.turnRight()
    Spaceship.turnRight()
Spaceship.step(7)

9、

python 复制代码
for i in range(5):
    Dev.turnRight()
    Dev.step(3)
    Dev.turnLeft()
    Dev.step(2)
    if i != 0 and i != 1:
        Dev.step(i)
        Dev.step(-i)

10、

python 复制代码
for i in range(7):
    Spaceship.step(1+2*i)
    if i < 4:
        Dev.step(-1)
        Dev.step(1)
        Dev.turnLeft()
    Spaceship.turnLeft()

11、

python 复制代码
for i in range(6):
    Dev.step(2)
    Dev.step(-2)
    Dev.turnRight()
    Spaceship.step(1+2*i)
    Spaceship.turnRight()
Dev.step(2)

12、

python 复制代码
for i in range(5):
    Dev.step(3)
    Dev.turnLeft()
    Dev.step(2)
    Dev.turnRight()
    if i != 4:
        Dev.step(-4)
        Dev.step(4)

13、

python 复制代码
for i in range(5):
    Dev.turnRight()
    Dev.step(2)
    Dev.turnLeft()
    Dev.step(-2)
    
    if i != 4:
        Dev.step(-3)
        Dev.turnRight()
        Dev.step(-1)
        Dev.step()
        Dev.turnLeft()
        Dev.step(3)

14、

python 复制代码
for i in range(6):
    Dev.step()
    Dev.turnLeft()
    Dev.step(-2)
    if i != 5:
        Dev.step(2)
        Dev.turnRight()
        Dev.step(1+2*i)
        Dev.turnLeft()

15、

python 复制代码
for i in range(4):
    Dev.step(i+1)
    Dev.turnLeft()
    Dev.step(i+1)
    if i != 3:
        Dev.step(3)
        Dev.step(-3)
        Dev.turnRight()

16、

python 复制代码
for i in range(4):
    Dev.step(2)
    Dev.step(-2)
    Dev.turnRight()
    Dev.step(2)
    Dev.step(-2)
    
    Spaceship.turnRight()
    Spaceship.step(3)
    
    if i != 3: 
        Spaceship.turnLeft()
        Spaceship.step(3)
        Dev.turnLeft()

17、

python 复制代码
for i in range(5):
    Spaceship.turnLeft()
    Spaceship.step(i+1)
    Spaceship.turnRight()
    Spaceship.step(2)
    if i != 4:
        Dev.step(3)
        Dev.turnRight()
        Dev.step()
        Dev.step(-1)
        Dev.turnLeft()
        Dev.step(-3)

18、

python 复制代码
for i in range(5):
    Spaceship.turnRight()
    Spaceship.step(3)
    Spaceship.turnLeft()
    Spaceship.step(3)
    if i != 4:
        Dev.step(3)
        Dev.turnLeft()
        Dev.step()
        Dev.step(-1)
        Dev.turnRight()
        Dev.step(-3)

19、

python 复制代码
for i in range(4):
    Spaceship.turnLeft()
    Spaceship.step(i+1)
    Spaceship.turnRight()
    Spaceship.step(i+1)
    if i != 3:
        Dev.step(-4)
        Dev.step()
        Dev.turnLeft()
        Dev.step()
        Dev.step(-1)
        Dev.turnRight()
        Dev.step(3)

20、

python 复制代码
for i in range(6):
    Spaceship.step(7 - i)
    if i < 5:
        Dev.step()
        Dev.turnRight()
        Dev.step(2)
        Dev.step(-2)
        Dev.turnLeft()
        Dev.step(-1)
        Dev.turnRight()
    Spaceship.turnRight()
    Spaceship.step()
    Spaceship.turnLeft()
    Spaceship.step(7 - i)
    Spaceship.turnRight()
相关推荐
Swift社区1 小时前
Swift 解法详解:如何在二叉树中寻找最长连续序列
开发语言·ios·swift
yutian06061 小时前
C# 支持 ToolTip 功能的控件,鼠标悬停弹提示框
开发语言·microsoft·c#
蹦蹦跳跳真可爱5891 小时前
Python----神经网络发(神经网络发展历程)
人工智能·python·深度学习·神经网络·计算机视觉
byte轻骑兵1 小时前
【C++特殊工具与技术】优化内存分配(四):定位new表达式、类特定的new、delete表达式
开发语言·c++
chao_7891 小时前
标注工具核心代码解析——class AnnotationVie【canvas.py]
开发语言·python·qt5
YuTaoShao2 小时前
Java八股文——JVM「内存模型篇」
java·开发语言·jvm
开开心心就好2 小时前
电脑扩展屏幕工具
java·开发语言·前端·电脑·php·excel·batch
Se_ren_di_pity2 小时前
C++ STL容器汇总
开发语言·c++
struggle20253 小时前
tvm开源程序是适用于 CPU、GPU 和专用加速器的开放式深度学习编译器堆栈
人工智能·python·深度学习
放逐者-保持本心,方可放逐3 小时前
webgl(three.js 与 cesium 等实例应用)之浏览器渲染应用及内存释放的关联与应用
开发语言·javascript·webgl·顶点着色器·three.js 释放·cesium 释放·片元着色器