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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
| // On demarre une nouvelle session
session_star();
// On definit des variables de session
$grille= array ('interrogation.png', 'interrogation.png','interrogation.png');
$visibilité=array ('visibilité', 'caché');
$input= array_combine($grille, $visibilité);
print_r(input);
$ligne= "ligne";
$colonne="colonne";
$coup="Nombre de coup"; //Affriche le nombre de coup
$piece="Nombre de pièces"; // Affriche le nom de pièce
$vide="case vide";// Case vide
// Création de table
// 1ère ligne
$tab=array();
$tab[0][0]= "interrogation.png";
$tab[0][1]= "interrogation.png";
$tab[0][2]= "interrogation.png";
// 2ème ligne
$tab=array();
$tab[1][0]= "interrogation.png";
$tab[1][1]= "interrogation.png";
$tab[1][2]= "interrogation.png";
// 3ème ligne
$tab=array();
$tab[2][0]= "interrogation.png";
$tab[2][1]= "interrogation.png";
$tab[2][2]= "interrogation.png";
fonction jouer_un_coup ($ligne, $colonne)
$ligne= 'nombre de ligne';
$colonne='nombre de colonne';
$case= 'nouvelle case';
fonction affichage_grille ($cachée, $visible)
$case=('cachée', 'visible');
$grille=('$tab','$case');
$vide= 'case vide';
$interrogation= 'interrogation';
if ($tab==cachée){
echo'$tab affiche $interrogation';
}
if ($tab==visible {
echo $tab affiche $vide;
}
else {
echo $tab affiche $piece;
}
$_SESSION['grille']='$grille';
$_SESSION['visibilité']=$visibilité;
fonction initialise_grille();
$rand_keys = array_rand($input,2);
$max = 3; // le nombre des images max!
$ext='png'; // l'extension des images
$path='images';// C'est le chemin d'accés des photos
$compteur=0; // On va incrementer!
while ($compteur<=2)
{
$compteur++;
$photo.='<div class="flaot_foto"><img src=".$path.'images'.mt_rand(1,$max).'.'.$ext.'"></div>';
}
?>
<html>
<header><h2> Cache-cash </h2>
<meta http-equiv="refresh" content="vide.png">
</header>
<body>
<table border="1" width="20%">
<tr>
<td><img src="images/interrogation"> </td> <td><img src="images/interrogation"> </td> <td> <img src="images/interrogation"></td>
</tr>
<tr>
<td> <img src="images/interrogation"></td> <td><img src="images/interrogation"> </td> <td> <img src="images/interrogation"></td>
</tr>
<tr>
<td> <img src="images/interrogation"> </td> <td> <img src="images/interrogation"></td> <td> <img src="images/interrogation"></td>
</tr>
</table>
</body>
</html> |