- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Spaceship operator - Day 07 - Advent of Code 2023
This video tackles the "Camel Cards" poker puzzle. We’ll parse the input data into Hand objects, modeling ranks, and bids. We can sort hands by type and strength by including the Comparable module and implementing spaceship logic.
For part 1, we’ll build a card counter and hand typing system, assigning numeric ranks. This lets us multiply bids by position to get total winnings. For part 2's joker rules, we’ll tweak the ranks and add joker offset logic to promote hands.
The core solution focuses on custom classes and comparable spaceships for sorting. I polish with enumerable pipelines for a concise answer. While not golf code, we end up with readable Ruby leveraging objects, sorting, and clever tricks.
Advent of Code: https://adventofcode.com/
My Solutions: https://gist.github.com/cjavdev/d15a2a4ffed6c840c2fb28a093e9f927/
Playlist https://www.youtube.com/playlist?list=PLS6F722u-R6KYlGyUv65EFpGKl2Esmurr
#adventofcode #ruby
Видео Spaceship operator - Day 07 - Advent of Code 2023 канала CJ Avilla (cjav_dev)
For part 1, we’ll build a card counter and hand typing system, assigning numeric ranks. This lets us multiply bids by position to get total winnings. For part 2's joker rules, we’ll tweak the ranks and add joker offset logic to promote hands.
The core solution focuses on custom classes and comparable spaceships for sorting. I polish with enumerable pipelines for a concise answer. While not golf code, we end up with readable Ruby leveraging objects, sorting, and clever tricks.
Advent of Code: https://adventofcode.com/
My Solutions: https://gist.github.com/cjavdev/d15a2a4ffed6c840c2fb28a093e9f927/
Playlist https://www.youtube.com/playlist?list=PLS6F722u-R6KYlGyUv65EFpGKl2Esmurr
#adventofcode #ruby
Видео Spaceship operator - Day 07 - Advent of Code 2023 канала CJ Avilla (cjav_dev)
cjav_dev Learn to code Beginner ruby Advent of code Advent of code 2023 Advent of code ruby Aoc ruby Aoc 2023 Vim Advent of code vim Advent of code explainer Advent of code challenge Code challenge Advent of code tutorial Web development tutorial comparable spaceship space ship space ship operator rocket ship operator rocket ship
Комментарии отсутствуют
Информация о видео
7 декабря 2023 г. 23:00:29
00:25:43
Другие видео канала











![[Livestream] building a sand pile visualization with p5.js](https://i.ytimg.com/vi/iJ_dbJlj42A/default.jpg)


![[live] working on Stripe Samples open source for Stripe Connect](https://i.ytimg.com/vi/7gcxUFQppXk/default.jpg)





