Challenge Overview
Problem Description
Help Cody write a diet-planner to stay Lean and Agile without too much bloat! In this challenge, we will help Cody by creating a web-app to optimize meal-planning. Given a list of food items and some constraints, we will need to calculate a good meal plan.
Easy
In this task, we will warm up by creating a simple one-page app to sort food items by their yumminess.
A food items contains three characteristics: 1) name 2) calorie count and 3) yumminess.
In this challenge, we learn how to input and sort food items by their yummyness. If two foods have the same yummy value, the highest calorie one is chosen first.
Technical spec
- Serve a web page at port 8080 at /
- The page must contain the following
- A div with id "mainContainer"
- A div with id "inputContainer"
- Within inputContainer:
- an input of type text with id "foodName"
- an input of type text with id "calorieCount"
- an input of type text with id "yummy"
- an input of type button with if "addButton" and value "Click me!"
- A div with id "listContainer"
- When the user writes into the input containers and clicks the addButton:
- The food item appears on its own line within the listContainer
- listContainer lists the input lines in a sorted manner, with the yummiest first.
Printing foods
The foods should be printed in the format
donut, 100 calories, 200 yummyness
that is
$foodName, $calorieCount calories, $yummy yummyness
- one per line.
Refreshing the page should reset the output contents.
Technology Stack
- Programming language: No limitation
- Docker
Sample submissions and tester
Feel free to use the sample servers in this repository as a starting point for your submission.
Submission Deliverables
Submit a zip file. Inside the zip file, there needs to be a folder name code. Inside the code folder, you need to have a Dockerfile which we will use to build the image and start your application by starting a container using the image. The code folder can contain other folders and files but it needs to contain the Dockerfile. The zip file too can contain other folders and files, but it needs to have the code folder at the ROOT.
Constraints & Guidelines
- Please use the forums to ask any questions.
- Minimal code quality is expected for the reviewer to review the submission and go through your code
- Obvious and deliberate code obfuscation will be rejected.
- Collaborating/Cheating in any way with anyone else (member or not) during a rated event is considered cheating.
- An excessive amount of unused content should be avoided.