From 78fb7fafb82e731270616378975f0bc2f4ce3ed9 Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Wed, 12 Apr 2023 12:51:10 +0200 Subject: [PATCH] Fix module import in html file --- game.html | 12 +++++++----- game.js | 6 ++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/game.html b/game.html index a4a9d21..10a2a17 100644 --- a/game.html +++ b/game.html @@ -51,9 +51,9 @@ cpu score: ?
- +
- + @@ -62,10 +62,12 @@ Processor icons created by kerismaker - Flaticon --> + \ No newline at end of file diff --git a/game.js b/game.js index af8e2c7..7bc35be 100644 --- a/game.js +++ b/game.js @@ -4,7 +4,7 @@ var cpuList; var currentCpu; var nextCpu; -async function main() { +export async function main() { await fetch('./data.json') .then((response) => response.json()) .then((json) => cpuList = json); @@ -65,6 +65,4 @@ function getRandomInt(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min) + min); // The maximum is exclusive and the minimum is inclusive -} - -main(); \ No newline at end of file +} \ No newline at end of file