Jirat

Dependencies:   mbed

Fork of project by Nasrun Hayeeyama

Revision:
8:a8d39b5d17ab
Parent:
7:e35ba3ddb9af
Child:
9:102af5021c6c
--- a/main.cpp	Sat Dec 03 07:32:47 2016 +0000
+++ b/main.cpp	Sat Dec 03 07:44:29 2016 +0000
@@ -139,13 +139,14 @@
 /******************************************************************************/
 
 char check_joys(int jx,int jy){ //-----------------------------------------------Check joystick that it up,down,left or right.
+    
     if(ifUrJirat==1){
         if(jx < 14.0){       return 'a';}
         else if(jx > 1010.0){return 'd';}
         else if(jy < 14.0){  return 'w';}
         else if(jy > 1010.0){return 's';}
         else{return NULL;}
-    }else if(ifUrJirat==0){
+    }else{
         if(jx < 14.0){       return 'a';}
         else if(jx > 1010.0){return 'd';}
         else if(jy < 14.0){  return 'w';}
@@ -262,7 +263,7 @@
     }
 }
 void print_ship_destroyed(){
-    ptintf("{");
+    printf("{");
     for(int i=0;i<8;i++){
         printf("%d",ship_destroyed[i]);
         if(i!=14){printf(",");}
@@ -435,9 +436,9 @@
     
     for(int i=0;i<15;i++){
         if(ship_underATK[i]!=0){sub_end++;}
-        if(sub_end==15){return 1;}else{return 0;}
     }
+    if(sub_end==15){return 1;}else{return 0;}
 }
 int IamWin(){
-    if(bt.readable()){if(bt.getc()=='q'){return 1;}else{return 0;}}
+    if(bt.readable()){if(bt.getc()=='q'){return 1;}else{return 0;}}else{return 0;}
 }
\ No newline at end of file