internal static bool PoserPiece(out int position, int idPiece, int[,] plateau) { int caseChoisie = rn.Next(0, 16); Utilisables.Pos2Coord(out int x, out int y, caseChoisie); while (plateau[x, y] >= 0) { caseChoisie = rn.Next(0, 16); Utilisables.Pos2Coord(out x, out y, caseChoisie); } plateau[x, y] = idPiece; IHM.AfficherCaseOrdi(x, y); position = caseChoisie; return(false); }
internal static bool PoserPieceIA(out int position, int idPiece, int[,] plateau, int[][] piecesCalcul) { int x, y; position = TrouverPos(idPiece, plateau, piecesCalcul); if (position == -1) { PoserPiece(out position, idPiece, plateau); } else { Utilisables.Pos2Coord(out x, out y, position); plateau[x, y] = idPiece; IHM.AfficherCaseOrdi(x, y); } return(false); }