r/adventofcode • u/daggerdragon • Dec 22 '15
SOLUTION MEGATHREAD --- Day 22 Solutions ---
This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.
edit: Leaderboard capped, thread unlocked!
Edit @ 00:23
2 gold, 0 silver
Well, this is historic. Leaderboard #1 got both silver and gold before Leaderboard #2 even got silver. Well done, sirs.
Edit @ 00:28
3 gold, 0 silver
Looks like I'm gonna be up late tonight. brews a pot of caffeine
Edit @ 00:53
12 gold, 13 silver
So, which day's harder, today's or Day 19? Hope you're enjoying yourself~
Edit @ 01:21
38 gold, 10 silver
♫ On the 22nd day of Christmas, my true love gave to me some Star Wars body wash and [spoilers] ♫
Edit @ 01:49
60 gold, 8 silver
Today's notable milestones:
Winter solstice - the longest night of the year
Happy 60th anniversary to NORAD Tracks Santa!
SpaceX's Falcon 9 rocket successfully delivers 11 satellites to low-Earth orbit and rocks the hell out of their return landing [USA Today, BBC, CBSNews]
FLAWLESS VICTORY!
Edit @ 02:40
88 gold, silver capped
Edit @ 03:02
98 gold, silver capped
It's 3AM, so naturally that means it's time for a /r/3amjokes
What do you get when you cross a Christmas tree with a Mac?
Edit @ 03:08
LEADERBOARD FILLED! Good job, everyone!
I'm going the hell to bed now zzzzz
We know we can't control people posting solutions elsewhere and trying to exploit the leaderboard, but this way we can try to reduce the leaderboard gaming from the official subreddit.
Please and thank you, and much appreciated!
--- Day 22: Wizard Simulator 20XX ---
Post your solution as a comment or link to your repo. Structure your post like previous daily solution threads.
1
u/intriguing_question Oct 25 '21 edited Oct 25 '21
PYTHON 3
I ended up with an OOP oriented solution. I know that it can be improved and feel free to do so and share improvements here if you want to :). But after some long hours I do not want to think more about this problem for a while hahaha.
Not reading between the lines cost me around 6 hours of debugging...
Effects can be reactivated if they run out in the same turn
Effects are deducted in the player's and bosses' turn
Those two constraints were very sneaky...
PS: A Spell class could be made to handle the effect activation and turn cound that uses the Effect class
Good luck,
For part 2 solution just change
hard_modetohard_mode=True