first commit
This commit is contained in:
62
docs/.vuepress/config.js
Normal file
62
docs/.vuepress/config.js
Normal file
@ -0,0 +1,62 @@
|
||||
module.exports = {
|
||||
title: "ICode Python 文档",
|
||||
description: "ICode.org Python 文档",
|
||||
head: [
|
||||
[
|
||||
"script",
|
||||
{},
|
||||
`
|
||||
var _paq = window._paq = window._paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//matomo.loliquq.cn/";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '17']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
`,
|
||||
],
|
||||
],
|
||||
locales: {
|
||||
"/": {
|
||||
lang: "zh-CN",
|
||||
title: "ICode Python 文档",
|
||||
description: "ICode.org Python 文档",
|
||||
},
|
||||
},
|
||||
themeConfig: {
|
||||
// 导航栏链接
|
||||
nav: [
|
||||
{
|
||||
text: "意见反馈",
|
||||
link: "https://git.loliquq.cn/earthjasonlin/IcodeDocs/issues/new",
|
||||
},
|
||||
],
|
||||
|
||||
// 侧边栏
|
||||
sidebarDepth: 10,
|
||||
sidebar: [
|
||||
["/Dev", "Dev 机器人"],
|
||||
["/Spaceship", "Spaceship 飞船"],
|
||||
["/ABOUT", "关于"],
|
||||
],
|
||||
|
||||
// Git 仓库和编辑链接
|
||||
repo: "https://git.loliquq.cn/earthjasonlin/IcodeDocs.git",
|
||||
repoLabel: "查看源码",
|
||||
editLinks: false,
|
||||
editLinkText: "帮助我们改善此页面!",
|
||||
|
||||
// 页面滚动效果
|
||||
smoothScroll: true,
|
||||
|
||||
// 最后更新时间
|
||||
lastUpdated: "最后更新",
|
||||
},
|
||||
markdown: {
|
||||
lineNumbers: true,
|
||||
},
|
||||
};
|
3
docs/ABOUT.md
Normal file
3
docs/ABOUT.md
Normal file
@ -0,0 +1,3 @@
|
||||
## 特别鸣谢
|
||||
|
||||
- [广州市铁一中学](http://www.gtyz.edu.cn/index.html)提供价值高昂的账号
|
47
docs/Dev.md
Normal file
47
docs/Dev.md
Normal file
@ -0,0 +1,47 @@
|
||||
# Dev 机器人
|
||||
|
||||
说明:机器人(即角色)相关属性与方法
|
||||
|
||||
## 属性
|
||||
|
||||
### `x -> int`
|
||||
|
||||
**只读**,机器人的`x`坐标
|
||||
|
||||
### `y -> int`
|
||||
|
||||
**只读**,机器人的`y`坐标
|
||||
|
||||
## 方法
|
||||
|
||||
### `step(n) -> void`
|
||||
|
||||
机器人前进或后退指定步数,**本操作算作`n`步**
|
||||
|
||||
- `n`: 整数,正为前进,负为后退
|
||||
|
||||
### `turnLeft() -> void`
|
||||
|
||||
机器人原地左转,**本操作算作`1`步**
|
||||
|
||||
### `turnRight() -> void`
|
||||
|
||||
机器人原地右转,**本操作算作`1`步**
|
||||
|
||||
## 示例用法
|
||||
|
||||
```python
|
||||
# 获取机器人当前的x坐标
|
||||
x = Dev.x
|
||||
# 获取机器人当前的y坐标
|
||||
y = Dev.y
|
||||
|
||||
# 机器人原地右转
|
||||
Dev.turnRight()
|
||||
# 机器人前进2步
|
||||
Dev.step(2)
|
||||
# 机器人原地左转
|
||||
Dev.turnLeft()
|
||||
# 机器人后退3步
|
||||
Dev.step(-3)
|
||||
```
|
13
docs/README.md
Normal file
13
docs/README.md
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
home: true
|
||||
actionText: 快速开始 →
|
||||
actionLink: /Dev
|
||||
---
|
||||
|
||||
:::slot footer
|
||||
All contents [CC-BY-NC-SA-4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) licensed | Copyright © 2023 [earthjasonlin](https://earthjasonlin.cn)
|
||||
:::
|
||||
|
||||
对于一些已经有`python`语言基础的同学来说,完成题目只需要花心思在设计路径上就可以了。这篇文档可以帮助你快速搞清楚各个部件的运动规则与它所含的属性、方法等,方便快速入门。
|
||||
|
||||
如果你在文档中发现了任何问题,请点击右上角的[意见反馈](https://git.loliquq.cn/earthjasonlin/IcodeDocs/issues/new)帮助我们完善。
|
47
docs/Spaceship.md
Normal file
47
docs/Spaceship.md
Normal file
@ -0,0 +1,47 @@
|
||||
# Spaceship 飞船
|
||||
|
||||
说明:飞船用以承载[机器人](Dev)一起移动
|
||||
|
||||
## 属性
|
||||
|
||||
### `x -> int`
|
||||
|
||||
**只读**,飞船的`x`坐标
|
||||
|
||||
### `y -> int`
|
||||
|
||||
**只读**,飞船的`y`坐标
|
||||
|
||||
## 方法
|
||||
|
||||
### `step(n) -> void`
|
||||
|
||||
飞船前进或后退指定步数,**本操作算作`n`步**
|
||||
|
||||
- `n`: 正整数,前进的步数
|
||||
|
||||
### `turnLeft() -> void`
|
||||
|
||||
飞船原地左转,机器人朝向不变,**本操作算作`1`步**
|
||||
|
||||
### `turnRight() -> void`
|
||||
|
||||
飞船原地右转,机器人朝向不变,**本操作算作`1`步**
|
||||
|
||||
## 示例用法
|
||||
|
||||
```python
|
||||
# 获取飞船当前的x坐标
|
||||
x = Spaceship.x
|
||||
# 获取飞船当前的y坐标
|
||||
y = Spaceship.y
|
||||
|
||||
# 飞船原地右转
|
||||
Spaceship.turnRight()
|
||||
# 飞船前进2步
|
||||
Spaceship.step(2)
|
||||
# 飞船原地左转
|
||||
Spaceship.turnLeft()
|
||||
# 飞船前进3步
|
||||
Spaceship.step(3)
|
||||
```
|
Reference in New Issue
Block a user