-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
52 lines (39 loc) · 1.55 KB
/
index.php
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
<?php
session_start();
function __autoload($classe){
$filename="./".$classe.".php";
include $filename;
}
include "head.html";
include "header.html";
if (!isset($_SESSION['mm'])) {
$_SESSION['mm'] = new MasterMind();
$mm = $_SESSION['mm'];
}else{
$mm = $_SESSION['mm'];
if(isset($_POST['0']) && !$mm->finPartie()){
$cmm = new CombiMM($_POST['0'],$_POST['1'],$_POST['2'],$_POST['3']);
$mm->ajouterProposition($cmm);
$mm->evalueDerniereProposition();
}/*else{
if($mm->finPartie()){
if($mm->isPropositionGagnante()){
echo "<script>alert(\"Vous avez gagné, félicitation ! :-)</br>Cliquez sur le bouton \"Recommencer\" pour lancer une nouvelle partie ! ;-)\")</script>";
} else{
echo "<script>alert(\"HAHA ! Une prochaine fois peut-être ! :-D</br>Cliquez sur le bouton \"Recommencer\" pour lancer une nouvelle partie ! ;-)\")</script>";
}
}
}*/
if($mm->finPartie()){
if($mm->isPropositionGagnante()){
echo "<script>alert(\"Vous avez gagné, félicitation ! :-)\")</script>";
} else{
echo "<script>alert(\"Dommage ! Une prochaine fois peut-être ! :-(\")</script>";
}
}
}
$mmui = new MM_UI($mm);
echo $mmui->getDivHistorique();
echo $mmui->getDivFormulaire();
include "footer.html";
?>