Advent of Code 2022 - Day 2

This is a thread to discuss Day 2

https://adventofcode.com/2022/day/2

REMEMBER!
It is VERY important NOT to write any public spoilers :slight_smile:
ALWAYS keep spoiler stuff hidden inside one of these

Summary

This text will be hidden

which you can obtain by clicking on the gear icon

image

I seem to have made some little mistook somewhere :frowning:

My answer to part 1 is too high :frowning:

I think I'll go and make a cup of coffee and then come back and see if I can spot it!
[edit at 10:05 - I've woken up now and properly implemented the scoring :grin: ]

Part 1


And now I'm getting very mixed up with part 2 :laughing:
[edit - turns out I just got a bit too much slap dash with my copy and pasting - all good now :slight_smile: ]

Part 2

Part 1


Part 2


My project

Snap! Build Your Own Blocks

Looks nice and neat :slight_smile:

thanks

is this entire event just data management

Copying and pasting is a good marker of needing a procedure that does the common task!

Part1

advent of code-2022-day2-part1

Part2

project

Yes, it's a good way to improve your skill with list and HOF functions. Try the 1st week (that's escalated quickly!)

If you can't figure out how to implement an HOF function in a problem, use the for each block and try to solve the problem.