Advent of code in Rust - solving year 2020 exercise 22 part 1 (Twitch Live 2021-11-15)

preview_player
Показать описание
In this episode, we started Advent of Code y2020 ex22 and we managed to complete part 1 (and reason a bit on how to implement part 2)!

This exercise wasn't particularly complicated and we basically needed to simulate a simple game of cards with 2 players and calculate a value based on the final deck of the winning player.

Part 2 will be much more complicated as we will need to make the game recursive!

In this episode, thanks to a few comments in the chat (thanks @tallevo!) we learned tha in rust it is possible to capture values from loops, which helped to make our code nicer.

Рекомендации по теме