-
Notifications
You must be signed in to change notification settings - Fork 1
/
connect4.html
26 lines (23 loc) · 1.29 KB
/
connect4.html
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
<html>
<head><title>Connect Four</title>
<meta name=viewport content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/h5bp.css">
<script src="connect4.js"></script>
</head>
<body onload="init();">
<input type="button" value="Start" onclick="start();">
<input type="button" value="Stop" onclick="stop();">
<input type="button" value="Resume" onclick="resume();">
<span id="result"></span>
<br>
<canvas id="canvas" width="400" height="360"></canvas>
<h2>Purpose</h2>
<p>The goal of this assignment was to create a AI player (yellow) of the game Connect 4 and have it play against a player who moves randomly (red). For the AI player, we are using a minimax search to determine the best move by finding the move that will maximize the probability of a win, and minimize the probability of a loss.</p>
<h2>How it works</h2>
<p>The application uses two web workers to offload the processing of finding the next move away from the UI thread. This allows the browser to remain responsive, even though intense computations may be taking place. The status of the game is drawn on the screen using a canvas element. </p>
<footer>
Built by <a href="http://louisbourque.ca/">Louis Bourque</a>.
</footer>
</body>
</html>