spacecraft cli
Version 0.0.8 is out
一個簡單的CLI解決了用打字稿製成的航天器問題
讓我們一起建造火箭!

說,加拿大航天局正在建造一個無人飛船,它將登上月球。
這是有關該項目的更多信息。
該船的起動坐標為(0, 0) ,它在地球上。
該船的最終目的地是(0, 250) ,它在月球上。
該船將使用標準鍵盤在CLI上進行控制,如下所示:
船以0速度從(0, 0)開始,即完全休息。僅當按下有效鍵時,該船才會移動。
按下W會提高船舶的速度,然後通過速度單元向前移動。
按下S降低了船的速度,然後通過速度單元向前移動。
按A和D分別將船向左和向右移動一個單位。
該船還通過速度單位向前移動。
用您首選的語言編寫一個CLI程序,以模擬上述航天器。顯示輸出如下:
(0, 0) ready for launch 。wrong trajectory 。minimum speed 。maximum speed 。(0, 250)時on the moon顯示。contact lost 。 
(0, 0) # Begin with original position.
(0, 1) # W increases the speed to 1 and moves forward.
(0, 3) # W increases the speed to 2 and moves forward.
(-1, 5) # A moves the ship left and forward.
(0, 7) # D moves the ship right and forward.
(0, 8) # S decreases the speed to 1 and moves forward.
...
(0, 250) on the moon # Ship reaches the moon
npm i -g spacecraft-app-cli或者
您可以直接使用npx運行
npx spacecraft-app-cli請參閱NVM或ASDF
要在本地開始,請按照以下說明:
git克隆到本地計算機。 # starts on coordinates (0,0) - Earth
yarn start
# Use W, A, S, or D to starting control .yarn buildyarn test 版權(C)2021 Pyymenta
航天器已獲得MIT許可證的許可。