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()
相关推荐
查理零世6 分钟前
【蓝桥杯集训·每日一题2025】 AcWing 6134. 哞叫时间II python
python·算法·蓝桥杯
紫雾凌寒15 分钟前
解锁机器学习核心算法|神经网络:AI 领域的 “超级引擎”
人工智能·python·神经网络·算法·机器学习·卷积神经网络
sun lover28 分钟前
conda简单命令
python·conda
服务端相声演员36 分钟前
Oracle JDK、Open JDK zulu下载地址
java·开发语言
Mike_188702783511 小时前
1688代采下单API接口使用指南:实现商品采集与自动化下单
前端·python·自动化
19岁开始学习1 小时前
Go学习-入门
开发语言·学习·golang
青铜念诗1 小时前
python脚本文件设置进程优先级(在.py文件中实现)
开发语言·python
一念春风1 小时前
C# 背景 透明 抗锯齿 (效果完美)
开发语言·c#
Igallta_8136222 小时前
【小游戏】C++控制台版本俄罗斯轮盘赌
c语言·开发语言·c++·windows·游戏·游戏程序
Dyan_csdn2 小时前
【Python项目】文本相似度计算系统
开发语言·python