Python Discord is doing an event called Revival of Code, where we work through the 2016 Advent of Code, one challenge every two days. The day 8 challenge, Two-Factor Authentication, processing a set of instructions that manipulate pixels on a 50x6 screen. I'll need to rotate both rows and columns, as well as turn on blocks. At the end, I'll show a fancy automation of the full application.
Repo for Advent of Code 2016 Solutions: https://gitlab.com/0xdf/aoc2016
Intro video for this event: • Introduction [Revival of Code 2023 - ...
Real Python post with templates: https://realpython.com/python-advent-...
Python regex: https://pypi.org/project/regex/
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[00:34] Challenge Part 1
[01:46] genday.sh / input
[02:10] Setting up test fixture
[02:56] test_parse
[05:01] Screen class and _init_
[09:00] Tests for screen tracking
[10:03] Creating screen with deques
[13:25] Tests for Part 1
[14:37] Reorganizing main
[15:15] pixels_on function
[16:41] run function
[18:01] Processing Rect instruction
[22:12] rotate functions
[24:10] Solving Part 1
[24:29] Challenge Part 2
[24:44] to_string function
[25:21] to_string tests (oops!)
[27:15] Finishing to_string
[28:14] Solving Part 2
[29:02] Fancy Animation!
#ctf #adventofcode #revivalofcode #python
Смотрите видео Day 8 - Two-Factor Authentication [Revival of Code 2023 - Advent of Code 2016] онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь 0xdf 08 Июль 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 350 раз и оно понравилось 13 людям.