Zig's enum-switch pattern is awesome | Zig tutorial part 2
JustDjango
Hey everyone. This is the second video part of the zig series. This one is really cool because you'll get to see zig's enum-switch pattern (if that's even a name or a thing) - just something I really liked about solving this problem.
Code for this video: https://gist.github.com/mattfreire/45a8a5ef80ce4c7551c8c77d7d3a4c96
Professional Django developer courses: š https://justdjango.com
Thank you for watching and don't forget to subscribe :)
00:00 - Intro 00:05 - Reading the problem description from advent of code 04:56 - recap of how to read files 06:42 - tokenising and getting the encrypted moves 10:25 - Move and Result enums 12:53 - decrypting the moves 16:37 - handling all switch possibilities with errors 18:00 - debugging 20:04 - calculating the hand result 24:45 - calculate round score and hand score 30:00 - returning the solution ... https://www.youtube.com/watch?v=BYy2Y8K57XE
138297563 Bytes