my_game.ino (Arduino IDE / C++)
C++ 遊戲主迴圈結構示意Illustrative C++ game loop
// Edcosys game code base
#include "EdcosysConsole.h"
int playerX = 120;
int speed = 4;
void loop() {
if (btnRight()) playerX += speed;
if (btnLeft()) playerX -= speed;
drawPlayer(playerX, 200);
updateScreen();
}
Edcosys 遊戲程式碼庫封裝的底層功能Abstracted by the Edcosys game code base
顯示屏驅動、搖桿與按鍵訊號讀取及蜂鳴器底層控制。Display drivers, joystick polling, button debouncing and buzzer signalling.
學生親手編寫的 C++ 核心邏輯Programmed by the student in C++
變數、條件判斷、迴圈、座標移動、遊戲規則與除錯。Variables, conditionals, loops, coordinate movement, game rules and debugging.
AI 的教學定位:程式診斷與除錯助手The pedagogical role of AI: diagnostic debugging support
可選配置,非必須項目Optional, not required
-
01
識別編譯或邏輯異常Identify compiler or logic errors
學生先檢視遊戲畫面表現,並閱讀 Arduino IDE 的編譯錯誤訊息。Students inspect screen behaviour alongside the compiler output in Arduino IDE.
-
02
向 AI 查詢錯誤成因(如 Gemini 或 Copilot)Consult AI for error diagnosis (Gemini, Copilot or similar)
AI 負責解釋出錯原因並建議修正方向,全程不上載任何學生個人資料。AI explains the root cause and suggests a correction without uploading any personal data.
-
03
獨立驗證建議並親手修改程式碼Verify the diagnosis and implement the fix independently
AI 不會代學生編寫整套遊戲;每項修改均由學生理解原理後親手輸入並重新編譯驗證。AI never writes the games for the student. Every fix is reviewed, typed in by hand and re-tested.