Nasrun Hayeeyama
/
project_ShipDot
Nasrun
Fork of project_ShipDot by
Diff: main.cpp
- Revision:
- 10:b8d45f9b00bf
- Parent:
- 9:102af5021c6c
- Child:
- 11:305164107874
--- a/main.cpp Sat Dec 03 07:57:09 2016 +0000 +++ b/main.cpp Sat Dec 03 08:22:37 2016 +0000 @@ -45,7 +45,7 @@ int enemy_platform[8][8] = {{0}}; int ship_platform[8][8] = {{0}}; //______________________________________________This is ship area. int atk_platform[8][8] = {{0}}; -int ship_underATK[15] = {9}; +int ship_underATK[15] = {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9}; int ship_destroyed[8] = {0}; int ship4[4] = {0}; int ship3[3] = {0}; @@ -296,12 +296,12 @@ atk_platform[x][y] = ship_platform[x][y]; bt.putc(posit2char(atk_platform[x][y])); ship_underATK[check_ship_underATK] = (x*10)+y; - check_ship_underATK++; if(atk_platform[x][y]==4){ for(i=0;i<4;i++){ for(j=0;j<15;j++){ if(ship4[i]==ship_underATK[j]){ ship_destroyed[0]++; + printf("%d || %d : %d\n",ship_destroyed[0],ship4[i],ship_underATK[j]); } } } @@ -429,6 +429,7 @@ } printf("Enemy attack at your area %d\n",ATKposition); getATK_platform(ATKposition); + check_ship_underATK++; mark_ship_destroyed(); } int TellUrEnemy_uWin(){