Open twalker12 opened 7 years ago
Nice work on this, the code looks good and all the requirements have been met! :shipit:
No need to fix anything, but I do have a tip for future projects. Instead of this:
'What should you do next?' + 'Play in the sand' + ' ' + 'or' + ' ' + 'Run to class'
You can remove all of the ' + '
symbols and make one big string:
'What should you do next? Play in the sand or Run to class'
You did this for small strings, it totally works for long strings too. 😃
Write a short choose-your-own adventure game in JavaScript
@egillespie Can you take a look at this? It's hosted here and meets the following criteria:
prompt
andconfirm
functions (each at least once) to collect choices from the user (the entire story will take place in dialog boxes, so yourbody
element could actually be empty, apart from thescript
element to include your JavaScript)if
,else if
, andelse
to branch the story, based on user choicesMath.random()
&&
or||
) at least once, where it makes sensenull
/undefined
where appropriate