Skip to content

Latest commit

 

History

History
69 lines (39 loc) · 2.2 KB

File metadata and controls

69 lines (39 loc) · 2.2 KB

Day 17 - Santa’s Lost Gift Dispatcher

_December 17, 2025 - Santa’s Lost Gift Dispatcher

snippet of the day

==> Loading Fractured Memory <==

On the 17th day, your fractured memory is bringing you right next to Santa's desk! And he is fuming! He is trying to figure out his code for the gift dispatcher.

He added tentative comments but the code looks obfuscated, recovered from decompiled code.

You need to help him solve that riddle.

He left you a business note to understand what the code was trying to do.

Challenge — Transform the code to make it usable.

Today, it's not strictly speaking a normal refactoring.

You are to work with bad obfuscated code and try to restore some understanding from it.

Hint: Use AI as a starting point and work your way from here.


Business Brief (from Santa)

I keep a list of how many units I have of each gift in the workshop, and a list of children with their wishlists (ordered by preference).
When I run the dispatcher, I tell it the maximum number of gifts per child.
It should then assign gifts to children in the order they were registered, trying wishlist items first and otherwise using any remaining stock, and return a list of which child received which gift.

That’s all Santa is sure about. Everything else is in decompiled code.


Where to play

For the exploration of the fractured memories, since they are not your own memories We will go to /exercises and the dayNN

You can then pick the stack you want to use as your main stack.

  • exercises/day17/<your-stack>/

This is your playground.


Share with the community

On Discord, you can share:

  • How did you proceed with the first version of the code?
  • Which AI did you use to help you and what kind of prompt?

If you want your work to be public, add your file to:

  • community/solutions/dayNN/ by copying the template:
    community/solutions/TEMPLATE-[replace_with_your_name].md
  • then open a pull request.

In journey/your-name.md, write a short entry for today:

  • How did you succeed in getting knowledge from such a bad code?
  • How could you apply that in your daily life?

Let's rebuild the dispatcher together. 🎅📦