-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
72 lines (69 loc) · 3.37 KB
/
index.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Prisoners Dilemma</title>
<link rel="stylesheet" href="styles/style.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap">
<!--In the <head>-->
<script src="https://cdn.jsdelivr.net/gh/WebCoder49/[email protected]/code-input.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/WebCoder49/[email protected]/code-input.min.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/themes/prism.css">
<script src="https://unpkg.com/[email protected]/prism.js"></script>
<script src="scripts/brain.js"></script>
<script src="scripts/being.js"></script>
<script src="scripts/utils.js"></script>
<script src="scripts/human.js"></script>
<script src="scripts/plugins/auto-close-brackets.js"></script>
<script src="scripts/plugins/indent.js"></script>
<script defer src="scripts/design.js"></script>
<script defer src="scripts/index.js"></script>
</head>
<body>
<div class="container mb-1 d-inline-flex p-2 justify-content-evenly" style="max-width: 90vw;">
<button class="btn btn-primary" id="nextGeneration">Simulate 1 Generation</button>
<div class="p-2">Current Generation: <span id="generation">0</span></div>
<button class="btn btn-primary" id="run10gen">Start Simulation</button>
<button class="btn btn-primary" id="import">Import</button>
<button class="btn btn-primary" id="export">Export</button>
</div>
<div style="height: 400px; width: 90vw; margin: auto;">
<code-input class="custom-logc" template="syntax-highlighted" language="javascript" id="custom-logic">/**
* @param {{us: Action; them: Action}[]} beingHistory
* @param {{COOPERATE: symbol; DEFECT: symbol}} Action
* @returns {Action}
*/
function decide(beingHistory, Action) {
// Your logic goes here
// Sample code
if (beingHistory.length > 0) return beingHistory[beingHistory.length - 1].them;
else return Action.COOPERATE;
}</code-input>
<button class="btn btn-primary mb-0" id="update-logic">Update</button>
</div>
<div class="container" style="max-width: 90vw;">
<div class="row">
<div class="col-sm-4 d-flex align-items-center">
<canvas id="morality-line"></canvas>
</div>
<div class="col-sm-4 d-flex align-items-center">
<canvas id="population-scatter"></canvas>
</div>
<div class="col-sm-4 d-flex align-items-center">
<canvas id="being-morality-score"></canvas>
</div>
<div class="col-sm-4 d-flex align-items-center">
<canvas id='network-line'></canvas>
</div>
<div class="col-sm-4 d-flex align-items-center">
<canvas id='network-score-line'></canvas>
</div>
</div>
</div>
</body>
</html>