第四組


第四組

Group 4

組員

410586037 張孟承

410586029 蘇群哲

410586026 黃威誠

410586028 許博鈞

410586021 林泓叡

Learning object

1.Learn the flow chart

2.Usage and comparison of variables

Knowledge Points

1.If .. then block

2.If .. then otherwise block

3.The value of the sensor will be saved as a variable.

[Part1] If...then...

When the condition is matched, the block will do what you set in the (then) block.

[Part2] If...else...

As following, when the condition isn't matched, the block will do what you set in the (else) block.

Part1

Part2

[Part3] variable

To save the value that sensor got as the variable (light).

[Part4] Guessing game

Try to guess what computer will choose.

In this part, you can choose 1 or 2 on mBlock window.

If the number you choose is the same as the number computer choose, mbot will ring a short part of Do-Re-Mi. If not, mbot will ring twice for your failure.

Part3

Part4

Step 1. 點選新增角色,選擇兩個Button。

Step 2. 點選畫新角色(畫筆),再來點右邊那一排的文字(T),用鍵盤打 1。

Step 3. 點選畫新角色(畫筆),再來點右邊那一排的文字(T),用鍵盤打 2。

Step 4. 點選畫新角色(畫筆),再來點右邊那一排的文字(T),用鍵盤打Guess,排成左邊的樣子。

Step 5. 點選程式區裡的資料與指令,選擇做一個變數,總共做三個變數,分別是select、camp、computer。

Step 6 .點選角色欄的Guess,接下來再加左邊的指令,以方便初始化select與camp的數值狀態

Step 7. 點選角色欄的Button2,把左邊的指令加進去。select設為1代表你有做選擇,camp設為1代表你猜的數字是1

Step 8. 點選角色欄的Button3,把左邊的指令加進去。select設為1代表你有做選擇,camp設為2代表你猜的數字是2

Part4

Step 9.點選左下角的舞台,照著左邊的程式來操作。

第一張圖為告知你遊戲準備開始,當你做出選擇,select為1或2且都大於0時,程式就會往下執行。

第二張圖開始設定猜數字的主要部分,電腦從1或2之中隨機選取任一數字,當你猜的數字跟電腦選取的一樣時,撥放一段音樂恭喜你猜對,並且亮綠燈;而當你猜錯的時候,撥放一段音樂告知你猜錯了,並且亮紅燈


參考資料:eddie大神

mbot圖片引用自http://touchclassroom.blogspot.com/2015/05/mbot_14.html

Thanks for your listening !


























幕後花絮