On-It Scoring Engine (work in progress) - current rules such as points ect are likely to change and become a lot more advanced this page will change when this happens.
This repository is where I work through different solutions for the scoring engine before implementing it in the back end of On-It, my fitness project. It is not yet connected to the On-It back end.
Users earn points for proactive actions that get them closer to their goal. Points are only awarded when the user logs the action.
There are three actions:
- Daily steps
- Gym visits
- Calorie and macro goals
Each action is stored in a struct with a type (what the user did) and a value (how much, or whether they did it). The user's goal is a separate input. If the logged value meets the goal, the user gets 10 points. Otherwise they get 0.
The three actions work in C++. Each one takes a goal and a logged value, then prints the points.
g++ main.cpp -o score
.\score
Enter the inputs in this order: calorie goal, calories logged, steps goal, steps logged, gym goal, gym visits logged.
- Refactor the three repeated blocks into one
pointsFor()function - Test edge cases
- Connect the engine to the On-It back end
My pseudocode, the blockers I hit, and how I solved them are in NOTES.md.