Skip to content

programming-club-knit/Habit-Tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍎 Habit Tree – Debugging Challenge

A small web app where checking habits grows fruits on a tree.
This version intentionally contains 3 bugs and 2 missing features for participants to fix.


🛠 Tech Used

  • HTML – Structure of the app
  • CSS – Styling, layout, animations
  • JavaScript (DOM Manipulation) – Habit logic, fruit rendering, score updates

🐞 Debugging Tasks (Fix These 3 Bugs)

1. Score Not Updating

The score does not change when habits are checked/unchecked.
Fix the missing score calculation & update logic.

2. Fruit Not Removed After Unchecking

Unchecking a habit should remove its fruit.
Fix incorrect fruit ID selection in removeFruit().

3. Multiple Fruits Added

A single checkbox adds multiple fruits.
Fix duplicate fruit creation logic.


⭐ Feature Tasks (Add These 2 Features)

Feature 1 — Reset Button

Add a button that:

  • Clears all habits
  • Removes all fruits
  • Resets score to 0

Feature 2 — Change Fruits When >50% Completed

When more than half of the habits are completed:

  • Change all apples to mangoes
    When below 50%:
  • Switch back to apples

Good luck debugging! 🚀

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 10