Disneyland for procrastinators and lazy people.
This project is ideal for avoiding someone annoying. It takes no more than 20 lines of code and can save you for the rest of your life.
This project is designed as a first practical experience with JavaScript, focused on learning by doing. Through the creation of an excuse generator that runs in the console, students will work with a reduced amount of code, allowing them to focus on the fundamentals of the language without unnecessary distractions.
During the development of the project, key concepts such as the use of arrays, random data selection, and string construction will be reinforced. Due to its simplicity and playful nature, this exercise works as an excellent starting point for those beginning their journey as developers.
Additionally, the project introduces the use of Copilot as a development support tool. The goal is not just to obtain a functional program, but to learn how to guide the AI through clear and progressive instructions, understanding and validating each part of the generated code before moving on to the next step.
- Work step by step, following the indicated order.
- Do not request all the code in a single prompt.
- Read and understand the code before continuing to the next step.
- Run the project using Node.js.
- Print the final result in the console with
console.log.
Do not clone this repository because we are going to use a different template.
We recommend opening the excuses-generator-with-prompts repository using a development environment like Codespaces (recommended) or Gitpod. Alternatively, you can clone it on your local computer using the git clone command.
This is the repository you need to open or clone:
https://github.com/4GeeksAcademy/excuses-generator-with-prompts
👉 Please follow these steps on how to start a coding project.
- Ask Copilot to create a JavaScript file called
excuse-generator.js, prepared to run with Node.js.
- Ask Copilot to create an array called
whowith at least 4 possible subjects that can start an excuse.
- Ask Copilot to create an array called
actionwith past tense actions that can be part of an excuse.
- Ask Copilot to create an array called
whatwith objects or situations related to the excuse.
- Ask Copilot to create an array called
whenwith time references (for example: today, yesterday, this morning, etc.).
- Ask Copilot to generate a line of code to get a random value from the
whoarray. - Ask Copilot to generate a line of code to get a random value from the
actionarray. - Ask Copilot to generate a line of code to get a random value from the
whatarray. - Ask Copilot to generate a line of code to get a random value from the
whenarray. - Use
Math.random()andMath.floor()for random selection.
- Ask Copilot to concatenate the random values obtained into a single sentence.
- Store the resulting sentence in a variable called
excuse.
- Ask Copilot to print the value of the
excusevariable usingconsole.log.
Run the project from the terminal with the following command:
node excuse-generator.js