--- tags: JS 直播班 - 2021 春季班 --- # 第二週小組作業 ## 問題集 ### 第一題 約固定時間討論 使用 Polly 工具,在小組頻道上約彼此有空的時間,[教學文件](https://hackmd.io/V6YRHmm6TpKvqoF0qcnmTA)。 ### 第二題 繪製剪刀石頭布的邏輯 使用 [whimsical](https://whimsical.com/) 工具繪製剪刀石頭布的邏輯,回報時,請提供 whimsical 公開連結給助教檢視。助教會觀察您的邏輯是否都有滿足各種條件。 例如: * 玩家 A 出剪刀:玩家 B 出石頭 = A 玩家輸 * 玩家 A 出剪刀:玩家 B 出布 = A 玩家贏 * 玩家 A 出剪刀:玩家 B 出剪刀 = 平手 * 玩家 A 出布:玩家 B 出布 = 平手 <br> ## 問題集討論答案 ### [whimsical 剪刀石頭布的邏輯](https://whimsical.com/js5-23ywmHnXeN57cYqBtqWGmy) ```javascript= let playerA = "scissors" let playerB = "paper" if (playerA == "scissors") { if (playerB == "scissors") { console.log("It's a tie!") } else if (playerB == 'rock') { console.log("PlayerB is the winner!") } else { console.log("PlayerA is the winner!") } } else if (playerA == "rock") { if (playerB == "scissors") { console.log("PlayerA is the winner!") } else if (playerB == "rock") { console.log("it's a tie!") } else { console.log("PlayerB is the winner!") } } else { if (playerB == "scissors") { console.log("PlayerB is the winner!") } else if (playerB == 'rock') { console.log("PlayerA is the winner!") } else { console.log("It's a tie!") } }; ``` ### 討論過程截圖 ![](https://i.imgur.com/SeZu63A.png) ![](https://i.imgur.com/4pzEVCa.png) ![](https://i.imgur.com/lfPdVcJ.png) ### 參與組員 ``` Fred Chang Lina Chen Jordan_Tseng YU ```