mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 11:30:12 +08:00
quest get-started
This commit is contained in:
1 parent
c6e49a10be
commit
c42c558614
16 files changed
+274
-273
No files matched your search
+6
-12
@@ -23,8 +23,7 @@ stages:
|
|||||||
output:
|
output:
|
||||||
- ^start$
|
- ^start$
|
||||||
responses:
|
responses:
|
||||||
- type: narrative
|
- content:
|
||||||
content:
|
|
||||||
- 你剛才使用的指令叫做 `echo`。
|
- 你剛才使用的指令叫做 `echo`。
|
||||||
- '`echo` 指令可以將後方接續的文字輸出到終端機上。'
|
- '`echo` 指令可以將後方接續的文字輸出到終端機上。'
|
||||||
- 例如你輸入 `echo Hello`,終端機就會顯示 `Hello`。
|
- 例如你輸入 `echo Hello`,終端機就會顯示 `Hello`。
|
||||||
@@ -42,8 +41,7 @@ stages:
|
|||||||
command:
|
command:
|
||||||
- ^echo .*
|
- ^echo .*
|
||||||
responses:
|
responses:
|
||||||
- type: narrative
|
- content:
|
||||||
content:
|
|
||||||
- 你應該可以看到終端機上顯示了你在 `echo` 指令後面的文字。
|
- 你應該可以看到終端機上顯示了你在 `echo` 指令後面的文字。
|
||||||
- 接下來,請你試著在終端機上顯示 `How are you?`。
|
- 接下來,請你試著在終端機上顯示 `How are you?`。
|
||||||
hints:
|
hints:
|
||||||
@@ -58,8 +56,7 @@ stages:
|
|||||||
output:
|
output:
|
||||||
- ^[Hh]ow are you\??$
|
- ^[Hh]ow are you\??$
|
||||||
responses:
|
responses:
|
||||||
- type: narrative
|
- content:
|
||||||
content:
|
|
||||||
- 你成功的在終端機上顯示了 `How are you?`。
|
- 你成功的在終端機上顯示了 `How are you?`。
|
||||||
- 相信你已經了解 `echo` 指令的用法了。
|
- 相信你已經了解 `echo` 指令的用法了。
|
||||||
- 接下來,要像你介紹 `echo` 在遊戲中的特殊功能,那就是詠唱咒語。
|
- 接下來,要像你介紹 `echo` 在遊戲中的特殊功能,那就是詠唱咒語。
|
||||||
@@ -91,8 +88,7 @@ stages:
|
|||||||
output:
|
output:
|
||||||
- ^HELP$
|
- ^HELP$
|
||||||
responses:
|
responses:
|
||||||
- type: narrative
|
- content:
|
||||||
content:
|
|
||||||
- 你詠唱了 `HELP` 咒語,一位精靈出現了。
|
- 你詠唱了 `HELP` 咒語,一位精靈出現了。
|
||||||
- type: dialogue
|
- type: dialogue
|
||||||
speaker: Unix 精靈
|
speaker: Unix 精靈
|
||||||
@@ -114,15 +110,13 @@ stages:
|
|||||||
output:
|
output:
|
||||||
- ^WATER$
|
- ^WATER$
|
||||||
responses:
|
responses:
|
||||||
- type: narrative
|
- content:
|
||||||
content:
|
|
||||||
- 你施展了水魔法,一個水球出現在你的手中。
|
- 你施展了水魔法,一個水球出現在你的手中。
|
||||||
- type: dialogue
|
- type: dialogue
|
||||||
speaker: Unix 精靈
|
speaker: Unix 精靈
|
||||||
content:
|
content:
|
||||||
- 很好,你已經學會了水魔法。
|
- 很好,你已經學會了水魔法。
|
||||||
- type: narrative
|
- content:
|
||||||
content:
|
|
||||||
- 真厲害,你已經了解如何使用 `echo` 指令,並且學會了詠唱咒語的方法。
|
- 真厲害,你已經了解如何使用 `echo` 指令,並且學會了詠唱咒語的方法。
|
||||||
- 最後複習一下,你可以通過輸入 `echo [文字]` 來在終端機上顯示文字。
|
- 最後複習一下,你可以通過輸入 `echo [文字]` 來在終端機上顯示文字。
|
||||||
- 你也可以通過輸入 `echo [咒語]` 來詠唱咒語,並產生對應的特殊效果。
|
- 你也可以通過輸入 `echo [咒語]` 來詠唱咒語,並產生對應的特殊效果。
|
||||||
|
|||||||
+7
-17
@@ -42,15 +42,11 @@ stages:
|
|||||||
command:
|
command:
|
||||||
- ^ls$
|
- ^ls$
|
||||||
responses:
|
responses:
|
||||||
- type: dialogue
|
- content:
|
||||||
speaker: Unix 精靈
|
|
||||||
content:
|
|
||||||
- 你應該能看到資料夾中的內容了。
|
- 你應該能看到資料夾中的內容了。
|
||||||
- 在畫面右邊的檔案樹也有了改變。
|
- 在畫面右邊的檔案樹也有了改變。
|
||||||
- 可以看出,在這個資料夾中包含了兩個資料夾,分別是 `folder1` 和 `folder2`。
|
- 可以看出,在這個資料夾中包含了兩個資料夾,分別是 `folder1` 和 `folder2`。
|
||||||
- type: dialogue
|
- content:
|
||||||
speaker: Unix 精靈
|
|
||||||
content:
|
|
||||||
- 接下來,我要教你如何進入資料夾。
|
- 接下來,我要教你如何進入資料夾。
|
||||||
- '`cd` 指令是 change directory 的縮寫,也就是改變路徑的意思。'
|
- '`cd` 指令是 change directory 的縮寫,也就是改變路徑的意思。'
|
||||||
- 你可以通過輸入 `cd [資料夾名稱]` 來進入資料夾。
|
- 你可以通過輸入 `cd [資料夾名稱]` 來進入資料夾。
|
||||||
@@ -81,9 +77,7 @@ stages:
|
|||||||
pwd:
|
pwd:
|
||||||
- /home/commander/folder1
|
- /home/commander/folder1
|
||||||
responses:
|
responses:
|
||||||
- type: dialogue
|
- content:
|
||||||
speaker: Unix 精靈
|
|
||||||
content:
|
|
||||||
- 你成功的進入 `folder1` 資料夾了。
|
- 你成功的進入 `folder1` 資料夾了。
|
||||||
- 你可以發現指令提示符從原本的
|
- 你可以發現指令提示符從原本的
|
||||||
- '`commander:~ $` 變成了'
|
- '`commander:~ $` 變成了'
|
||||||
@@ -117,8 +111,7 @@ stages:
|
|||||||
command:
|
command:
|
||||||
- ls
|
- ls
|
||||||
responses:
|
responses:
|
||||||
- type: narrative
|
- content:
|
||||||
content:
|
|
||||||
- 你現在可以看到 `folder1` 資料夾中有兩的檔案,分別是 `file1.txt` 跟 `file2.txt`。
|
- 你現在可以看到 `folder1` 資料夾中有兩的檔案,分別是 `file1.txt` 跟 `file2.txt`。
|
||||||
- 現在我們可以離開 `folder1` 回到原本的資料夾了。
|
- 現在我們可以離開 `folder1` 回到原本的資料夾了。
|
||||||
- 你可以使用 `cd ..` 回到上一層資料夾。
|
- 你可以使用 `cd ..` 回到上一層資料夾。
|
||||||
@@ -134,8 +127,7 @@ stages:
|
|||||||
pwd:
|
pwd:
|
||||||
- /home/commander
|
- /home/commander
|
||||||
responses:
|
responses:
|
||||||
- type: narrative
|
- content:
|
||||||
content:
|
|
||||||
- 你成功的回到上一層資料夾了。
|
- 你成功的回到上一層資料夾了。
|
||||||
- 現在,請你剛才所學的指令,進入 `folder2` 資料夾,檢查 `folder2` 資料夾的內容,最後回到這個資料夾。
|
- 現在,請你剛才所學的指令,進入 `folder2` 資料夾,檢查 `folder2` 資料夾的內容,最後回到這個資料夾。
|
||||||
hints:
|
hints:
|
||||||
@@ -166,8 +158,7 @@ stages:
|
|||||||
command:
|
command:
|
||||||
- ls
|
- ls
|
||||||
responses:
|
responses:
|
||||||
- type: narrative
|
- content:
|
||||||
content:
|
|
||||||
- 你看到了 `folder2` 資料夾中的檔案,分別是 `file3.txt` 跟 `file4.txt`。
|
- 你看到了 `folder2` 資料夾中的檔案,分別是 `file3.txt` 跟 `file4.txt`。
|
||||||
- 現在你可以離開 `folder2` 回到原本的資料夾了。
|
- 現在你可以離開 `folder2` 回到原本的資料夾了。
|
||||||
hints:
|
hints:
|
||||||
@@ -181,8 +172,7 @@ stages:
|
|||||||
pwd:
|
pwd:
|
||||||
- /home/commander
|
- /home/commander
|
||||||
responses:
|
responses:
|
||||||
- type: narrative
|
- content:
|
||||||
content:
|
|
||||||
- 你成功的回到原本的資料夾了。
|
- 你成功的回到原本的資料夾了。
|
||||||
- 恭喜你學會了 `ls` 和 `cd` 指令的用法。
|
- 恭喜你學會了 `ls` 和 `cd` 指令的用法。
|
||||||
hints:
|
hints:
|
||||||
|
|||||||
+67
-76
@@ -1,92 +1,83 @@
|
|||||||
title: 終端機的基本知識
|
title: 終端機的基本知識
|
||||||
instruction: |
|
instruction: |
|
||||||
歡迎來到 Linux Odyssey!
|
歡迎來到 Linux Odyssey!
|
||||||
|
在這一關你將會學到:
|
||||||
|
1. 如何使用這個網站
|
||||||
|
2. 如何使用終端機
|
||||||
|
|
||||||
|
在畫面的中間可以看到終端機和提示兩個區塊。
|
||||||
|
請你在終端機中的 `commander:~ $` 後面輸入 `echo start` 並按下 Enter 來開始教程。
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- id: help
|
- id: warning-01
|
||||||
task: 輸入 `echo help` 來朗誦咒語
|
repeatable: true
|
||||||
repeatable: false
|
|
||||||
condition:
|
condition:
|
||||||
command:
|
command:
|
||||||
- .*
|
- ' '
|
||||||
responses:
|
|
||||||
- type: narrative
|
|
||||||
content:
|
|
||||||
- 你聽到了一個聲音:
|
|
||||||
- type: dialogue
|
|
||||||
speaker: Unix 精靈
|
|
||||||
content:
|
|
||||||
- 你好,指令官,我是你的 Unix 精靈。我已在此恭候多時。
|
|
||||||
- 這個世界是在 3560000 時脈以前,由初代王建立了 Unix 律法,所形成的世界。然而在經過了好幾世代的王後,終於誕生了永恆之王——薩加(Saga),她比歷代的君王都更為強大,且從來不會衰老,使得這個世界變得前所未有的強大。
|
|
||||||
- 然而,外在世界一直不斷在改變,同時在面臨外敵的不斷攻擊,而薩加卻始終用同一套治理的手段。最終,在 160000 時脈前的一次入侵中,根部遭到攻陷,薩加遭到封印,而這個國家也陷入了黑暗。
|
|
||||||
- 由於長久以來依賴於薩加,世人已失去了「指令」的力量,即將走向衰敗和滅亡的命運。
|
|
||||||
- 你的任務,就是找回被世人遺忘的指令,奪回 Linux 之根,成為 Linux 之王。
|
|
||||||
- 首先,你必須要學會如何使用指令。
|
|
||||||
- 你要學習的第一個指令,是「搜索」的指令:`ls` (list)。 `ls` 可以用來查看一個目錄中有哪些檔案。
|
|
||||||
- 現在,請你輸入 `ls` 來查看目前的目錄下有哪些檔案。
|
|
||||||
hints: |
|
|
||||||
➤ 使用 `ls` 指令來查看目前的目錄下有哪些檔案。
|
|
||||||
|
|
||||||
- id: find-scroll
|
|
||||||
task: 搜索卷軸
|
|
||||||
repeatable: false
|
|
||||||
requirements:
|
|
||||||
- help
|
|
||||||
condition:
|
|
||||||
command:
|
|
||||||
- ls
|
|
||||||
responses:
|
|
||||||
- type: narrative
|
|
||||||
content:
|
|
||||||
- 一瞬間,視野變得清晰起來,你發現自己身處在一個石頭建築的房間裡。
|
|
||||||
- 你發現了一個檔案,檔名是 `forgotten-scroll.txt`。
|
|
||||||
- type: dialogue
|
|
||||||
speaker: Unix 精靈
|
|
||||||
content:
|
|
||||||
- 你找到了一個被遺忘的卷軸,上面寫著解除封印的咒語。
|
|
||||||
- 使用指令 `cat [ 檔案名稱 ]` (concatenate)來查看檔案內容。
|
|
||||||
- 我可以為你提供一些指令的提示,只要輸入指令的前幾個字元,然後按下 `Tab` 鍵,就可以看到提示了。
|
|
||||||
- 例如你只要輸入檔案名稱的前幾個字元,然後按下 `Tab` 鍵,就可以看到提示了。
|
|
||||||
hints:
|
hints:
|
||||||
- 使用 `cat [ 檔案名稱 ]` 指令來查看檔案內容。
|
- '!! 請勿使用全形空格 !!'
|
||||||
- 使用 `Tab` 鍵來取得指令提示。
|
|
||||||
- 如果卡在未知的情況,按下 `Ctrl + C` 嘗試離開。
|
|
||||||
|
|
||||||
- id: read-forgotten-scroll
|
- id: start
|
||||||
task: 查看卷軸
|
task: 輸入 `echo start` 來開始教程
|
||||||
repeatable: false
|
|
||||||
requirements:
|
|
||||||
- find-scroll
|
|
||||||
condition:
|
condition:
|
||||||
pwd:
|
output:
|
||||||
- '^/home/commander$'
|
- ^start$
|
||||||
command:
|
|
||||||
- cat forgotten_scroll.txt
|
|
||||||
responses:
|
responses:
|
||||||
- type: dialogue
|
- content:
|
||||||
speaker: Unix 精靈
|
- 你好,我是你的 Unix 助手,我叫做 Ada。我將會在之後協助你了解如何使用終端機。
|
||||||
content:
|
- 現在所在的這個區塊就是終端機,你可以在這裡輸入指令來操作電腦。
|
||||||
- 你找到的是一個被遺忘的卷軸,上面寫著解除封印的咒語。
|
- 在終端機中,你所看到的
|
||||||
- 使用你已經知道的 `echo [ 咒語 ]` 指令來詠唱咒語。
|
- '`commander:~ $` 是指令提示符號,它能讓你知道現在可以輸入指令了。'
|
||||||
hints: |
|
- 你必須將指令輸入在它的後方。
|
||||||
➤ 輸入 `echo Hello World` 來詠唱咒語。
|
- 當你輸入完指令並按下 Enter 之後,終端機會執行你輸入的指令。
|
||||||
|
- 並且會將執行結果輸出在終端機的下一行。
|
||||||
|
- 這個終端機的功能和你在 Linux 電腦上看到的終端機是一樣的。
|
||||||
|
- 唯一的差別是,在這裡會有劇情和提示來協助你學習如何使用終端機。
|
||||||
|
- 在輸入指令之後,如果你看到用綠色 `=====` 組成的分隔線,代表在分隔線下方的內容是添加的內容,在真實的終端機中不會出現。
|
||||||
|
- 而終端機的輸出,是在綠色 `=====` 分隔線上方的白色內容。
|
||||||
|
- 現在請你輸入 `echo hello` 來看看會發生什麼事。
|
||||||
|
hints:
|
||||||
|
- ➤ 在 `commander:~ $` 後面輸入 `echo hello` 並按下 Enter
|
||||||
|
|
||||||
|
- id: echo-hello
|
||||||
|
task: 在終端機輸入 `echo hello`
|
||||||
|
requirements:
|
||||||
|
- start
|
||||||
|
condition:
|
||||||
|
command:
|
||||||
|
- ^echo hello$
|
||||||
|
responses:
|
||||||
|
- content:
|
||||||
|
- 你應該可以看到終端機上顯示了:
|
||||||
|
- commander:~ $ echo hello
|
||||||
|
- hello
|
||||||
|
- 第一行的 `commander:~ $` 是指令提示符, `echo hello` 是你輸入的指令。
|
||||||
|
- 第二行的 `hello` 則是終端機的輸出。
|
||||||
|
- content:
|
||||||
|
- 現在你知道如何在終端機上輸入指令,以及查看終端機輸出的位置。
|
||||||
|
- 指令必須輸入在指令提示符號的後面,然而當指令提示符消失時,你就無法輸入指令了。
|
||||||
|
- 這時候你可以按下 `Ctrl + C` 來嘗試解決這個問題。
|
||||||
|
- 在終端機中, `Ctrl + C` 並不能用來複製,而是用來中斷目前正在執行的指令。
|
||||||
|
- 因此,如果你前一次的指令執行時卡住了,或是執行很久沒有反應,你可以按下 `Ctrl + C` 來中斷指令,讓你可以繼續輸入指令。
|
||||||
|
- 如果 `Ctrl + C` 也沒有辦法解決問題,可以按按看 `esc` 或 `q` 鍵。如果都沒用的話,按下畫面右下角的 `重來` 按鈕重新開始關卡。
|
||||||
|
- content:
|
||||||
|
- 在終端機下方會顯示提示,你可以用提示右上角的箭頭來查看之前的提示。
|
||||||
|
- 在畫面左邊的區域是關卡說明,你可以在這裡看到關卡的介紹,以及現在需要完成的任務。
|
||||||
|
- 在畫面右邊的區域是檔案樹,它會根據你所探索的資料夾發生變化,讓你更清楚檔案之間的位置關係。
|
||||||
|
- 畫面右上角的圖示分別是 `查看地圖`、`回報錯誤` 以及 `登出` 按鈕。
|
||||||
|
- content:
|
||||||
|
- 第一關的文字內容比較多,可以慢慢讀沒關係。
|
||||||
|
- 如果忘記了也可以隨時回來複習。
|
||||||
|
- 需要的話可以按下 `Enter` 來快速跳過劇情說明。
|
||||||
|
- 如果你已經讀完了上述內容,請輸入 `echo finish` 來結束這一關。
|
||||||
|
hints:
|
||||||
|
- ➤ 按下 `Ctrl + C` 能夠中斷指令
|
||||||
|
- ➤ 劇情進行時可以按下 `Enter` 來快速跳過
|
||||||
|
|
||||||
- id: END
|
- id: END
|
||||||
task: 解除封印
|
task: 結束關卡
|
||||||
repeatable: false
|
|
||||||
requirements:
|
requirements:
|
||||||
- read-forgotten-scroll
|
- echo-hello
|
||||||
condition:
|
condition:
|
||||||
pwd:
|
|
||||||
- '^/home/commander$'
|
|
||||||
command:
|
command:
|
||||||
- echo [Hh]ello\s*[Ww]orld
|
- ^echo finish$
|
||||||
responses:
|
|
||||||
- type: narrative
|
|
||||||
content:
|
|
||||||
- 突然之間,你感覺到一股強大的力量從你的身體中湧出,你的身體開始發光,你的手中出現了一把魔法之劍。
|
|
||||||
- type: dialogue
|
|
||||||
speaker: Unix 精靈
|
|
||||||
content:
|
|
||||||
- 恭喜您,我的指令官,您已成功解除了封印。
|
|
||||||
- 請跟著在接下來的關卡,一步步取回 Linux 之根吧!
|
|
||||||
@@ -4,6 +4,8 @@ quests:
|
|||||||
- cast
|
- cast
|
||||||
- explore
|
- explore
|
||||||
|
|
||||||
|
- path
|
||||||
|
|
||||||
- read
|
- read
|
||||||
|
|
||||||
- create
|
- create
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
FROM linuxodyssey/quest-base
|
||||||
|
|
||||||
|
COPY home ${HOME}
|
||||||
@@ -0,0 +1,185 @@
|
|||||||
|
title: 檔案路徑
|
||||||
|
instruction: |
|
||||||
|
在這個關卡中,你將會學到:
|
||||||
|
1. 絕對路徑和相對路徑
|
||||||
|
2. 如何使用 `pwd` 顯示目前的路徑
|
||||||
|
|
||||||
|
請輸入 `echo start` 來開始這一關。
|
||||||
|
|
||||||
|
requirements:
|
||||||
|
- cast
|
||||||
|
- explore
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- id: warning-01
|
||||||
|
repeatable: true
|
||||||
|
condition:
|
||||||
|
command:
|
||||||
|
- ' '
|
||||||
|
hints:
|
||||||
|
- '!! 請勿使用全形空格 !!'
|
||||||
|
|
||||||
|
- id: start
|
||||||
|
task: 輸入 `echo start` 來開始教程
|
||||||
|
repeatable: false
|
||||||
|
condition:
|
||||||
|
output:
|
||||||
|
- ^start$
|
||||||
|
responses:
|
||||||
|
- content:
|
||||||
|
- 在終端機中,並沒有圖形介面可以讓你查看資料夾的內容。
|
||||||
|
- 但是你可以透過 `ls` 指令來查看資料夾的內容。
|
||||||
|
- '`ls` 指令是 list 的縮寫,也就是列出檔案的意思。'
|
||||||
|
- 在輸入 `ls` 指令後,終端機會輸出資料夾中包含的檔案和資料夾。
|
||||||
|
- 現在,請你試著輸入 `ls` 指令,查看資料夾中有什麼東西。
|
||||||
|
hints:
|
||||||
|
- ➤ 輸入 `ls` 並查看資料夾的內容
|
||||||
|
|
||||||
|
- id: ls
|
||||||
|
task: 查看資料夾中的檔案
|
||||||
|
requirements:
|
||||||
|
- start
|
||||||
|
condition:
|
||||||
|
command:
|
||||||
|
- ^ls$
|
||||||
|
responses:
|
||||||
|
- content:
|
||||||
|
- 你應該能看到資料夾中的內容了。
|
||||||
|
- 在畫面右邊的檔案樹也有了改變。
|
||||||
|
- 可以看出,在這個資料夾中包含了兩個資料夾,分別是 `folder1` 和 `folder2`。
|
||||||
|
- content:
|
||||||
|
- 接下來,我要教你如何進入資料夾。
|
||||||
|
- '`cd` 指令是 change directory 的縮寫,也就是改變路徑的意思。'
|
||||||
|
- 你可以通過輸入 `cd [資料夾名稱]` 來進入資料夾。
|
||||||
|
- 例如你要進入 `folder1` 資料夾,你可以輸入
|
||||||
|
- '`cd folder1`。'
|
||||||
|
- 現在,請你試著進入 `folder1` 資料夾。
|
||||||
|
hints:
|
||||||
|
- ➤ 輸入 `cd folder1` 來進入 `folder1` 資料夾
|
||||||
|
exceptions:
|
||||||
|
- condition:
|
||||||
|
not:
|
||||||
|
pwd:
|
||||||
|
- /home/commander
|
||||||
|
hints:
|
||||||
|
- ➤ 請先回到 `/home/commander/` 資料夾
|
||||||
|
- ➤ 輸入 `cd ~` 來返回 `/home/commander/` 資料夾
|
||||||
|
- condition:
|
||||||
|
command:
|
||||||
|
- ^[Ii]s$
|
||||||
|
hints:
|
||||||
|
- '!! `ls` 的首字母是小寫的 `L`,不是 `I` !!'
|
||||||
|
|
||||||
|
- id: cd-folder1
|
||||||
|
task: 進入 `folder1` 資料夾
|
||||||
|
requirements:
|
||||||
|
- ls
|
||||||
|
condition:
|
||||||
|
pwd:
|
||||||
|
- /home/commander/folder1
|
||||||
|
responses:
|
||||||
|
- content:
|
||||||
|
- 你成功的進入 `folder1` 資料夾了。
|
||||||
|
- 你可以發現指令提示符從原本的
|
||||||
|
- '`commander:~ $` 變成了'
|
||||||
|
- '`commander:~/folder1 $` 。'
|
||||||
|
- 這表示你現在正位在 `folder1` 資料夾中。
|
||||||
|
- 現在,請試著查看 `folder1` 資料夾的內容。
|
||||||
|
hints:
|
||||||
|
- ➤ 輸入 `ls` 查看資料夾的內容
|
||||||
|
exceptions:
|
||||||
|
- condition:
|
||||||
|
pwd:
|
||||||
|
- /home/commander
|
||||||
|
hints:
|
||||||
|
- ➤ 輸入 `cd folder1` 來進入 `folder1` 資料夾
|
||||||
|
- condition:
|
||||||
|
not:
|
||||||
|
pwd:
|
||||||
|
- /home/commander
|
||||||
|
hints:
|
||||||
|
- ➤ 請先回到 `/home/commander/` 資料夾
|
||||||
|
- ➤ 輸入 `cd ~` 來返回 `/home/commander/` 資料夾
|
||||||
|
|
||||||
|
- id: ls-folder1
|
||||||
|
task: 查看 `folder1` 資料夾的內容
|
||||||
|
repeatable: false
|
||||||
|
requirements:
|
||||||
|
- cd-folder1
|
||||||
|
condition:
|
||||||
|
pwd:
|
||||||
|
- /home/commander/folder1
|
||||||
|
command:
|
||||||
|
- ls
|
||||||
|
responses:
|
||||||
|
- type: narrative
|
||||||
|
content:
|
||||||
|
- 你現在可以看到 `folder1` 資料夾中有兩的檔案,分別是 `file1.txt` 跟 `file2.txt`。
|
||||||
|
- 現在我們可以離開 `folder1` 回到原本的資料夾了。
|
||||||
|
- 你可以使用 `cd ..` 回到上一層資料夾。
|
||||||
|
- 這裡的 `..` 代表的是上一層的資料夾。
|
||||||
|
hints:
|
||||||
|
- 輸入 `cd ..` 回到上一層資料夾
|
||||||
|
|
||||||
|
- id: cd-..
|
||||||
|
task: 回到上一層資料夾
|
||||||
|
requirements:
|
||||||
|
- ls-folder1
|
||||||
|
condition:
|
||||||
|
pwd:
|
||||||
|
- /home/commander
|
||||||
|
responses:
|
||||||
|
- type: narrative
|
||||||
|
content:
|
||||||
|
- 你成功的回到上一層資料夾了。
|
||||||
|
- 現在,請你剛才所學的指令,進入 `folder2` 資料夾,檢查 `folder2` 資料夾的內容,最後回到這個資料夾。
|
||||||
|
hints:
|
||||||
|
- ➤ 使用 `cd` 指令進出資料夾
|
||||||
|
- ➤ 使用 `ls` 指令查看資料夾的內容
|
||||||
|
|
||||||
|
- id: cd-folder2
|
||||||
|
task: 進入 `folder2` 資料夾
|
||||||
|
requirements:
|
||||||
|
- cd-..
|
||||||
|
condition:
|
||||||
|
pwd:
|
||||||
|
- /home/commander/folder2
|
||||||
|
responses:
|
||||||
|
- content:
|
||||||
|
- 你成功的進入 `folder2` 資料夾了。
|
||||||
|
- 現在,請你查看 `folder2` 資料夾的內容。
|
||||||
|
hints:
|
||||||
|
- ➤ 使用 `ls` 查看資料夾的內容
|
||||||
|
|
||||||
|
- id: ls-folder2
|
||||||
|
task: 查看 `folder2` 資料夾的內容
|
||||||
|
requirements:
|
||||||
|
- cd-folder2
|
||||||
|
condition:
|
||||||
|
pwd:
|
||||||
|
- /home/commander/folder2
|
||||||
|
command:
|
||||||
|
- ls
|
||||||
|
responses:
|
||||||
|
- type: narrative
|
||||||
|
content:
|
||||||
|
- 你看到了 `folder2` 資料夾中的檔案,分別是 `file3.txt` 跟 `file4.txt`。
|
||||||
|
- 現在你可以離開 `folder2` 回到原本的資料夾了。
|
||||||
|
hints:
|
||||||
|
- ➤ 使用 `cd ..` 回到上一層資料夾
|
||||||
|
|
||||||
|
- id: END
|
||||||
|
task: 回到原本的資料夾
|
||||||
|
requirements:
|
||||||
|
- ls-folder2
|
||||||
|
condition:
|
||||||
|
pwd:
|
||||||
|
- /home/commander
|
||||||
|
responses:
|
||||||
|
- type: narrative
|
||||||
|
content:
|
||||||
|
- 你成功的回到原本的資料夾了。
|
||||||
|
- 恭喜你學會了 `ls` 和 `cd` 指令的用法。
|
||||||
|
hints:
|
||||||
|
- ➤ 使用 `cd` 指令進出資料夾
|
||||||
|
- ➤ 使用 `ls` 指令查看資料夾的內容
|
||||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -6,8 +6,7 @@ instruction: |
|
|||||||
請輸入 `echo start` 來開始這一關。
|
請輸入 `echo start` 來開始這一關。
|
||||||
|
|
||||||
requirements:
|
requirements:
|
||||||
- cast
|
- path
|
||||||
- explore
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- id: warning-01
|
- id: warning-01
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
This is file.txt
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
This is file1.txt
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
This is file.txt
|
||||||
@@ -1,164 +0,0 @@
|
|||||||
book
|
|
||||||
study
|
|
||||||
purple
|
|
||||||
mouth
|
|
||||||
plant
|
|
||||||
windy
|
|
||||||
bread
|
|
||||||
tree
|
|
||||||
summer
|
|
||||||
grandma
|
|
||||||
chair
|
|
||||||
cloudy
|
|
||||||
mom
|
|
||||||
cake
|
|
||||||
jump
|
|
||||||
rabbit
|
|
||||||
orange
|
|
||||||
white
|
|
||||||
hands
|
|
||||||
eyes
|
|
||||||
dog
|
|
||||||
draw
|
|
||||||
fish
|
|
||||||
eight
|
|
||||||
winter
|
|
||||||
bird
|
|
||||||
desk
|
|
||||||
seven
|
|
||||||
sing
|
|
||||||
brother
|
|
||||||
banana
|
|
||||||
pencil
|
|
||||||
five
|
|
||||||
fall
|
|
||||||
run
|
|
||||||
milk
|
|
||||||
nose
|
|
||||||
teacher
|
|
||||||
drink
|
|
||||||
grass
|
|
||||||
sunny
|
|
||||||
rice
|
|
||||||
lion
|
|
||||||
eraser
|
|
||||||
three
|
|
||||||
purple
|
|
||||||
student
|
|
||||||
dad
|
|
||||||
elephant
|
|
||||||
mouth
|
|
||||||
four
|
|
||||||
spring
|
|
||||||
feet
|
|
||||||
cake
|
|
||||||
grandma
|
|
||||||
play
|
|
||||||
six
|
|
||||||
apple
|
|
||||||
head
|
|
||||||
sister
|
|
||||||
black
|
|
||||||
hands
|
|
||||||
juice
|
|
||||||
pen
|
|
||||||
nine
|
|
||||||
pizza
|
|
||||||
autumn
|
|
||||||
cat
|
|
||||||
legs
|
|
||||||
flower
|
|
||||||
drink
|
|
||||||
eyes
|
|
||||||
cloudy
|
|
||||||
orange
|
|
||||||
winter
|
|
||||||
mom
|
|
||||||
bread
|
|
||||||
sunny
|
|
||||||
study
|
|
||||||
lion
|
|
||||||
four
|
|
||||||
desk
|
|
||||||
summer
|
|
||||||
chair
|
|
||||||
windy
|
|
||||||
drink
|
|
||||||
tree
|
|
||||||
bread
|
|
||||||
grandma
|
|
||||||
study
|
|
||||||
nose
|
|
||||||
book
|
|
||||||
orange
|
|
||||||
legs
|
|
||||||
sister
|
|
||||||
grass
|
|
||||||
rainy
|
|
||||||
eyes
|
|
||||||
white
|
|
||||||
rabbit
|
|
||||||
play
|
|
||||||
black
|
|
||||||
dad
|
|
||||||
jump
|
|
||||||
mom
|
|
||||||
fish
|
|
||||||
sunny
|
|
||||||
winter
|
|
||||||
pen
|
|
||||||
flower
|
|
||||||
purple
|
|
||||||
brother
|
|
||||||
hands
|
|
||||||
cat
|
|
||||||
spring
|
|
||||||
cake
|
|
||||||
mouth
|
|
||||||
eraser
|
|
||||||
grandma
|
|
||||||
juice
|
|
||||||
run
|
|
||||||
dog
|
|
||||||
school
|
|
||||||
feet
|
|
||||||
apple
|
|
||||||
elephant
|
|
||||||
chair
|
|
||||||
sister
|
|
||||||
tiger
|
|
||||||
yellow
|
|
||||||
windy
|
|
||||||
pizza
|
|
||||||
study
|
|
||||||
dad
|
|
||||||
summer
|
|
||||||
plant
|
|
||||||
red
|
|
||||||
monkey
|
|
||||||
book
|
|
||||||
fall
|
|
||||||
cloudy
|
|
||||||
mom
|
|
||||||
drink
|
|
||||||
winter
|
|
||||||
sunny
|
|
||||||
fish
|
|
||||||
play
|
|
||||||
head
|
|
||||||
hands
|
|
||||||
banana
|
|
||||||
pencil
|
|
||||||
autumn
|
|
||||||
legs
|
|
||||||
eyes
|
|
||||||
drink
|
|
||||||
teacher
|
|
||||||
grass
|
|
||||||
run
|
|
||||||
cake
|
|
||||||
ears
|
|
||||||
grandma
|
|
||||||
dog
|
|
||||||
white
|
|
||||||
jump
|
|
||||||
@@ -2,6 +2,6 @@ import { check } from 'express-validator'
|
|||||||
import { noError } from '../../middleware/validator.js'
|
import { noError } from '../../middleware/validator.js'
|
||||||
|
|
||||||
export const checkQuestId = () =>
|
export const checkQuestId = () =>
|
||||||
check('questId').notEmpty().isString().isAlphanumeric().isLength({ max: 64 })
|
check('questId').notEmpty().isString().isLowercase().isLength({ max: 64 })
|
||||||
|
|
||||||
export const questIdValidator = [checkQuestId(), noError]
|
export const questIdValidator = [checkQuestId(), noError]
|
||||||
Reference in new issue
Block a user