Source: Rucksack Reorganization
Part 1
Take a list of characters. For each line, split the line exactly in half and find the one character that’s in both halves. Assign a-z to values 1-26 and A-Z to 27-52. Sum these values.
Take a list of characters. For each line, split the line exactly in half and find the one character that’s in both halves. Assign a-z to values 1-26 and A-Z to 27-52. Sum these values.
Given a list of Rock Paper Scissors matches with A,B,C or X,Y,Z corresponding to those plays and scoring 1,2,3 points for your play plus 0,3,6 for a loss, draw, or win, what is your total score.
Let’s do this thing!
I’m going to try Rust this time, since it’s 1) awesome 2) fast and 3) crazy. :D
Let’s see how it goes!
If you’d like to see the full form of any particular solution, you can do so on GitHub (including previous years and possibly some I haven’t written up yet): jpverkamp/advent-of-code
Rust, yet again! Let’s take what we did last time with Solving Sudoku (again) and improve the code structure a bit more.
Goals:
If you’d like to follow along, I’ve started uploading the code here: https://github.com/jpverkamp/rust-solvers
More Rust! This time, I want to go back to my post on A Generic Brute Force Backtracking Solver. For one, because I’m learning Rust. For two, because there is a crate specifically for im
mutable data structures. And for three, because I expect it will be much faster. We shall see!
Another day, a slightly better way to implement Lunar Arithmetic in Rust. Give the previous post a read if you need a quick refresher on what Lunar integers are. Otherwise, here are two better (I hope) ways to solve the same problem.
I’ve been playing with various languages / language design a lot recently (inspired by my Runelang series). As I tweak and change what I’d like to implement in a language… I kept finding myself coming back to more or less exactly how Rust looks (albeit without the borrowing). So… that seems like a pretty good reason to start picking up some Rust.
In another thread of thought, I stumbled upon two OEIS (on-line encyclopedia of integer sequences) sequences: A087061: Array T(n,k) = lunar sum n+k (n >= 0, k >= 0) read by antidiagonals and A087062: Array T(n,k) = lunar product n*k (n >= 1, k >= 1) read by antidiagonals. Seemed like a fun bit of esoteric math to play with.