Generator

Objective

Create either a webpage that generates an entity at random. For example:

Requirements:

  • Basic understanding of Javascript.
  • A clear idea of what to generate.
  • A place to host your project (e.g. GitHub Repo or Glitch project or Replit equivalent)

Instructions

  1. Brainstorm and solidify your idea of a generator. Some key things to consider:
  • Is it a poem? Image? Sound? Keep in mind that images and sounds will involve more coding.
  • How many times can your generator work until it becomes repetitive. For example, a random number generator has infinite number of possibilities vs a random food generator is limited to your dataset.
  1. Create your Node project (if using Javascript) and get a boilerplate web server running. We want to make sure your webpage can at least say Hello World.
  2. Depending what you are generating, you may either need to create your own dataset or use an API to fetch for data. We suggest starting with a simple dataset like:
const dataset = ["banana", "apple", "cherry", "peach"]; // for generating a random fruit
  1. Come up with a strategy on how to randomize your generator. This is left open-ended for you research how to do this part. :)
  2. Output your generated result to your web page. Try changing the font! Maybe add a button for users to click to generate a new thing?
  3. Now make your generator more complex! Here are some ideas: