fixes ia (working now)

master
Leo TUAILLON 2 years ago
parent 517c924351
commit 4007951502

@ -73,9 +73,10 @@ class AI {
return 0; return 0;
} }
if (depth >= this.level) { // Supprimer la vérification de la profondeur
return 0; // if (depth >= this.level) {
} // return 0;
// }
const opponent = 3 - this.player; const opponent = 3 - this.player;
const currentPlayer = maximizingPlayer ? this.player : opponent; const currentPlayer = maximizingPlayer ? this.player : opponent;

@ -91,4 +91,68 @@ h1{
#draw { #draw {
color: #FFFFFF; color: #FFFFFF;
display: none; display: none;
}
.close-button {
position: fixed;
top: 30px;
left: 40px;
width: 50px;
height: 50px;
cursor: pointer;
}
.close-button::before,
.close-button::after {
content: '';
position: absolute;
height: 30px;
width: 2px;
background-color: #FFFFFF;
transition: transform 0.3s;
}
.close-button::before {
transform-origin: center center;
transform: rotate(45deg);
}
.close-button::after {
transform-origin: center center;
transform: rotate(-45deg);
}
.close-button:hover::before {
transform: rotate(135deg);
}
.close-button:hover::after {
transform: rotate(-135deg);
}
.github-button {
display: inline-block;
padding: 10px 20px;
background-color: #1E2125;
color: #FFFFFF;
border: 2px solid #FFFFFF;
font-size: 16px;
cursor: pointer;
margin: 20px 5px;
text-decoration: none;
}
.github-button:hover {
background-color: #2C3036;
}
.footer {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
position: fixed;
bottom: 0;
left: 0;
} }

@ -7,7 +7,7 @@
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="style.css">
</head> </head>
<body> <body>
<div class="close-button" onclick="location.href='homepage.html';"></div>
<div class="container"> <div class="container">
<h1>Tic Tac Toe - AI</h1> <h1>Tic Tac Toe - AI</h1>
<div class="grid"> <div class="grid">
@ -28,6 +28,10 @@
<button id="reset">Reset</button> <button id="reset">Reset</button>
<button id="ai">Enable/Disable IA</button> <button id="ai">Enable/Disable IA</button>
</div> </div>
<div class="footer">
<a href="https://codefirst.iut.uca.fr/git/leo.tuaillon/AI_TicTacToe" target="_blank" class="github-button">Voir le code source Git</a>
</div>
<script src="script.js"></script> <script src="script.js"></script>
</body> </body>
</html> </html>

Loading…
Cancel
Save