From 057635eed6ce19358611379000dca39aa0893c35 Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Thu, 23 Nov 2023 21:03:32 +0800 Subject: [PATCH] all quest modify --- quests/cast/game.yml | 37 ++++++++++----------- quests/copy/game.yml | 7 ++-- quests/create/game.yml | 3 +- quests/explore/game.yml | 64 ++++++++++++++++++++----------------- quests/get-started/game.yml | 2 +- quests/helloworld/game.yml | 4 --- quests/move/game.yml | 15 +++++---- quests/path/game.yml | 46 +++++++++++++++----------- quests/read/game.yml | 2 +- quests/remove/game.yml | 17 +++++----- 10 files changed, 106 insertions(+), 91 deletions(-) diff --git a/quests/cast/game.yml b/quests/cast/game.yml index 987e547..7774320 100644 --- a/quests/cast/game.yml +++ b/quests/cast/game.yml @@ -1,8 +1,10 @@ title: 輸出文字 instruction: | - 在這一關,你將會學到如何使用 `echo` 指令,以及它在遊戲中的特殊功能。 + 在這個關卡中,你將會學到: + 1. 如何使用 `echo` 指令 + 2. `echo` 指令在遊戲中的用途 - 請輸入 `echo start` 來開始這一關。 + 準備好就輸入 `echo start` 開始吧! requirements: - get-started @@ -18,7 +20,6 @@ stages: - id: start task: 輸入 `echo start` 來開始教程 - repeatable: false condition: output: - ^start$ @@ -34,7 +35,6 @@ stages: - id: echo task: 在終端機上顯示顯示任意文字 - repeatable: false requirements: - start condition: @@ -49,12 +49,26 @@ stages: - id: how-are-you task: 在終端機上顯示 `How are you?` - repeatable: false requirements: - echo condition: output: - ^[Hh]ow are you\??$ + exceptions: + - condition: + command: + - ^[Hh]ow are you\??$ + responses: + - type: narrative + content: + - 在 `How are you?` 前面必須加上 `echo` + - condition: + command: + - ^echo$ + responses: + - type: narrative + content: + - 在 `echo` 後面還需要加上一些文字 responses: - content: - 你成功的在終端機上顯示了 `How are you?`。 @@ -67,21 +81,9 @@ stages: hints: - ➤ 試著使用 `echo` 來詠唱 `HELP` 咒語 - ➤ 注意:咒語要使用大寫 - exceptions: - - condition: - command: - - ^[Hh]ow are you\??$ - hints: - - ➤ 在 `How are you?` 前面必須加上 `echo` - - condition: - command: - - ^echo$ - hints: - - ➤ 在 `echo` 後面還需要加上一些文字 - id: help task: 詠唱 `HELP` 咒語 - repeatable: false requirements: - how-are-you condition: @@ -103,7 +105,6 @@ stages: - id: END task: 詠唱 `WATER` 咒語 - repeatable: false requirements: - help condition: diff --git a/quests/copy/game.yml b/quests/copy/game.yml index 9968af2..11d4f3c 100644 --- a/quests/copy/game.yml +++ b/quests/copy/game.yml @@ -1,8 +1,9 @@ title: 複製檔案 instruction: | - 在這個關卡中,你會學習到: - 1. 如何用 `cp` 指令複製檔案。 - 準備好就輸入 `echo start` 來開始吧! + 在這個關卡中,你將會學到: + 1. 如何用 `cp` 指令複製檔案 + + 準備好就輸入 `echo start` 開始吧! requirements: - create diff --git a/quests/create/game.yml b/quests/create/game.yml index 3c99acd..e958770 100644 --- a/quests/create/game.yml +++ b/quests/create/game.yml @@ -1,8 +1,9 @@ title: 建立檔案與資料夾 instruction: | - 在這個關卡中,你會學習到: + 在這個關卡中,你將會學到: 1. 如何使用 `touch` 建立檔案 2. 如何使用 `mkdir` 建立資料夾 + 準備好就輸入 `echo start` 開始吧! requirements: diff --git a/quests/explore/game.yml b/quests/explore/game.yml index e82bf70..9dba3cf 100644 --- a/quests/explore/game.yml +++ b/quests/explore/game.yml @@ -4,7 +4,7 @@ instruction: | 1. 如何使用 `ls` 查看資料夾的內容 2. 如何使用 `cd` 在資料夾之間移動 - 請輸入 `echo start` 來開始這一關。 + 準備好就輸入 `echo start` 開始吧! requirements: - get-started @@ -20,7 +20,6 @@ stages: - id: start task: 輸入 `echo start` 來開始教程 - repeatable: false condition: output: - ^start$ @@ -41,6 +40,23 @@ stages: condition: command: - ^ls$ + exceptions: + - condition: + not: + pwd: + - /home/commander + responses: + - type: narrative + content: + - 請先回到 `/home/commander/` 資料夾 + - 輸入 `cd ~` 來返回 `/home/commander/` 資料夾 + - condition: + command: + - ^[Ii]s$ + responses: + - type: narrative + content: + - '!! `ls` 的首字母是小寫的 `L`,不是 `I` !!' responses: - content: - 你應該能看到資料夾中的內容了。 @@ -55,19 +71,6 @@ stages: - 現在,請你進入 `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` 資料夾 @@ -76,6 +79,23 @@ stages: condition: pwd: - /home/commander/folder1 + exceptions: + - condition: + pwd: + - /home/commander + responses: + - type: narrative + content: + - 輸入 `cd folder1` 來進入 `folder1` 資料夾 + - condition: + not: + pwd: + - /home/commander + responses: + - type: narrative + content: + - 請先回到 `/home/commander/` 資料夾 + - 輸入 `cd ~` 來返回 `/home/commander/` 資料夾 responses: - content: - 你成功的進入 `folder1` 資料夾了。 @@ -86,23 +106,9 @@ stages: - 現在,請查看 `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: diff --git a/quests/get-started/game.yml b/quests/get-started/game.yml index ac22b56..edf623d 100644 --- a/quests/get-started/game.yml +++ b/quests/get-started/game.yml @@ -1,7 +1,7 @@ title: 終端機的基本知識 instruction: | 歡迎來到 Linux Odyssey! - 在這一關你將會學到: + 在這個關卡中,你將會學到: 1. 如何使用這個網站 2. 如何使用終端機 diff --git a/quests/helloworld/game.yml b/quests/helloworld/game.yml index b4d478c..05e382a 100644 --- a/quests/helloworld/game.yml +++ b/quests/helloworld/game.yml @@ -10,7 +10,6 @@ requirements: stages: - id: help task: 輸入 `echo help` 來朗誦咒語 - repeatable: false condition: pwd: - '^/home/commander$' @@ -36,7 +35,6 @@ stages: - id: find-scroll task: 搜索卷軸 - repeatable: false requirements: - help condition: @@ -63,7 +61,6 @@ stages: - id: read-forgotten-scroll task: 查看卷軸 - repeatable: false requirements: - find-scroll condition: @@ -82,7 +79,6 @@ stages: - id: END task: 解除封印 - repeatable: false requirements: - read-forgotten-scroll condition: diff --git a/quests/move/game.yml b/quests/move/game.yml index 916af35..80a0a1e 100644 --- a/quests/move/game.yml +++ b/quests/move/game.yml @@ -1,8 +1,9 @@ title: 移動檔案 instruction: | - 在這個關卡中,你會學到: + 在這個關卡中,你將會學到: 1. 如何用 `mv` 移動檔案與資料夾 - 準備好就輸入 `echo start` 來開始吧! + + 準備好就輸入 `echo start` 開始吧! requirements: - create @@ -202,11 +203,6 @@ stages: type: file - path: docs/hello.txt exists: false - responses: - - type: narrative - content: - - 你做得很好! - - 你已經學會如何移動檔案與資料夾了! exceptions: - condition: command: @@ -217,3 +213,8 @@ stages: - 你可以使用 `mv docs/hello.txt hi.txt` 來完成這個任務。 hints: - 使用 `mv docs/hello.txt hi.txt` 來將 `docs/hello.txt` 移動到家目錄底下的 `hi.txt` + responses: + - type: narrative + content: + - 你做得很好! + - 你已經學會如何移動檔案與資料夾了! diff --git a/quests/path/game.yml b/quests/path/game.yml index 4b09f83..59de297 100644 --- a/quests/path/game.yml +++ b/quests/path/game.yml @@ -4,7 +4,7 @@ instruction: | 1. 絕對路徑和相對路徑 2. 如何使用 `pwd` 顯示目前的路徑 - 請輸入 `echo start` 來開始這一關。 + 準備好就輸入 `echo start` 開始吧! requirements: - cast @@ -72,6 +72,15 @@ stages: - ^/home/commander/folder2$ command: - ^cd \.\./folder2$ + exceptions: + - condition: + not: + pwd: + - ^/home/commander/folder1$ + responses: + - type: narrative + content: + - 請先回到 `folder1` 資料夾,並用指定的方式進入 `folder2` 資料夾。 responses: - content: - 你成功的用相對路徑進入了 `folder2` 資料夾。 @@ -80,13 +89,6 @@ stages: - 試著用這個方式查看 `folder1` 資料夾中的檔案吧。 hints: - ➤ 請輸入 `ls ../folder1` 來查看 `folder1` 資料夾中的檔案。 - exceptions: - - condition: - not: - pwd: - - ^/home/commander/folder1$ - hints: - - ➤ 請先回到 `folder1` 資料夾,並用指定的方式進入 `folder2` 資料夾。 - id: ls-folder1 task: 查看 `folder1` 資料夾中的檔案 @@ -97,6 +99,15 @@ stages: - ^/home/commander/folder2$ command: - ^ls \.\.\/folder1$ + exceptions: + - condition: + not: + pwd: + - ^/home/commander/folder2$ + responses: + - type: narrative + content: + - 請先回到 `folder2` 資料夾,並用指定的方式查看 `folder1` 資料夾的內容。 responses: - content: - 很好,你現在知道如何運用相對路徑了。 @@ -107,13 +118,6 @@ stages: - 現在請你使用 `pwd` 來查看目前所在的絕對路徑。 hints: - ➤ 輸入 `pwd` 查看目前所在的絕對路徑 - exceptions: - - condition: - not: - pwd: - - ^/home/commander/folder2$ - hints: - - ➤ 請先回到 `folder2` 資料夾,並用指定的方式查看 `folder1` 資料夾的內容。 - id: pwd task: 查看目前所在的絕對路徑 @@ -129,8 +133,10 @@ stages: not: pwd: - ^/home/commander/folder2$ - hints: - - ➤ 請先回到 `folder2` 資料夾,並用 `pwd` 來查看目前所在的絕對路徑 + responses: + - type: narrative + content: + - 請先回到 `folder2` 資料夾,並用 `pwd` 來查看目前所在的絕對路徑 responses: - content: - 你可以看到你現在的絕對路徑是 `/home/commander/folder2`。 @@ -167,8 +173,10 @@ stages: - condition: pwd: - ^/home/commander$ - hints: - - ➤ 請使用 `cd ~` 回到家目錄 + responses: + - type: narrative + content: + - 請使用 `cd ~` 回到家目錄 responses: - content: - 你回到家目錄了。 diff --git a/quests/read/game.yml b/quests/read/game.yml index 40d1711..b9a455f 100644 --- a/quests/read/game.yml +++ b/quests/read/game.yml @@ -3,7 +3,7 @@ instruction: | 在這個關卡中,你將會學到: 1. 如何使用 `cat` 查看檔案的內容 - 請輸入 `echo start` 來開始這一關。 + 準備好就輸入 `echo start` 開始吧! requirements: - path diff --git a/quests/remove/game.yml b/quests/remove/game.yml index 855b52f..f3a9376 100644 --- a/quests/remove/game.yml +++ b/quests/remove/game.yml @@ -1,10 +1,11 @@ title: 刪除檔案與資料夾 instruction: | - 在這個關卡中,你會學到: + 在這個關卡中,你將會學到: 1. 用 `rm` 指令刪除檔案 - 2. 用 `rmdir` 與資料夾。 - 3. 用 `rm -r` 刪除資料夾與它的所有檔案。 + 2. 用 `rmdir` 與資料夾 + 3. 用 `rm -r` 刪除資料夾與它的所有檔案 現在資料夾裡有一些檔案與資料夾,請你使用 `ls` 跟 `cat` 來查看它們的內容。 + 準備好就輸入 `echo start` 開始吧! requirements: @@ -157,11 +158,6 @@ stages: exists: true - path: notes/note.txt exists: false - responses: - - content: - - '很好!現在我們再使用 `rmdir` 指令刪除 `notes` 資料夾。' - hints: - - 使用 `rmdir notes` 來刪除 `notes` 資料夾。 exceptions: - condition: command: @@ -182,6 +178,11 @@ stages: - content: - 這個錯誤的意思是找不到檔案 - '請先用 `ls notes` 確認 `notes` 資料夾內有哪些檔案,再來試試看吧!' + responses: + - content: + - '很好!現在我們再使用 `rmdir` 指令刪除 `notes` 資料夾。' + hints: + - 使用 `rmdir notes` 來刪除 `notes` 資料夾。 - condition: command: