ICode国际青少年编程竞赛- Python-2级训练场-识别循环规律2

ICode国际青少年编程竞赛- Python-2级训练场-识别循环规律2

1、

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

2、

python 复制代码
for i in range(3):
    Spaceship.step(3)
    Spaceship.turnRight()
    Spaceship.step(1)

3、

python 复制代码
Dev.turnLeft()
Dev.step(Dev.x - Item[1].x)
for i in range(2):
    Dev.turnRight()
    Dev.step(4)
    Dev.turnLeft()
    Dev.step(-4)

4、

python 复制代码
for i in range(3):
    Dev.turnRight()
    Dev.step(3)
    Dev.turnLeft()
    Dev.step(3)

5、

python 复制代码
for i in range(3):
    Dev.turnLeft()
    Dev.step(2)
    Dev.turnRight()
    Dev.step(2)

6、

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

7、

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

8、

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

9、

python 复制代码
for i in range(4):
    Dev.step(-1)
    Dev.step(5)
    Dev.step(-1)
    Dev.turnRight()

10、

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

11、

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

12、

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

13、

python 复制代码
for i in range(3):
    Dev.turnLeft()
    Dev.step(1)
    Dev.turnRight()
    Dev.step(3)
for i in range(3):
    Dev.turnLeft()
    Dev.step(5)

14、

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

15、

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

16、

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

17、

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

18、

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

19、

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

20、

python 复制代码
for i in range(4):
    Spaceship.step(3)
    Spaceship.turnRight()
    Spaceship.step(4)
    Spaceship.turnLeft()
    Spaceship.step(2)
    Spaceship.turnRight()
相关推荐
Gyoku Mint30 分钟前
深度学习×第4卷:Pytorch实战——她第一次用张量去拟合你的轨迹
人工智能·pytorch·python·深度学习·神经网络·算法·聚类
郭庆汝6 小时前
pytorch、torchvision与python版本对应关系
人工智能·pytorch·python
思则变9 小时前
[Pytest] [Part 2]增加 log功能
开发语言·python·pytest
漫谈网络10 小时前
WebSocket 在前后端的完整使用流程
javascript·python·websocket
try2find11 小时前
安装llama-cpp-python踩坑记
开发语言·python·llama
博观而约取12 小时前
Django ORM 1. 创建模型(Model)
数据库·python·django
明月看潮生12 小时前
青少年编程与数学 02-022 专业应用软件简介 07 国产工业软件
青少年编程·工业软件·编程与数学·应用软件·国产软件
精灵vector14 小时前
构建专家级SQL Agent交互
python·aigc·ai编程
Zonda要好好学习14 小时前
Python入门Day2
开发语言·python
Vertira14 小时前
pdf 合并 python实现(已解决)
前端·python·pdf