# HW04 補充說明 :::info 11/15 21:00 新增 4.4 補充說明 11/24 16:00 p5範例輸入更新 11/24 22:00 p5範例再更新 11/26 17:00 p5移除自摸判斷 11/28 01:00 更新二盃口番數 ::: ## 4.1 Sorting 無語法限制,盡量寫好看一點,提高可讀性。 ## 4.2 Differential of a Function - 程式要偵測範圍以外的錯誤非法輸入,並且如題目所說 "print an error message and terminate your program.",以下為輸入合法範圍: - degree: uint8_t 範圍 - coefficients: int32_t 範圍 - 如遇到 division by zero 情況,除法部分請當作0/0做輸出 - 請按照題目範例格式輸出 - 多項式在化簡方面,基本上就做 x reduction 就好,可以不用做最簡根式處理 - 如有輸入的 coefficient 數量比 degree 多的情況也視為錯誤情況 ## 4.3 GSAT 沒有補充 ## 4.4 Xiangqi - 規則以下列網站為準: https://www.cccs.org.tw/Message/MessageView?itemid=57&mid=32&page=0&GroupName=%E7%84%A1%E5%88%86%E9%A1%9E 網站上面有的限制均需考慮,包含「王見王」、「塞相眼」、「拐傌腳」。 - 若有同種棋子都可以將軍,輸出需考慮起始座標`(i,j)`。以` i `較小優先輸出,若` i `相同則以` j `較小為優先。 11/15 21:00 - 不須處理移動 A 棋子後導致 B 棋子可以將軍對方的情況。 - 若一顆棋子有多種移動方式導致將軍,則考慮終點座標`(i,j)`。以` i `較小優先輸出,若` i `相同則以` j `較小為優先。 - 保證不會出現已經將軍的盤面。 ## 4.5 Japanese Mahjong - 更正:執行的程式指令會是 `./hw0405` - 更正:請將二盃口番數改為三番 - 盡力做,助教機乎每個役種都會測一次(應該 - 如果是沒有役種,請盡量按照以下格式輸出 ``` The Score is... No Yaku Total: 0 Han ``` - 如果是錯誤輸入,請盡量按照以下格式輸出 ``` The Score is... Unreasonable case Total: 0 Han ``` - 如果你能做出能遊玩一輪的日麻(東風局)並且支援算點,直接 20 分,你可以問問老師願不願意幫你多加分 - 不清楚該役種的規則,歡迎寄信找助教,或是找助教打一局,如果助教輸了那就直接0分 更新範例輸入:  ```= $ ./hw0405 Please input meld: 1 2 3 0 Is open group(1: YES 0: NO): 0 Please input meld: 4 4 4 4 0 Is open group(1: YES 0: NO): 1 Please input meld: 7 7 7 0 Is open group(1: YES 0: NO): 0 Please input meld: 28 28 28 0 Is open group(1: YES 0: NO): 0 Please input pair: 32 32 Please input winning tile: 28 Player's wind(0:E 1:S 2:W 3:N): 0 Prevailing wind(0:E 1:S 2:W 3:N): 0 The Score is... Half-flush (2 Han) Honer: Player's wind (1 Han) Honer: Prevailing wind (1 Han) Total: 4 Han ```  ```= $ ./hw0405 Please input meld: 34 34 34 0 Is open group(1: YES 0: NO): 0 Please input meld: 33 33 33 0 Is open group(1: YES 0: NO): 0 Please input meld: 28 28 28 0 Is open group(1: YES 0: NO): 0 Please input meld: 9 9 9 0 Is open group(1: YES 0: NO): 1 Please input pair: 32 32 Please input winning tile: 34 Player's wind(0:E 1:S 2:W 3:N): 0 Prevailing wind(0:E 1:S 2:W 3:N): 0 The Score is... All terminals and honors (2 Han) All triplets (2 Han) Half-flush (2 Han) Little three dragons (2 Han) Three concealed triplets (2 Han) Honer: Green (1 Han) Honer: Player's wind (1 Han) Honer: Prevailing wind (1 Han) Honer: Red (1 Han) Total: 14 Han (Kazoe-yakuman) ```  ```= $ ./hw0405 Please input meld: 1 9 32 10 18 19 27 29 30 31 33 34 28 32 0 Please input winning tile: 32 Player's wind(0:E 1:S 2:W 3:N): 0 Prevailing wind(0:E 1:S 2:W 3:N): 0 The Score is... Thirteen orphans 13 wait (2 Yakuman) Total: 2 Yakuman ``` ## 4.6 What Happens?
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up