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

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

1、

在这里插入图片描述

a = 16
for i in range(6):
    Dev.step(1)
    Dev.turnLeft()
    Dev.step(a)
    Dev.step(-a)
    Dev.turnRight()
    while Dev.energy < 100:
        wait()
    Dev.step(1)
    a = a - 5 + i

2、

在这里插入图片描述

for i in range(5):
    Dev.step(11 - i * 2)
    Dev.turnRight()
    while Dev.energy < 100:
        wait()

3、
在这里插入图片描述

for i in range(4):
    Dev.step(3 + i)
    while Dev.energy < 100:
        wait()
    Dev.step(-1)
    Dev.turnLeft()
    Dev.step(2 + i)
    Dev.turnRight()

4、

在这里插入图片描述

for i in range(5):
    Dev.step(1)
    Dev.turnRight()
    Dev.step(Item[i].x - 10)
    if i < 4:
        Dev.step(10 - Item[i].x)
        Dev.turnLeft()
        Dev.step(2)
        Flyer.step(3)
        Dev.turnLeft()
        Dev.step(1)
        while Dev.energy < 100:
            wait()
        Dev.step(-1)
        Dev.turnRight()

5、

在这里插入图片描述

for i in range(4):
    Dev.step(3)
    Dev.turnRight()
    Dev.step(1)
    while Dev.energy < 100:
        wait()
    Dev.step(1)
    Dev.turnRight()
    Dev.step(3)
    Dev.turnLeft()

6、
在这里插入图片描述

for i in range(4):
    Dev.step(4)
    Dev.turnRight()
    Dev.step(2)
    Dev.turnLeft()
    Dev.step(1)
    while Dev.energy < 100:
        wait()
    Dev.step(1)
    Dev.turnLeft()
    Dev.step(2)
    Dev.turnRight()
    Dev.step(4)
    Dev.turnRight()

7、

在这里插入图片描述

for i in range(4):
    Dev.step(8)
    Dev.turnLeft()
    Dev.step(2)
    while Dev.energy < 100:
        wait()
    for j in range(2):
        Dev.turnLeft()
        Dev.step(2)

8、
在这里插入图片描述

for i in range(4):
    Dev.step(4)
    while Flyer[i].disappear():
        wait()
    Dev.step(2)
    Dev.turnLeft()
    Dev.step(i + 1)
    Dev.step(-2 - 2 * i)
    Dev.step(i + 1)
    Dev.turnLeft()
    while Flyer[i].disappear():
        wait()
    Dev.step(6)
    Dev.turnLeft()

9、

在这里插入图片描述

for i in range(3):
    Spaceship.step(2 ** i)
    while not Flyer[i * 2].disappear():
        wait()
    Spaceship.step(2)
    Spaceship.turnRight()
    Spaceship.step(2 * i + 1)
    while not Flyer[2 * i + 1].disappear():
        wait()
    Spaceship.step(2)
    Spaceship.turnLeft()

10、
在这里插入图片描述

for i in range(4):
    while not Flyer[i].disappear():
        wait()
    Spaceship.step(i + 2)
    Spaceship.turnLeft()
    Spaceship.step(i + 2)
    Spaceship.turnRight()

11、

在这里插入图片描述

for i in range(5):
    Spaceship.step(2)
    Spaceship.turnLeft()
    Spaceship.step(5 - i)
    while not Flyer[i].disappear():
        wait()
    Spaceship.step(2)
    Spaceship.turnLeft()
    Spaceship.turnLeft()
    while not Flyer[i].disappear():
        wait()
    Spaceship.step(7 - i)
    Spaceship.turnLeft()
    Spaceship.step(1)

12、

在这里插入图片描述

for i in range(4):
    Dev.step(2 * i + 1)
    Dev.turnRight()
    while Flyer[i].disappear():
        wait()
    Dev.step(3)
    Dev.turnLeft()

13、
在这里插入图片描述

for i in range(4):
    Spaceship.step(1)
    while not Flyer[2 * i].disappear():
        wait()
    Spaceship.step(2)
    Dev.turnLeft()
    Dev.step(3)
    Dev.step(-6)
    Dev.step(3)
    while not Flyer[2 * i + 1].disappear():
        wait()
    Spaceship.step(4)
    Spaceship.turnRight()

14、
在这里插入图片描述

Dev.step(1)
for i in range(4):
    Dev.step(2 * i)
    Dev.turnLeft()
    while Flyer[i].disappear():
        wait()
    Dev.step(2)
    Dev.turnRight()

15、

在这里插入图片描述

for i in range(3):
    Dev.step(Flyer[i].x - Dev.x)
    Dev.turnLeft()
    while Flyer[i].disappear():
        wait()
    Dev.step(7)
    Dev.step(i - 3)
    Dev.turnLeft()
    Dev.step(3 - i)
    Dev.step(2 * i - 6)
    Dev.step(3 - i)
    Dev.turnLeft()
    Dev.step(2 + i)
    while Flyer[i].disappear():
        wait()
    Dev.step(2)
    Dev.turnLeft()

16、

在这里插入图片描述

for i in range(3):
    Dev.step(9 - 2 * i)
    while Flyer[i * 2].disappear():
        wait()
    Dev.step(2)
    Dev.turnRight()
    Dev.step(10 - 4 * i)
    if i < 2:
        Dev.turnRight()
        while Flyer[i* 2 + 1].disappear():
            wait()
        Dev.step(11 - 2 * i)
        Dev.turnRight()
        Dev.step(8 - 4 * i)
        Dev.turnRight()

17、

在这里插入图片描述

for i in range(4):
    for j in range(2):
        while Flyer[2 * i + j].disappear():
            wait()
        Dev.step(3 + 2 * i)
        Dev.turnRight()

18、

在这里插入图片描述

for i in range(3):
    while Flyer[6 - 2 * i].disappear():
        wait()
    Dev.step(Dev.y - Flyer[5 - 2 * i].y)
    Dev.turnRight()
    while Flyer[5 - 2 * i].disappear():
        wait()
    Dev.step(Flyer[6 - 2 * i].y - Flyer[5 - 2 * i].y + 1)
    Dev.turnLeft()

19、
在这里插入图片描述

for i in range(4):
    while Flyer[i].disappear():
        wait()
    Dev.step(4 + i)
    Dev.turnRight()
    while Flyer[i + 4].disappear():
        wait()
    Dev.step(3 + i)
    Dev.step(-i - 1)
    while Flyer[i + 4].disappear():
        wait()
    Dev.step(-2)
    Dev.turnRight()
    Dev.step(2 + i)
    while Flyer[i].disappear():
        wait()
    Dev.step(2)
    Dev.turnLeft()

20、
在这里插入图片描述

for i in range(4):
    Dev.step(1)
    for j in range(2):
        Dev.turnRight()
        Dev.step(4 - i)
        Dev.turnLeft()
        Dev.step(4 - i)
    while Dev.energy < 100:
        wait()
    Dev.turnLeft()

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/624835.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

PBR系列-光之简史

作者&#xff1a;游梦 ​ 欢迎进入官网体验使用&#xff1a;Mapmost——让人与机器联合创作成为新常态 ​说到PBR理论分为三大理论&#xff1a;物理光源、物理材质与物理相机&#xff0c;三者都与光有着千丝万缕的关系&#xff0c;原打算这期讲解物理材质&#xff0c;在梳理知…

刚刚OpenAI发布ChatGPT-4o模型,免费使用GPT4o并免费提供更多功能

就在今日凌晨1点&#xff0c;OpenAI举行了春季发布会&#xff0c;发布了GPT-4o 并免费提供更多功能。 亲测GPT-4o已经可以免费试用&#xff0c;每个人都可以使用它并从中受益&#xff0c;GPT4终于不再是少部分人的玩物。 点击加入ChatGPT4交流群&#xff1a;https://www.aijour…

记一次跨域问题

线上跨域问题&#xff0c;在自己配置确认没问题下&#xff0c;要及时找运维看看是不是nginx配置问题。 两个方面&#xff1a; 项目代码 nginx配置 SpringBoot 解决跨域问题的 5 种方案&#xff01; SpringBoot解决CORS跨域问题 SpringBoot-实现CORS跨域原理及解决方案

unordered_map、unordered_set底层封装

文章目录 一、先实现哈希桶1.1哈希桶的实现方法1.2日常普遍的哈希桶存放的数据有两种&#xff1a;字符串和整形1.3哈希桶的实现代码详解1.3.1哈希桶的两种仿函数&#xff08;int和string&#xff09;1.3.2哈希桶的节点&#xff08;如果桶非常深&#xff0c;这里考虑挂红黑树&am…

MQTT学习(二)

订阅主题和订阅确认 SUBSCRIBE——订阅主题 之前的CONNECT报文&#xff0c;分为 固定报头&#xff1a;必须存在&#xff0c;用于描述报文信息。里面有指出什么类型的报文&#xff0c;报文的等级。可变报头&#xff1a;不一定存在。主要看什么样子类型的报文。有效载荷部分&a…

Go PDF文件操作

目录 介绍 安装 gofpdf API 代码示例 结果展示 介绍 gofpdf 是一个在 Go 语言中用于生成 PDF 文档的库。 安装 gofpdf 首先&#xff0c;你需要安装 gofpdf 库。你可以使用 go get 命令来安装它&#xff1a; go get github.com/jung-kurt/gofpdf API 功能 函数名参数解释示…

25. K 个一组翻转链表 - 力扣(LeetCode)

基础知识要求&#xff1a; Java&#xff1a;方法、while循环、for循环、if else语句 Python&#xff1a; 方法、while循环、for循环、if else语句 题目&#xff1a; 给你链表的头节点 head &#xff0c;每 k 个节点一组进行翻转&#xff0c;请你返回修改后的链表。 k 是一个…

【目标检测】YOLOv5|YOLOv8模型QT界面可视化部署

YOLO-Deploy-QT_Interface 最近笔者做了YOLO系列算法的部署工作,现做一个总结。主要工作是做了用于部署YOLOv5和YOLOv8的可视化QT界面,可实现图片、文件夹、视频、摄像头的ONNX与OpenVino部署,具体效果如下: 代码链接:https://github.com/Zency-Sun/YOLO-Deploy-QT_Inte…

深入学习Linux内核之v4l2应用编程(二)

一&#xff0c;用户空间访问v4l2设备步骤 V4L2&#xff08;Video for Linux 2&#xff09;是Linux中关于视频设备的内核驱动&#xff0c;它使得Linux系统能够支持视频设备&#xff0c;如摄像头。对于Camera V4L2的应用编程&#xff0c;一般遵循以下步骤&#xff1a; 1&#x…

【正则表达式】1、元字符的认识与分类

1、元字符的概念 正则表达式的常见功能&#xff0c;分别是校验数据的有效性、查找符合要求的文本以及对文本进行切割和替换等操作。 我想你一定在办公软件&#xff0c;比如 Word、Excel 中用过这个功能。你可以使用查找功能快速定位关注的内容&#xff0c;然后使用替换&#xf…

leetcode-最长公共子序列(二)-103

题目要求 思路 step 1&#xff1a;优先检查特殊情况。 step 2&#xff1a;获取最长公共子序列的长度可以使用动态规划&#xff0c;我们以dp[i][j]dp[i][j]dp[i][j]表示在s1中以iii结尾&#xff0c;s2中以jjj结尾的字符串的最长公共子序列长度。 step 3&#xff1a;遍历两个字…

视频号小店从开店到爆单,最详细的攻略教学,来了!

大家好&#xff0c;我是喷火龙 视频号小店从推出到现在一直备受关注&#xff0c;我的团队已经入局视频号小店一年多了&#xff0c; 可以说&#xff0c;新手做视频号小店采用无货源模式和达人带货的玩法依旧是最合适的。 虽然说这个模式和玩法很多人之前都接触过&#xff0c;…

精准追踪,高效分析——Xinstall应用数据分析平台

在当前的移动互联网时代&#xff0c;App应用的数量与日俱增&#xff0c;如何从这些应用中脱颖而出&#xff0c;成为开发者和广告主们亟待解决的问题。而在这个问题中&#xff0c;数据无疑是一把关键的钥匙。今天&#xff0c;我们要介绍的就是国内专业的App全渠道统计服务商——…

普中STM32F103ZET6开发板让DS0和DS1两个LED同时亮

欢迎关注我👆,收藏下次不迷路┗|`O′|┛ 嗷~~ 目录 一.前言 二.代码 三.运行效果 一.前言 在这套stm32教程中,只教学了如何亮DS0,而没有教学如何亮DS1。 二.代码 main.c #include "stm32f10x.h"void Syst

Linux下Redis下载及安装教程(实测有效)

一、配置gcc 由于Redis是基于c语言编写的需要安装依赖,需要安装gcc&#xff0c;在Linux系统里需要存在C语言的编译环境&#xff0c;一般的Linux系统安装的时候会自动安装&#xff0c;由于我是最小安装模式&#xff0c;所以我需要自己再另外安装一下。 判断系统是否安装gcc&…

2024年Java程序员的职业发展路径

程序员的职业路径是非常清晰的&#xff0c;但是现实情况下&#xff0c;很多人卡在了高级开发就再也上不去&#xff0c;直到遇到职业发展的危机&#xff0c;比如&#xff1a; 35岁大龄程序员找工作难&#xff0c;国内很多大型互联网公司在招聘要求上&#xff0c;会限制35岁这个年…

PuLID: 图像背景、光线、风格等均保持高度一致图像生成工具,附本地一键包

PuLID是一种无需调优的ID定制方法。PuLID保持了高的ID保真度&#xff0c;同时有效地减少了对原始模型行为的干扰。 只需要提供一张照片&#xff0c;就可以生成高还原度的各种风格的图像。 使用方法&#xff1a;解压一键包&#xff0c;双击一键启动 点击ID图像&#xff08;主…

李国武:确保FMEA实现预期质量目标的方法有哪些?

在现代制造业中&#xff0c;FMEA&#xff08;失效模式与影响分析&#xff09;已经成为一项至关重要的质量管理工具。它通过对产品或过程进行系统的分析&#xff0c;识别潜在的失效模式&#xff0c;评估其影响&#xff0c;并制定相应的预防措施&#xff0c;从而确保产品或过程的…

Nginx 代理 MySQL 实现通过域名连接数据库

文章目录 Nginx 模块介绍Stream 模块配置远程连接 MySQLDataGrip 连接 MySQL Nginx 安装这里不做介绍。域名默认已经解析到服务器公网IP。 Nginx 模块介绍 HTTP 模块&#xff1a; HTTP模块提供了处理HTTP请求的功能&#xff0c;包括反向代理、负载均衡、缓存、HTTP代理等。 例…