Skip to content

Advent Of Vue 2022's "Find Joseph's Gift" Starter + Solution

Notifications You must be signed in to change notification settings

Advent-Of-Vue/2022-find-josephs-gift

Repository files navigation

Advent Of Vue 2022

If you didn't get here from an email, read this section! Skip it otherwise.

Advent Of Vue is a series of 24 Vue coding challenges that are sent out every day from December 1 to December 24 via a dedicated newsletter. If you'd like to receive more of these puzzles in the future, go ahead and sign up!

Problem description

Joseph woke up on Christmas Eve and rushed to the living room to find and open his gift early. When he got there, he noticed something strange - all the gifts had their labels removed, with each box having an integer from 1 to n (1 < n <= 30) written on it instead. Joseph also found this note from Santa Claus:

Dear Joseph!

Opening your presents before everyone else is unfair! Since you're a first-time offender, you'll receive a light punishment, but please be more patient next year!

In order for you to find your present, you first need to discard the gift no. 2, then no. 4, and so on until there's only one box left. That should be your present.

Good luck!

Your task is to build an application that will visualise the whole elimination process based on n gifts in the circle. The app should allow the user to:

  • Specify that number and have the app display all the gifts from 1 to n in a grid.
  • Switch between each step via Previous step and Next step buttons, and warp to the first and last step using a First step and Last step buttons respecitvely.
  • Each eliminated box should appear more transparent (but not fully invisible) than the remaining ones.

Recording of an example solution

https://youtu.be/x-0PWov4okE

Author

Maciej Pędzich (Mac):

Credits

Based on a Stackblitz project by tony19

About

Advent Of Vue 2022's "Find Joseph's Gift" Starter + Solution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published