first commit
This commit is contained in:
parent
fecde56d09
commit
61325b9af3
13
README.md
13
README.md
@ -1,3 +1,14 @@
|
||||
# IcodeDocs
|
||||
|
||||
Document for ICode.org
|
||||
ICode.org Python 文档
|
||||
|
||||
```bash
|
||||
git clone https://git.loliquq.cn/earthjasonlin/IcodeDocs.git
|
||||
cd IcodeDocs
|
||||
npm install
|
||||
|
||||
# 开发服务器
|
||||
npm run dev
|
||||
# 构建
|
||||
npm run build
|
||||
```
|
||||
|
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)
|
||||
```
|
18350
package-lock.json
generated
Normal file
18350
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
24
package.json
Normal file
24
package.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "icodedocs",
|
||||
"version": "1.0.0",
|
||||
"description": "Document for ICode.org",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"dev": "set NODE_OPTIONS=--openssl-legacy-provider & vuepress dev docs",
|
||||
"build": "set NODE_OPTIONS=--openssl-legacy-provider & vuepress build docs"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.loliquq.cn/earthjasonlin/IcodeDocs.git"
|
||||
},
|
||||
"keywords": [
|
||||
"vuepress",
|
||||
"python",
|
||||
"icode"
|
||||
],
|
||||
"author": "earthjasonlin@163.com",
|
||||
"license": "CC-BY-NC-SA-4.0",
|
||||
"devDependencies": {
|
||||
"vuepress": "^1.9.10"
|
||||
}
|
||||
}
|
45
template.md
Normal file
45
template.md
Normal file
@ -0,0 +1,45 @@
|
||||
# MyClass
|
||||
|
||||
说明:这是一个示例类的类文档。
|
||||
|
||||
## 属性
|
||||
|
||||
### `attribute1 -> int`
|
||||
|
||||
这是第一个属性的说明。
|
||||
|
||||
### `attribute2 -> int`
|
||||
|
||||
这是第二个属性的说明。
|
||||
|
||||
## 方法
|
||||
|
||||
### `method1(arg1, arg2) -> void`
|
||||
|
||||
这是方法 1 的说明
|
||||
|
||||
- `arg1`: 参数 1 的说明。
|
||||
- `arg2`: 参数 2 的说明。
|
||||
- 返回值:这个方法的返回值说明。
|
||||
|
||||
### `method2(arg1) -> int`
|
||||
|
||||
这是方法 2 的说明
|
||||
|
||||
- `arg1`: 参数 1 的说明。
|
||||
- 返回值:这个方法的返回值说明。
|
||||
|
||||
## 示例用法
|
||||
|
||||
```python
|
||||
# 创建一个对象
|
||||
my_obj = MyClass()
|
||||
|
||||
# 调用方法1
|
||||
result = my_obj.method1(arg1, arg2)
|
||||
print(result)
|
||||
|
||||
# 调用方法2
|
||||
result = my_obj.method2(arg1)
|
||||
print(result)
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user