-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ordi_Facile.cs
54 lines (50 loc) · 2.29 KB
/
Ordi_Facile.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SaleVeau
{
class Ordi_Facile
{
/// <summary>
/// Tire sur la case de coordonnées <paramref name="coords"/>[<paramref name="index"/>]
/// et choisit aléatoirement les prochaines coordonnées
/// </summary>
/// <param name="grilleBateauxJoueur"></param>
/// <param name="grilleMissileJoueur"></param>
/// <param name="tabToucheBateauxJoueur"></param>
/// <param name="rdn"></param>
/// <param name="coords"></param>
/// <param name="dirs"></param>
/// <param name="goodDirs"></param>
/// <param name="typePrecs"></param>
/// <param name="tabtaillesBateaux"></param>
/// <param name="index"></param>
/// <param name="tirDispo"></param>
public static void ObtenirProchainCoup(int[,] grilleBateauxJoueur
, int[,] grilleMissileJoueur, int[] tabToucheBateauxJoueur
, Random rdn, int[][] coords, int[] dirs, bool[] goodDirs, int[] typePrecs, int[] tabtaillesBateaux, int index, int tirDispo)
{
int result = GrilleMissile.Tirer(grilleBateauxJoueur, grilleMissileJoueur
, tabToucheBateauxJoueur, coords[index], tabtaillesBateaux);
if (Grille.CompterNbCaseVide(grilleMissileJoueur) > tirDispo)
{
int[] coordInter;
do
{
//on en cherche une
coordInter = Grille.ChoisirCaseVideAlea(grilleMissileJoueur, rdn);
} while (Grille.ContenirCoord(coords, coordInter));
coords[index] = coordInter;
}
}
}
}
/*
77777777777777777....77777777777777777777777777777777777777777777..7777777777777...7777777 777777777
77777777777777....7777.77......777777777777...77777777777777..777777.777777777777...777777 777777777
777777777777....7777777777777777777777777777777777777777777777777..7777.7777777777...77777 777777777
77777777777...777777777777.....77777777777777777777.7777777777...777.7777.777777777...7777 777777777
7777777777..77777777777.7777777777777777777777777.7777777777777777..777.7777.7777777...777 777777777
*/