From 58f81c12b9d6b4239ce30a0ac61a7c7d49bd2615 Mon Sep 17 00:00:00 2001 From: Pamela Mackingue Date: Thu, 8 Feb 2024 11:27:25 -0500 Subject: [PATCH] uploading files to repo --- week-04/js/main.js | 20 ++++++++++++++++++++ week-04/tests.html | 14 ++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 week-04/js/main.js create mode 100644 week-04/tests.html diff --git a/week-04/js/main.js b/week-04/js/main.js new file mode 100644 index 0000000..df9bd66 --- /dev/null +++ b/week-04/js/main.js @@ -0,0 +1,20 @@ +import { Alert, Confirm, Prompt } from "./game-framework.js"; +/** + * Week 04 - Control Flow + */ + + + +// Modify the text for the introduction +await Alert('Welcome to my game. Answer questions and complete tasks to escape the room!') + +let name = await Prompt("What is your name?") + +// Level 1 +if(await Confirm(`Hi ${name}. Do you want to play the game?`)) { + await Alert('Great! Let\'s get started.') +} else { + await Alert('That\'s too bad. Maybe next time.') + window.location.reload() +} + diff --git a/week-04/tests.html b/week-04/tests.html new file mode 100644 index 0000000..ff4d720 --- /dev/null +++ b/week-04/tests.html @@ -0,0 +1,14 @@ + + + + + + Test Results + + + + + + \ No newline at end of file