Nucleo F446とスタートアップ基板とスピーカーモジュールでできる簡単なゲーム。

Dependencies:   beep_sound mbed

Files at this revision

API Documentation at this revision

Comitter:
RBH
Date:
Mon Jun 06 13:13:13 2016 +0000
Parent:
0:e62d3022b053
Commit message:
add comments

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat Jun 04 17:53:08 2016 +0000
+++ b/main.cpp	Mon Jun 06 13:13:13 2016 +0000
@@ -25,8 +25,11 @@
 }
 
 int main(void) {
-    int seed, j, states, randomNum;
-    int sayuu[TIMES];
+    int seed,
+        j,  // whileループ内で使うフラグ
+        states, // 0ならゲームクリア、0以外なら失敗
+        randomNum;  // seed値からさらにランダムな数を作る
+    int sayuu[TIMES];   // 1なら左、2なら右のLED
 
     while(1){
         //各種初期化
@@ -89,6 +92,7 @@
             }
         }
         //printf("%d\n\r", states);
+        // 以下パーフェクトの場合の挙動
         if(states==0){
             led1=1;
             led2=1;