Nasrun

Dependencies:   mbed

Fork of project_ShipDot by Jirat Nakarit

Revision:
11:305164107874
Parent:
10:b8d45f9b00bf
Child:
12:287c6a9560ca
--- a/main.cpp	Sat Dec 03 08:22:37 2016 +0000
+++ b/main.cpp	Sat Dec 03 08:40:28 2016 +0000
@@ -342,7 +342,7 @@
 void mark_ship_destroyed(){
     int i,j,k = 0;
     
-    if(ship_destroyed[0]==4){
+    if(ship_destroyed[0]==10){
         for(i=0;i<8;i++){
             for(j=0;j<8;j++){
                 if(atk_platform[i][j]==4){
@@ -350,7 +350,7 @@
                 }
             }
         }
-    }else if(ship_destroyed[1]==3){
+    }else if(ship_destroyed[1]==6){
         for(i=0;i<8;i++){
             for(j=0;j<8;j++){
                 if(atk_platform[i][j]==3){
@@ -358,13 +358,13 @@
                 }
             }
         }
-    }else if(ship_destroyed[2]==2){
+    }else if(ship_destroyed[2]==3){
         for(k=0;k<2;k++){
             i = ship2[0][k]/10;
             j = ship2[0][k]%10;
             atk_platform[i][j] = 11;
         }
-    }else if(ship_destroyed[3]==2){
+    }else if(ship_destroyed[3]==3){
         for(k=0;k<2;k++){
             i = ship2[1][k]/10;
             j = ship2[1][k]%10;
@@ -436,7 +436,7 @@
     int sub_end = 0;
     
     for(int i=0;i<15;i++){
-        if(ship_underATK[i]!=0){sub_end++;}
+        if(ship_underATK[i]!=9){sub_end++;}
     }
     if(sub_end==15){return 1;}else{return 0;}
 }