Nasrun

Dependencies:   mbed

Fork of project_ShipDot by Jirat Nakarit

Revision:
21:d76aa19984be
Parent:
20:4b9be9a423a8
Child:
22:5bc894988f11
diff -r 4b9be9a423a8 -r d76aa19984be main.cpp
--- a/main.cpp	Sat Dec 03 16:48:27 2016 +0000
+++ b/main.cpp	Sat Dec 03 17:45:57 2016 +0000
@@ -427,6 +427,7 @@
     select_Position = 0;
     while(1){
         if(bt.readable()){
+            replica_data_fromEnemy = bt.getc();
             if(replica_data_fromEnemy!='q' and replica_data_fromEnemy!=8){
                 data_fromEnemy = char2posit(replica_data_fromEnemy);
                 if(data_fromEnemy!=18){
@@ -436,7 +437,8 @@
                     ATKposition = select_Position;
                     break;
                 }
-            }else{
+            }
+            if(replica_data_fromEnemy=='q'){
                 check_win = 1;
                 break;
             }