F);
- gt; lhit=0; (i=0; i lt; PF1- gt; sizeField; i ++) (j=0; j lt; PF1- gt; sizeField; j ++)
{(PF1- gt; player [i] [j] == 1)
{(PF1- gt; player [i - 1] [j] == 0 amp; amp; i gt; 0)
{- gt; M [PF1- gt; lhit] [0]=i; - gt; M [PF1- gt; lhit] [1]=j; - gt; lhit ++; - gt ; f=1;
} if (PF1- gt; player [i + 1] [j] == 0 amp; amp; i lt; 9)
{- gt; M [PF1- gt; lhit] [0]=i; - gt; M [PF1- gt; lhit] [1]=j; - gt; lhit ++; - gt ; f=1;
} if (PF1- gt; player [i] [j - 1] == 0 amp; amp; j gt; 0)
{- gt; M [PF1- gt; lhit] [0]=i; - gt; M [PF1- gt; lhit] [1]=j; - gt; lhit ++; - gt ; f=1;
} if (PF1- gt; player [i] [j + 1] == 0 amp; amp; j lt; 9)
{- gt; M [PF1- gt; lhit] [0]=i; - gt; M [PF1- gt; lhit] [1]=j; - gt; lhit ++; - gt ; f=1;
}
}
}
}
} gt; close (); (Pfield, PF1, PN1); (Qt :: LeftDockWidgetArea, Pfield); - gt; amount=10; (gMode!=1)
{- gt; amount=10; (Efield, PF2, PN2); (Qt :: RightDockWidgetArea, Efield);
}
{ gt; amount=10; (Efield, EF, PN2); (Qt :: RightDockWidgetArea, Efield);
}
() ;. close ();
}
MainWindow :: getMatrix (QString line, PlayerField * amp; var, int i)
{j, len, l; ch;
=0;=line.length (); (j=0; j lt; len; j ++)
{(line (j) == - )
{= line (j); ++;=ch + line (j);
} ch=line (j); gt; player [i] [l]=ch.toInt (); ++; (l gt; 9) l=0;
}
}
MainWindow :: getMatrix (QString line, EnemyField * amp; var, int i)
{j, len, l; ch;
=0;=line.length (); (j=0; j lt; len; j ++)
{(line (j) == - )
{= line (j); ++;=ch + line (j);
} ch=line (j); gt; player [i] [l]=ch.toInt (); ++; (l gt; 9) l=0;
}
}
MainWindow :: checkEnd (QString amp; line)
{i, len; temp;=line.length (); (i=0; i lt; len; i ++) (line (i)!= n )=temp + line (i);=temp;
}
MainWindow :: loadShips (PlayerField * amp; var)
{i, j; temp;
(i=0; i lt; 4; i ++)
{= file.readLine (); (temp); (i, var- gt; fourDeck.location, temp);
}
(j=0; j lt; 2; j ++) (i=0; i lt; 3; i ++)
{= file.readLine (); (temp); (i, var- gt; threeDeck [j] .location, temp);
}
(j=0; j lt; 3; j ++) (i=0; i lt; 2; i ++)
{= file.readLine (); (temp); (i, var- gt; twoDeck [j] .location, temp);
}
(j=0; j lt; 4; j ++)
{= file.readLine (); (temp); (0, var- gt; oneDeck [j] .location, temp);
}
}
MainWindow :: loadShips (EnemyField * amp; var)
{i, j; temp;
(i=0; i lt; 4; i ++)
{= file.readLine (); (temp); (i, var- gt; fourDeck.location, temp);
}
(j=0; j lt; 2; j ++) (i=0; i lt; 3; i ++)
{= file.readLine (); (temp); (i, var- gt; threeDeck [j] .location, temp);
}
(j=0; j lt; 3; j ++) (i=0; i lt; 2; i ++)
{= file.readLine (); (temp); (i, var- gt; twoDeck [j] .location, temp);
}
(j=0; j lt; 4; j ++)
{= file.readLine (); (temp); (0, var- gt; oneDeck [j] .location, temp);
}
}
MainWindow :: supLoadShips (int i, int ** amp; m, QString temp)
{ch; j, l, len;=0;=temp.length ();
(j=0; j lt; len; j ++)
{(temp (j)!= )
{= temp (j); [i] [l]=ch.toInt (); ++;
}
{. clear ();
}
}
}
MainWindow :: playing ()