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

Subscribers:
950
Published on ● Video Link: https://www.youtube.com/watch?v=7YkD9Y7jZvg



Duration: 1:11:50
17 views
2


In this episode, we completed Advent of Code y2020 ex22!

In this exercise we 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 got more complicated by introducing some new rules that made the game recursive!

Our solution, although correct, seems quite slow, to the point that we initially thought we had an infinite loop. So there's definitely room for optimisation (probably reducing a few clones and figuring out a smarter way to keep track of the history).

If you have any suggestion, we'd love to hear it, so please leave a comment or a create a PR!

For all the source code check out the official GitHub repo: https://github.com/lmammino/rust-advent

For seeing the next episodes live check out our Twitch channel: https://twitch.tv/loige




Other Videos By Luciano Mammino (loige)


2022-02-21Advent of code in Rust SPECIAL - solving day 6/2021 on a RASPBERRY PICO (Twitch Live 2022-02-21)
2022-02-14Advent of code in Rust - solving day 6/2021 (Twitch Live 2022-02-14)
2022-02-07Advent of code in Rust - solving day 5/2021 (Twitch Live 2022-02-07)
2022-01-31Advent of code in Rust - solving day 4/2021 (Twitch Live 2022-01-31)
2022-01-24Advent of code in Rust - solving day 3/2021 (Twitch Live 2022-01-24)
2022-01-17Advent of code in Rust - solving day 2/2021 (Twitch Live 2022-01-17)
2022-01-10Advent of code in Rust - solving day 25/2020 & day 1/2021 (Twitch Live 2022-01-10)
2021-12-13Advent of code in Rust - solving year 2020 exercise 24 part 1 (Twitch Live 2021-12-13)
2021-12-07Advent of code in Rust - solving year 2020 exercise 23 part 2 (Twitch Live 2021-12-06)
2021-11-29Advent of code in Rust - solving year 2020 exercise 23 part 1 (Twitch Live 2021-11-29)
2021-11-22Advent of code in Rust - solving year 2020 exercise 22 part 2 (Twitch Live 2021-11-22)
2021-11-15Advent of code in Rust - solving year 2020 exercise 22 part 1 (Twitch Live 2021-11-15)
2021-11-08Advent of code in Rust - solving year 2020 exercise 21 (Twitch Live 2021-11-08)
2021-11-01Advent of code in Rust - solving year 2020 exercise 20 p2 THIRD ATTEMPT (Twitch Live 2021-11-01)
2021-10-27Advent of code in Rust - solving year 2020 exercise 20 p2 SECOND ATTEMPT (Twitch Live 2021-10-26)
2021-10-26Advent of code in Rust - solving year 2020 exercise 20 p2 FIRST ATTEMPT (Twitch Live 2021-10-25)
2021-10-19Advent of code in Rust - solving year 2020 exercise 20 p1(Twitch Live 2021-10-18)
2021-10-12Advent of code in Rust - solving year 2020 exercise 19 p1 & p2 (ALMOST) (Twitch Live 2021-10-11)
2021-09-27Advent of code in Rust - solving year 2020 exercise 19 p1 (Twitch Live 2021-09-27)
2021-09-20Advent of code in Rust - solving year 2020 exercise 18 p2 (Twitch Live 2021-09-20)
2021-09-14Advent of code in Rust - solving year 2020 exercise 18 p1 (Twitch Live 2021-09-13)



Tags:
rust
rustlang
learning rust
advent of code
advent of code in rust
aoc
2020
day 22
exercise 22
year 2020
live coding
live streaming
twitch
in real life
IRL
pair programming
mob programming
coding challenge