ICode国际青少年编程竞赛- Python-1级训练场-综合训练1

ICode国际青少年编程竞赛- Python-1级训练场-综合训练1

1、

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

2、

python 复制代码
Spaceship.step()
Spaceship.turnLeft()
Spaceship.step(3)
Dev.step(2)
Dev.turnRight()
Dev.step(2)
Dev.step(-4)

3、

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

4、

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

5、

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

6、

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

7、

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

8、

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

9、

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

10、

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

11、

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

12、

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

13、

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

14、

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

15、

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

16、

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

17、

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

18、

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

19、

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

20、

python 复制代码
for i in range(5):
    Spaceship.step(2)
    Spaceship.turnLeft()
    Spaceship.step(5 - i)
    Spaceship.turnLeft()
    Spaceship.turnLeft()
    Spaceship.step(7)
    Spaceship.turnLeft()
    Spaceship.turnLeft()
    Spaceship.step(2 + i)
    Spaceship.turnRight()
相关推荐
数据智能老司机2 小时前
精通 Python 设计模式——创建型设计模式
python·设计模式·架构
数据智能老司机4 小时前
精通 Python 设计模式——SOLID 原则
python·设计模式·架构
c8i5 小时前
django中的FBV 和 CBV
python·django
c8i5 小时前
python中的闭包和装饰器
python
这里有鱼汤8 小时前
小白必看:QMT里的miniQMT入门教程
后端·python
TF男孩18 小时前
ARQ:一款低成本的消息队列,实现每秒万级吞吐
后端·python·消息队列
该用户已不存在1 天前
Mojo vs Python vs Rust: 2025年搞AI,该学哪个?
后端·python·rust
站大爷IP1 天前
Java调用Python的5种实用方案:从简单到进阶的全场景解析
python
用户8356290780511 天前
从手动编辑到代码生成:Python 助你高效创建 Word 文档
后端·python
c8i1 天前
python中类的基本结构、特殊属性于MRO理解
python