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

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

1、

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

2、

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

3、

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

4、

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

5、

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

6、

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

7、

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

8、

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

9、

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

10、

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

11、

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

12、

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

13、

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

    Dev.step(-5)
    Dev.step(5)
    
    Spaceship.turnRight()
    Spaceship.step(4)
    Dev.step(1)
    Dev.step(-1)

14、

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

15、

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

16、

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

17、

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

18、

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

19、

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

20、

python 复制代码
for i in range(4):
    Dev.step(6)
    Dev.turnLeft()
    Dev.step(3)
    Dev.step(-5)
    Dev.step(2)
    Dev.turnRight()
    Dev.step(-6)
    Dev.turnLeft()
相关推荐
你可以自己看1 小时前
python的基础语法
开发语言·python
akhfuiigabv3 小时前
使用Neo4j-Cypher-FT实现自然语言查询图数据库
数据库·python·oracle·neo4j
繁依Fanyi3 小时前
828华为云征文|华为Flexus云服务器搭建OnlyOffice私有化在线办公套件
服务器·开发语言·前端·python·算法·华为·华为云
zhangfeng11333 小时前
在 PyTorch 中,除了 pad_sequence 还有哪些其他处理序列数据的函数?时间序列数据 预处理
人工智能·pytorch·python·深度学习
python1563 小时前
Python Numpy布尔数组在数据分析中的应用
python·数据分析·numpy
AIAdvocate4 小时前
力扣-96.不同的二叉搜索树 题目详解
python·算法·动态规划
luthane4 小时前
python 实现entropy熵算法
python·算法·概率论
akhfuiigabv4 小时前
探索Timescale Vector与Postgres数据库的融合:AI应用的新选择
数据库·人工智能·python
hakesashou4 小时前
ruby和python哪个好学
开发语言·python·ruby
NiNg_1_2344 小时前
Python协程详解
开发语言·python