Generator
Objective
Create either a webpage that generates an entity at random. For example:
- A webpage that generates a random UK-specialty food
- Rap name generator
- A webpage that generates a unique act of kindness
- Generate a random and unique quilt pattern
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
- 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.
- 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
. - 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
- Come up with a strategy on how to randomize your generator. This is left open-ended for you research how to do this part. :)
- 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?
- Now make your generator more complex! Here are some ideas:
- Need to rhyme words together? Look up an API that helps you generate rhyming words!
- Let a user input words/image and generate something from that input. Check out this tutorial on how to analyze sentiment in a Node.js application