Files
  • index.html
  • script.js
  • style.css
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
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>Industrial Revolution Stocks!</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
    <link href="static/style.css" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <div class="container">
    <div class="jumbotron text-center">
    You've reached the end of the revolution, let's see how well you did!
    </div>
    <table class="table">
  <thead>
    <tr>
      <th scope="col">#</th>
      <th scope="col">Name</th>
      <th scope="col">Value</th>
      <th scope="col">Total</th>
    </tr>
  </thead>
  <tbody>
    {% for i, (stock, amount) in enumerate(game.owned_shares.items()) %}
    <tr>
      <th scope="row">{{ i + 1 }}</tr>
      <td>{{ stock.name }}</td>
      <td>{{ stock.get_price(game.game_index) }}£</td>
      <td>{{ stock.get_price(game.game_index) * amount }}£</td>
    </tr>
    {% endfor %}
  </tbody>
</table>
    <h3>(Your money) {{ game.player_money }}£ + (Stock Value) {{ game.get_total_value() }}£ = {{ game.player_money + game.get_total_value() }}</h2> 
    <p class="text-center">I hope you enjoyed the game, if you would like to play again, <a href="new_game">click here</a>.</p>
    </div>
    <script src="static/script.js"></script>
  </body>
</html>
result
console