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()
相关推荐
Chasing__Dreams5 分钟前
python--杂识--18.1--pandas数据插入sqlite并进行查询
python·sqlite·pandas
彭泽布衣1 小时前
python2.7/lib-dynload/_ssl.so: undefined symbol: sk_pop_free
python·sk_pop_free
喜欢吃豆1 小时前
从零构建MCP服务器:FastMCP实战指南
运维·服务器·人工智能·python·大模型·mcp
一个处女座的测试2 小时前
Python语言+pytest框架+allure报告+log日志+yaml文件+mysql断言实现接口自动化框架
python·mysql·pytest
nananaij2 小时前
【Python基础入门 re模块实现正则表达式操作】
开发语言·python·正则表达式
蛋仔聊测试2 小时前
Playwright 网络流量监控与修改指南
python
nightunderblackcat3 小时前
进阶向:Python音频录制与分析系统详解,从原理到实践
开发语言·python·音视频
慕婉03073 小时前
Tensor自动微分
人工智能·pytorch·python
MUTA️3 小时前
pycharm中本地Docker添加解释器
ide·python·pycharm
想要成为计算机高手4 小时前
4. isaac sim4.2 教程-Core API-Hello robot
人工智能·python·机器人·英伟达·isaac sim·仿真环境