program.c
//Used to decide if either the player or the computer have won  (works)
Used to decide if either the player or the computer have won  (works)
Used to decide if either the player or the computer have won ( works )
int win(ship *pShips, ship *cShips){
  int pwin, cwin;
  pwin = pShips[0].status + pShips[1].status + pShips[2].status;
  cwin = cShips[0].status + cShips[1].status + cShips[2].status;
  if(cwin == 0) return 1; 
  if(pwin == 0) return 2; 
  return 0; 
}
int win ( ship * pShips , ship * cShips ) { int pwin , cwin ; pwin = pShips [ 0 ] . status + pShips [ 1 ] . status + pShips [ 2 ] . status ; cwin = cShips [ 0 ] . status + cShips [ 1 ] . status + cShips [ 2 ] . status ; if ( cwin == 0 ) return 1 ; if ( pwin == 0 ) return 2 ; return 0 ; }
Used to decide if either the player or the computer have won  (works)
Used to decide if either the player or the computer have won ( works )
//player wins //computer wins //no one has won yet