Skip to content

Commit

Permalink
Add aircraft pack and caching (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
aelmekeev authored Mar 16, 2024
1 parent 7617fa5 commit 79032e6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ It appears that all the packs have unique cards in terms of stats, even the ones

Some packs contain cards that are identical in terms of stats, for example:
* McDonald's Minions: Rise of Gru - `Jean-Clawed` and `Svengeance`
* Carta Mundi's Aircraft - `Panavia Tornado ECR` and `Panavia Tornado IDS`

### Unusual stats

Expand Down
33 changes: 33 additions & 0 deletions packs/aircraft.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name;speed mph;range miles;engines;thrust/kN;length m;wingspan miles # https://ultimate-top-trumps.co.uk/england/carta_mundi/2002_2003/aircraft.html
Aermacci MB-339;560;1221;1;19;11.24;11.22
Aero L-59;544;1553;1;22;12.13;9.46
Airbus A310-300;561;6034;2;222;46.66;43.9
BAC Canberra;580;3630;2;34;19.95;19.5
Boeing C-17A Globemaster III;508;3225;4;186;53.04;50.29
Boeing E-3A Sentry;530;5033;4;93;46.61;44.42
Boeing F-15C Eagle;1518;3570;2;106;19.43;13.05
Boeing F/A-18C Hornet;1190;2254;2;79;17.07;11.43
Boeing KC-10A Extender;614;4992;3;234;55.47;50.42
Boeing KC-135R;536;5033;4;106;41;39.7
British Aerospace Hawk;621;1852;1;26;11.17;9.39
Dassault Mirage 2000N;1485;2287;1;95;14.36;9.13
Dassault Mirage F1CR;1463;2051;1;71;15;8.4
Dassault Rafale C;1320;2038;2;73;15.3;10.9
Dassault/Dornier Alpha Jet;572;1864;2;14;13.23;9.11
Eurofighter EF 2000 Typhoon;1255;2299;2;90;15.96;10.95
General Dynamics F-111C;1451;3165;2;82;22.4;19.20
Grumman EA-6B Prowler;599;2474;2;42;18.24;16.15
Iljushin II-76MF;528;3231;4;158;53.19;50.50
Lockheed C-5B Galaxy;571;6850;4;183;75.53;67.88
Lockheed F-16D Falcom;1333;2431;1;104;15.03;9.45
Lockheed S-3B Viking;506;3455;2;43;16.26;20.93
Lockheed SR-71 Blackbird;2001;2981;2;130;32.74;16.94
Lockheed U-2R;430;6245;1;76;19.03;31.39
MBB 320 ECM Hansa;513;1491;2;28;17.5;14.49
Northrop Grumman B-2A Spirit;628;8050;4;84;21.03;52.43
Panavia Tornado ECR;1317;3001;2;71;16.72;13.91
Panavia Tornado IDS;1317;3001;2;71;16.72;13.91
Rockwell B-1B;792;7457;4;137;44.81;41.67
Suchoi Su-24C Fencer;1439;2486;2;113;21.29;17.5
Suchoi Su-27M Flanker;1553;2;137;2486;21.9;14.7
Vickers VC10 K.Mk.2;640;4720;4;97;52.32;44.55
2 changes: 2 additions & 0 deletions top_trumps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import ArgumentParser
from functools import lru_cache
import glob
import random

Expand All @@ -16,6 +17,7 @@ def get_stat(self, index) -> float:
return self.stats[index]

# selects random stat if there are multiple stats with the same value
@lru_cache
def get_highest_stat_index(self, pack_stats) -> int:
stats_relative = [((self.stats[i] - pack_stats.min[i]) / (pack_stats.max[i] - pack_stats.min[i])) for i in range(len(self.stats))]
highest = max(stats_relative)
Expand Down

0 comments on commit 79032e6

Please sign in to comment.