現今對於學生來說寫程式已經是一項基本技能,而能使用越多的程式語言 也代表手邊的工具越多,因此學習寫程式也越來越受到重視。在過去的學習程 式方式從高階的 C/C++ 到組合語言甚至是現今很流行的 java 這些語言大家的學 習方式都是老師教完基本指令接著無止盡的練習,這樣很容易遇到瓶頸或是無 法 debug 時便會失去學習興趣進而放棄。因此本篇論文是想藉由這幾年在教育 上非常火紅的學習方式:問題導向的學習搭配我們的魔術開關盒遊戲來學習整 個程式的構思及實現。 問題導向學習法指的是透過問題或情境誘發學生思考,並建立學習目標, 學生進行自我導向式研讀,增進新知或修正舊有的知識內容。PBL 不只能夠解 決問題,在處理問題的同時,也是我們精進知識的最佳時機。 藉由一開始展示給學生看我們做出的魔術開關盒示範影片,讓他們感覺到 這個魔術神的地方。之後便開是按照我們設計出的 PBL 流程開始切入最後目的 是讓學生能藉由簡單的 AI2 來實現這個魔術的架構。 最後,本篇論文中的魔術開關盒硬體的部分包盒了簡單電路以及一塊 Arduino 版搭配了藍芽功能(bluno nano),而軟體的部分則是用 Arduino code (C++) 來完成的。藉由此裝置將整個魔術完整呈現給學生再引導他們利用較簡 單 MIT 的寫程式工具 AI2 發展成的程式指令功能模塊貫穿出整個魔術的情境及 實現。 ;Nowadays, programing for students is now a basic skill, and the more programming languages you can use, the more tools you have at hand, so learning to program is getting more and more attention. In the past, the way of learning programing from high-level language like C/C++ to assembly language and even the popular Java language is the way for teachers to teach basic instructions and then with endless practice, which is easy to encounter bottlenecks or If you can′t debug, you will lose your interest in learning and give up. Therefore, this paper is intended to learn the whole program by using most popular learning way in the past few years: problem- based learning with the magic switch board game. Problem-based learning refers to inducing students to think through problems or situations, and establishing learning goals. By showing the students to the magic switch box demonstration film we made at the beginning, let them feel the place of this magic god. After that, it was started according to the PBL process we designed. The final goal is to enable students to implement this magic structure with simple AI2. Finally, in this paper, the hardware part of the magic switch box has a simple circuit and an Arduino version with a blue function (bluno nano), while the software part is done with Arduino code (C++). With this device, the entire magic is presented to the students and then guided to use the simpler MIT programming tool AI2 to develop the program command function module to run through the magic situation and implementation.