fix naming
This commit is contained in:
parent
332d1bcecd
commit
38f49859dc
|
@ -1,7 +1,7 @@
|
|||
use aoc_runner_derive::{aoc, aoc_generator};
|
||||
|
||||
#[aoc_generator(day1)]
|
||||
fn day1_generator(s: &str) -> Vec<Vec<u32>> {
|
||||
fn generator(s: &str) -> Vec<Vec<u32>> {
|
||||
let mut iter = s.lines();
|
||||
|
||||
let mut res = Vec::new();
|
||||
|
@ -25,12 +25,12 @@ fn day1_generator(s: &str) -> Vec<Vec<u32>> {
|
|||
}
|
||||
|
||||
#[aoc(day1, part1)]
|
||||
fn day1_part1(input: &[Vec<u32>]) -> u32 {
|
||||
fn part1(input: &[Vec<u32>]) -> u32 {
|
||||
input.iter().map(|v| v.iter().sum()).max().unwrap()
|
||||
}
|
||||
|
||||
#[aoc(day1, part2)]
|
||||
fn day1_part2(input: &[Vec<u32>]) -> u32 {
|
||||
fn part2(input: &[Vec<u32>]) -> u32 {
|
||||
let mut res = (0, 0, 0);
|
||||
for mut item in input.iter().map(|v| v.iter().sum()) {
|
||||
if res.0 < item {
|
||||
|
|
|
@ -60,7 +60,7 @@ impl Rps {
|
|||
}
|
||||
|
||||
#[aoc_generator(day2)]
|
||||
fn day1_generator(s: &str) -> Vec<(Rps, Xyz)> {
|
||||
fn generator(s: &str) -> Vec<(Rps, Xyz)> {
|
||||
s.lines()
|
||||
.map(|l| {
|
||||
(
|
||||
|
@ -82,7 +82,7 @@ fn day1_generator(s: &str) -> Vec<(Rps, Xyz)> {
|
|||
}
|
||||
|
||||
#[aoc(day2, part1)]
|
||||
fn day1_part1(input: &[(Rps, Xyz)]) -> u32 {
|
||||
fn part1(input: &[(Rps, Xyz)]) -> u32 {
|
||||
input
|
||||
.iter()
|
||||
.map(|&(opp, me)| me.to_rps().score_against(opp))
|
||||
|
@ -90,7 +90,7 @@ fn day1_part1(input: &[(Rps, Xyz)]) -> u32 {
|
|||
}
|
||||
|
||||
#[aoc(day2, part2)]
|
||||
fn day1_part2(input: &[(Rps, Xyz)]) -> u32 {
|
||||
fn part2(input: &[(Rps, Xyz)]) -> u32 {
|
||||
input
|
||||
.iter()
|
||||
.map(|&(opp, target_xyz)| target_xyz.part_two_stuff(opp))
|
||||
|
|
Loading…
Reference in a new issue