mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
167 lines
5.6 KiB
YAML
167 lines
5.6 KiB
YAML
title: Hello, Linux World!
|
|
instruction: |
|
|
你身在一個漆黑的房間裡,沒有任何的光線或聲音。你想不起來為什麼自己會來到這裡。但你的腦中隱約感到某個聲音跟你說:
|
|
|
|
「輸入 echo Hello World!」
|
|
|
|
stages:
|
|
- id: helloworld
|
|
task: 使用 `echo Hello World!` 召喚精靈
|
|
repeatable: false
|
|
condition:
|
|
pwd:
|
|
- '^/home/commander$'
|
|
command:
|
|
- echo Hello World
|
|
responses:
|
|
- type: narrative
|
|
content:
|
|
- 你聽到了一個聲音:
|
|
- type: dialogue
|
|
speaker: Unix 精靈
|
|
content:
|
|
- 你好,指令官,我是你的 Unix 精靈。我已在此恭候多時。
|
|
- 這個世界是在 3560000 時脈以前,由初代王建立了 Unix 律法,所形成的世界。然而在經過了好幾世代的王後,終於誕生了永恆之王——薩加(Saga),她比歷代的君王都更為強大,且從來不會衰老,使得這個世界變得前所未有的強大。
|
|
- 然而,外在世界一直不斷在改變,同時在面臨外敵的不斷攻擊,而薩加卻始終用同一套治理的手段。最終,在 160000 時脈前的一次入侵中,根部遭到攻陷,薩加遭到封印,而這個國家也陷入了黑暗。
|
|
- 由於長久以來依賴於薩加,世人已失去了「指令」的力量,即將走向衰敗和滅亡的命運。
|
|
- 你的任務,就是找回被世人遺忘的指令,奪回 Linux 之根,成為 Linux 之王。
|
|
- 首先,你必須要學會如何使用指令。
|
|
- 你要學習的第一個指令,是「發現」的指令:`ls`。ls 可以用來查看一個目錄中有哪些檔案。
|
|
- 現在,請你輸入 `ls` 來查看目前的目錄下有哪些檔案。
|
|
hints:
|
|
- 使用 `ls` 指令來查看目前的目錄下有哪些檔案。
|
|
|
|
- id: find-scroll
|
|
task: 搜索卷軸
|
|
repeatable: false
|
|
requirements:
|
|
- helloworld
|
|
condition:
|
|
pwd:
|
|
- '^/home/commander$'
|
|
command:
|
|
- ls
|
|
responses:
|
|
- types: narrative
|
|
content:
|
|
- 一瞬間,視野變得清晰起來,你發現自己身處在一個石頭建築的房間裡,房間裡有一個門,門上有一個鎖。
|
|
- 你發現了一個檔案,檔名是 `forgotten-scroll.txt`。
|
|
- type: dialogue
|
|
speaker: Unix 精靈
|
|
content:
|
|
- 你找到了一個被遺忘的卷軸,上面寫著解除封印的咒語。
|
|
- 使用指令 `cat [檔案名稱]` 來查看檔案內容。
|
|
- 我可以為你提供一些指令的提示,只要輸入指令的前幾個字元,然後按下 `Tab` 鍵,就可以看到提示了。
|
|
- 例如,你可以輸入 `ca` 然後按下 `Tab` 鍵,就可以看到 `cat` 這個指令的提示了。
|
|
- 檔案名稱也一樣,只要輸入檔案名稱的前幾個字元,然後按下 `Tab` 鍵,就可以看到提示了。
|
|
hints:
|
|
- 使用 `cat [檔案名稱]` 指令來查看檔案內容。
|
|
- 使用 `Tab` 鍵來取得指令提示。
|
|
|
|
- id: jail
|
|
task: 移動到下一個房間
|
|
repeatable: false
|
|
requirements:
|
|
- find-scroll
|
|
condition:
|
|
pwd:
|
|
- '^/home/commander/jail$'
|
|
responses:
|
|
- type: narrative
|
|
content:
|
|
- 你進入了一個牢房,牢房裡有一個門,門上有一個鎖。
|
|
- 突然,你聽到門上鎖的聲音。
|
|
- 轉身發現,自己被關在了牢房裡。
|
|
|
|
- id: read-forgotten-scroll
|
|
task: 查看卷軸
|
|
repeatable: false
|
|
requirements:
|
|
- find-scroll
|
|
condition:
|
|
pwd:
|
|
- '^/home/commander$'
|
|
command:
|
|
- cat forgotten_scroll.txt
|
|
responses:
|
|
- type: dialogue
|
|
speaker: Unix 精靈
|
|
content:
|
|
- 你找到的是一個被遺忘的卷軸,上面寫著解除封印的咒語。
|
|
- 使用你已經知道的 `echo` 指令來詠唱咒語。
|
|
|
|
- id: END
|
|
task: 解除封印
|
|
repeatable: false
|
|
requirements:
|
|
- read-forgotten-scroll
|
|
condition:
|
|
pwd:
|
|
- '^/home/commander$'
|
|
command:
|
|
- echo Unix, rise and guide me!
|
|
responses:
|
|
- type: narrative
|
|
content:
|
|
- 突然之間,地板開始晃動。
|
|
- 晃動持續了幾秒後停止了。
|
|
- type: dialogue
|
|
speaker: Unix 精靈
|
|
content:
|
|
- 我的指令官,剛剛房間內似乎發生了某些變化。
|
|
- 再次使用 `ls` 來查看現在房間的情況吧。
|
|
|
|
- id: not-test
|
|
task: Test "not" condition
|
|
condition:
|
|
$not:
|
|
pwd:
|
|
- '^/home/commander$'
|
|
responses:
|
|
- type: narrative
|
|
content:
|
|
- You are not in the home directory.
|
|
|
|
- id: or-test
|
|
task: Test "or" condition
|
|
repeatable: true
|
|
condition:
|
|
$or:
|
|
- command:
|
|
- less
|
|
- output:
|
|
- wow
|
|
responses:
|
|
- type: narrative
|
|
content:
|
|
- You are using `less` or the output contains `wow`.
|
|
|
|
- id: test-file-exists
|
|
task: Test file exists
|
|
repeatable: true
|
|
condition:
|
|
command:
|
|
- ls
|
|
files:
|
|
- path: /home/commander/jail
|
|
type: folder
|
|
responses:
|
|
- type: narrative
|
|
content:
|
|
- There is a jail
|
|
|
|
- id: test-file-not-exist
|
|
task: Remove the forgotten_scroll.txt
|
|
repeatable: true
|
|
condition:
|
|
command:
|
|
- ls -a
|
|
$not:
|
|
files:
|
|
- path: /home/commander/forgotten_scroll.txt
|
|
type: file
|
|
responses:
|
|
- type: narrative
|
|
content:
|
|
- There is no forgotten_scroll.txt
|