my second commit

This commit is contained in:
Pierre Tellier
2024-04-20 14:07:05 +02:00
parent 547b5de903
commit 2d68715003
11 changed files with 708 additions and 0 deletions

183
src/player.html Normal file
View File

@ -0,0 +1,183 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!--<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">-->
<link rel="stylesheet" href="../bootstrap.min.css">
<link rel="stylesheet" href="./style.css">
<script src="index.ts" type="module"></script>
<script src="moooove.ts" type="module"></script>
<title>Carcassonne Viewer</title>
</head>
<body>
<div class="container-fluid bg-light">
<h1 id="title">Carcassonne viewer</h1>
<div class="row">
<div class="col-lg-3 sidebar">
<ul class="list-group" id="games_list">
</ul>
</div>
<div class="col-lg-9">
<div id="game_container" class="row">
</div>
<div class="row viewer_controls">
<div class="col-lg-2"></div>
<div class="btn-group col-lg-8" role="group" aria-label="Basic example">
<button type="button" class="btn btn-secondary" id="prevGameButton">|&lt;<&lt;</button>
<button type="button" class="btn btn-secondary" id="firstMoveButton">|&lt;&lt;</button>
<button type="button" class="btn btn-secondary" id="prevMoveButton">&lt;</button>
<button type="button" class="btn btn-secondary" id="nextMoveButton">&gt;</button>
<button type="button" class="btn btn-secondary" id="lastMoveButton">&gt;&gt;|</button>
<button type="button" class="btn btn-secondary" id="nextGameButton">>>>|</button>
</div>
<div class="col-lg-2"></div>
</div>
<table class="table table-striped table-sm" style="text-align: left; width: 100%">
<tbody>
<tr>
<th scope="row" style="width: 15%">Player 0</th>
<td id="player0_disp">player0</td>
</tr>
<tr>
<th scope="row">Player 1</th>
<td id="player1_disp">player1</td>
</tr>
<tr>
<th scope="row">Seed</th>
<td id="seed_disp">uéuéuéu</td>
</tr>
<tr>
<th scope="row">Winner</th>
<td id="winner_disp">winner</td>
</tr>
<tr>
<th scope="row">Cause</th>
<td id="cause_disp">cause</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="games">
<div id="board" class="board">
<div class=gridLine id="line0">
<div class="gridTile tile0"></div>
</div>
</div>
</div>
<div id="jsonData">
<pre>[
{
"seed": 1881916104,
"player0": "Teisipyte",
"player1": "Teisipyte",
"moves": [ { "id": 4294967295, "x": 0, "y": 0 }, { "id": 0, "x": -1, "y": 0 }, { "id": 1, "x": -1, "y": 1 }, { "id": 0, "x": -2, "y": 1 }, { "id": 1, "x": -1, "y": 2 }, { "id": 0, "x": -3, "y": 1 }, { "id": 1, "x": -3, "y": 0 } ],
"winner": "??",
"cause": "Maximal number of moves reached (7), game is a draw"
}
,
{
"seed": 2130915275,
"player0": "Hippolyte",
"player1": "Full random player",
"moves": [ { "id": 4294967295, "x": 0, "y": 0 }, { "id": 0, "x": 1, "y": 0 }, { "id": 1, "x": 8, "y": 4 }, { "id": 0, "x": 0, "y": -1 }, { "id": 1, "x": 8, "y": 8 }, { "id": 0, "x": 0, "y": -2 }, { "id": 1, "x": 2, "y": 0 } ],
"winner": "??",
"cause": "Maximal number of moves reached (7), game is a draw"
}
,
{
"seed": 2130915275,
"player0": "Full random player",
"player1": "Hippolyte",
"moves": [ { "id": 4294967295, "x": 0, "y": 0 }, { "id": 0, "x": 4, "y": 8 }, { "id": 1, "x": 4, "y": 7 }, { "id": 0, "x": 6, "y": 8 }, { "id": 1, "x": 4, "y": 6 }, { "id": 0, "x": 3, "y": 2 }, { "id": 1, "x": 2, "y": 2 } ],
"winner": "??",
"cause": "Maximal number of moves reached (7), game is a draw"
}
,
{
"seed": 2130915275,
"player0": "Hippolyte",
"player1": "Full random player",
"moves": [ { "id": 4294967295, "x": 0, "y": 0 }, { "id": 0, "x": 1, "y": 0 }, { "id": 1, "x": 8, "y": 4 }, { "id": 0, "x": 0, "y": -1 }, { "id": 1, "x": 8, "y": 8 }, { "id": 0, "x": 0, "y": -2 }, { "id": 1, "x": 2, "y": 0 } ],
"winner": "??",
"cause": "Maximal number of moves reached (7), game is a draw"
}
,
{
"seed": 2130915275,
"player0": "Full random player",
"player1": "Hippolyte",
"moves": [ { "id": 4294967295, "x": 0, "y": 0 }, { "id": 0, "x": 4, "y": 8 }, { "id": 1, "x": 4, "y": 7 }, { "id": 0, "x": 6, "y": 8 }, { "id": 1, "x": 4, "y": 6 }, { "id": 0, "x": 3, "y": 2 }, { "id": 1, "x": 2, "y": 2 } ],
"winner": "??",
"cause": "Maximal number of moves reached (7), game is a draw"
}
,
{
"seed": 3336162595,
"player0": "Androdameia",
"player1": "Phoebe",
"moves": [ { "id": 4294967295, "x": 0, "y": 0 }, { "id": 0, "x": -1, "y": 0 }, { "id": 1, "x": -2, "y": 0 }, { "id": 0, "x": 0, "y": -1 }, { "id": 1, "x": 1, "y": 0 }, { "id": 0, "x": 0, "y": -2 }, { "id": 1, "x": -1, "y": -2 } ],
"winner": "Phoebe",
"cause": "Victory on points for player Phoebe"
}
,
{
"seed": 1127192704,
"player0": "Androdameia",
"player1": "Full random player",
"moves": [ { "id": 4294967295, "x": 0, "y": 0 }, { "id": 0, "x": -1, "y": 0 }, { "id": 1, "x": 9, "y": 5 }, { "id": 0, "x": 9, "y": 6 }, { "id": 1, "x": 0, "y": 7 }, { "id": 0, "x": 9, "y": 7 }, { "id": 1, "x": 3, "y": 0 } ],
"winner": "??",
"cause": "Maximal number of moves reached (7), game is a draw"
}
,
{
"seed": 1127192704,
"player0": "Full random player",
"player1": "Androdameia",
"moves": [ { "id": 4294967295, "x": 0, "y": 0 }, { "id": 0, "x": 1, "y": 9 }, { "id": 1, "x": 2, "y": 9 }, { "id": 0, "x": 9, "y": 0 }, { "id": 1, "x": 1, "y": 8 }, { "id": 0, "x": 0, "y": 3 }, { "id": 1, "x": 2, "y": 10 } ],
"winner": "Androdameia",
"cause": "Victory on points for player Androdameia"
}
,
{
"seed": 1127192704,
"player0": "Androdameia",
"player1": "Full random player",
"moves": [ { "id": 4294967295, "x": 0, "y": 0 }, { "id": 0, "x": -1, "y": 0 }, { "id": 1, "x": 9, "y": 5 }, { "id": 0, "x": 9, "y": 6 }, { "id": 1, "x": 0, "y": 7 }, { "id": 0, "x": 9, "y": 7 }, { "id": 1, "x": 3, "y": 0 } ],
"winner": "??",
"cause": "Maximal number of moves reached (7), game is a draw"
}
,
{
"seed": 1127192704,
"player0": "Full random player",
"player1": "Androdameia",
"moves": [ { "id": 4294967295, "x": 0, "y": 0 }, { "id": 0, "x": 1, "y": 9 }, { "id": 1, "x": 2, "y": 9 }, { "id": 0, "x": 9, "y": 0 }, { "id": 1, "x": 1, "y": 8 }, { "id": 0, "x": 0, "y": 3 }, { "id": 1, "x": 2, "y": 10 } ],
"winner": "Androdameia",
"cause": "Victory on points for player Androdameia"
}
]
</pre>
</div>
<div id="error_box" style="display: none">
</div>
<div id="errors" style="background-color: #fee; display: visible">
<pre style="white-space: break-spaces">[
]</pre>
</div>
</body>
</html>