Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
use xlings build/manager (#40)
Browse files Browse the repository at this point in the history
* use xlings build/manager

* update

* update

* update readme

* update readme

* rm tools and courses
  • Loading branch information
Sunrisepeak authored Sep 15, 2024
1 parent 273c844 commit eb8284e
Show file tree
Hide file tree
Showing 76 changed files with 102 additions and 569 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.xmake
build
.vscode
.vscode
.xlings
6 changes: 1 addition & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[submodule "dstruct"]
path = dstruct
path = dslings/dstruct
url = https://github.com/Sunrisepeak/DStruct

[submodule "courses"]
path = courses
url = [email protected]:Sunrisepeak/d2ds-courses.git
33 changes: 13 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Dive into Data Structures - 强调**动手实践**的**数据结构**学习项
| ------------------------------------------------------------ |
| [d2ds-book](https://sunrisepeak.github.io/d2ds) - [d2ds-courses](https://sunrisepeak.github.io/d2ds-courses) - [d2ds-dslings](dslings) - [dstruct](https://github.com/Sunrisepeak/dstruct) |

**项目已经使用xlings重构 - 文档待更新**

---

## 目标
Expand All @@ -30,38 +32,29 @@ Dive into Data Structures - 强调**动手实践**的**数据结构**学习项

## d2ds-dslings | 练习

通过使用dslings自动化检测的**编译器驱动开发模式**来进行代码练习

[环境配置&使用指南](book/src/dslings.md)

```bash
git clone --recursive [email protected]:Sunrisepeak/d2ds.git
```
通过使用[xlings](https://github.com/d2learn/xlings)下载项目并运行自动化检测的**编译器驱动开发模式**来进行代码练习

### 配置环境
> 注: [xlings安装文档](https://github.com/d2learn/xlings)
**linux/macos**

> 使用bash执行tools目录下的安装脚本
### 获取练习代码

```bash
bash tools/install.unix.sh
xlings drepo d2ds
```

**windows**
### 执行dslings进入练习

> 执行tools目录下的安装脚本 或 直接双击运行
> 进入d2ds目录, 执行dslings开始练习
```bash
tools\install.win.bat
cd d2ds
xlings dslings
```

### 执行dslings进入练习

> 更多详情见[dslings使用指南](book/src/dslings.md)
### 打开电子书

```bash
xmake dslings
xlings book
```

## 社区 | 交流
Expand All @@ -86,4 +79,4 @@ xmake dslings

- **参与社区交流:** 反馈问题、参与社区问题讨论
- **参与项目开发:** 通过[开发看板](https://github.com/users/Sunrisepeak/projects/10), 参与社区中问题处理、修复Bug、开发&优化新功能/模块
- **参与知识库的建设:** 对d2ds中的一些内容做技术解读, 丰富知识库, 以至于帮助到更多同学
- **参与[知识库](https://github.com/Sunrisepeak/d2ds/issues/32)的建设:** 对d2ds中的一些内容做技术解读, 丰富知识库, 以至于帮助到更多同学
12 changes: 6 additions & 6 deletions book/src/Instroduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- dslings自动检测
- 错误提示
- 代码通过提示
- D2DS_WAIT - dslings等待标志
- XLINGS_WAIT - dslings等待标志
- 总结

---
Expand Down Expand Up @@ -83,7 +83,7 @@ int main() {

d2ds_assert_eq(mVal.get(), maxVal);

D2DS_WAIT
XLINGS_WAIT

return 0;
}
Expand All @@ -106,7 +106,7 @@ Output:
[D2DS LOGI]: - ✅ | mVal.get() == 2 (2 == 2)
[D2DS LOGI]: - ✅ | mVal.get() == 100 (100 == 100)
[D2DS LOGI]: - ✅ | mVal.get() == maxVal (191 == 191)
[D2DS LOGW]: main: tests/dslings.2.cpp:46 - Delete the D2DS_WAIT to continue...
[D2DS LOGW]: main: tests/dslings.2.cpp:46 - Delete the XLINGS_WAIT to continue...

====================

Expand Down Expand Up @@ -328,15 +328,15 @@ Book: https://sunrisepeak.github.io/d2ds
```

**D2DS_WAIT - dslings等待标志**
**XLINGS_WAIT - dslings等待标志**

当完整完成一个小节的练习的时候, dslings检测程序会进入等待状态, 并且打印出类似如下的提示消息

```bash
[D2DS LOGW]: main: tests/dslings.2.cpp:46 - Delete the D2DS_WAIT to continue...
[D2DS LOGW]: main: tests/dslings.2.cpp:46 - Delete the XLINGS_WAIT to continue...
```

按照消息中给出的文件地址, 选择注释掉(或删除)程序中的`D2DS_WAIT`标志, dslings就会进入下一个练习并开启自动检测
按照消息中给出的文件地址, 选择注释掉(或删除)程序中的`XLINGS_WAIT`标志, dslings就会进入下一个练习并开启自动检测

## 总结

Expand Down
6 changes: 3 additions & 3 deletions book/src/chapter_06_embedded_dlist.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ int main() {

d2ds_assert(head.next == &head);

D2DS_WAIT
XLINGS_WAIT

return 0;
}
Expand Down Expand Up @@ -270,7 +270,7 @@ int main() {
d2ds_assert(head.next == &head);
D2DS_WAIT
XLINGS_WAIT
return 0;
}
Expand Down Expand Up @@ -363,7 +363,7 @@ int main() {

d2ds_assert(head.next() == &head);

D2DS_WAIT
XLINGS_WAIT

return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions book/src/dslings.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ int main() {

HONLY_LOGI_P("Hello D2DS!");

D2DS_WAIT
XLINGS_WAIT

return 0;
}
Expand All @@ -134,14 +134,14 @@ Output:
====================
[D2DS LOGI]: - ✅ | mVal.get() == 2 (2 == 2)
[D2DS LOGI]: - Hello D2DS!
[D2DS LOGW]: main: tests/dslings.0.cpp:26 - 🥳 Delete the D2DS_WAIT to continue...
[D2DS LOGW]: main: tests/dslings.0.cpp:26 - 🥳 Delete the XLINGS_WAIT to continue...

====================

Homepage: https://github.com/Sunrisepeak/d2ds-courses
```
### 第四步: 注释D2DS_WAIT, 进入下一个练习
### 第四步: 注释XLINGS_WAIT, 进入下一个练习
根据dslings在控制台的提示信息, 找到`tests/dslings.0.cpp:26`, 并进行注释或者删除。
dslings就会进入下一个练习并进行检测
Expand All @@ -155,7 +155,7 @@ int main() {

HONLY_LOGI_P("Hello D2DS!");

D2DS_WAIT
XLINGS_WAIT

return 0;
}
Expand Down
6 changes: 3 additions & 3 deletions book/src/other/1_cpp_base.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Output:
[D2DS LOGI]: - ✅ | d2ds::max(a, b) == dstruct::max(a, b) (1 == 1)
[D2DS LOGI]: - ✅ | d2ds::max(a, b) == dstruct::max(a, b) (4294967295 == 4294967295)
[D2DS LOGI]: - ✅ | d2ds::max(a, b) == dstruct::max(a, b) (3.100000 == 3.100000)
[D2DS LOGW]: main: tests/other/cpp-base/template.0.cpp:35 - Delete the D2DS_WAIT to continue...
[D2DS LOGW]: main: tests/other/cpp-base/template.0.cpp:35 - Delete the XLINGS_WAIT to continue...

====================

Expand Down Expand Up @@ -191,7 +191,7 @@ int main() {
d2ds_assert(box.get_value() == dstruct::String("Hello, d2ds!"));
}

D2DS_WAIT
XLINGS_WAIT

return 0;
}
Expand All @@ -212,7 +212,7 @@ Output:
====================
[D2DS LOGI]: - ✅ | box.get_value() == 2 (2 == 2)
[D2DS LOGI]: - ✅ | box.get_value() == dstruct::String("Hello, d2ds!")
[D2DS LOGW]: main: tests/other/cpp-base/template.2.cpp:33 - Delete the D2DS_WAIT to continue...
[D2DS LOGW]: main: tests/other/cpp-base/template.2.cpp:33 - Delete the XLINGS_WAIT to continue...

====================

Expand Down
4 changes: 2 additions & 2 deletions book/src/other/2_cpp_base.rangefor.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ int main() {
}
}

D2DS_WAIT
XLINGS_WAIT

return 0;
}
Expand Down Expand Up @@ -244,7 +244,7 @@ Output:
[D2DS LOGI]: -| val == index (35 == 35)
[D2DS LOGI]: -| val == index (40 == 40)
[D2DS LOGI]: -| val == index (45 == 45)
[D2DS LOGW]: main: tests/other/cpp-base/range_for.3.cpp:35 - Delete the D2DS_WAIT to continue...
[D2DS LOGW]: main: tests/other/cpp-base/range_for.3.cpp:35 - Delete the XLINGS_WAIT to continue...

====================

Expand Down
48 changes: 0 additions & 48 deletions common/d2ds.lua

This file was deleted.

Loading

0 comments on commit eb8284e

Please sign in to comment.