Skip to content

Commit 0a2809e

Browse files
committed
chore: renamed folders
1 parent 88f99a3 commit 0a2809e

File tree

18 files changed

+34
-20
lines changed

18 files changed

+34
-20
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33

44
## Progress:
55

6-
- [Day 1](https://github.com/ankjevel/adventofcode/tree/2019/day01) 🌟 🌟
7-
- [Day 2](https://github.com/ankjevel/adventofcode/tree/2019/day02) 🌟 🌟
6+
- [Day 1](https://github.com/ankjevel/adventofcode/tree/2019/day_01) 🌟 🌟
7+
- [Day 2](https://github.com/ankjevel/adventofcode/tree/2019/day_02) 🌟 🌟
8+
- [Day 3](https://github.com/ankjevel/adventofcode/tree/2019/day_03) 🌟 🌟
9+
- [Day 4](https://github.com/ankjevel/adventofcode/tree/2019/day_04) 🌟 🌟

day01/src/part_01.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

day_01/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "day01"
3+
version = "0.1.0"
4+
authors = ["Dennis Pettersson <mail@dennispettersson.se>"]
5+
6+
[dependencies]

day01/src/main.rs renamed to day_01/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ fn main() -> io::Result<()> {
99
let part_01_fuel = part_01::main(&input).unwrap().iter().sum::<i32>();
1010
let part_02_sum_of_fuel = part_02::main(&input).unwrap();
1111

12-
println!("part 1; fuel: {}", part_01_fuel);
13-
println!("part 2; sum: {}", part_02_sum_of_fuel);
12+
println!("part 1: {}", part_01_fuel);
13+
println!("part 2: {}", part_02_sum_of_fuel);
1414

1515
Ok(())
1616
}

day_01/src/part_01.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
use std::io;
2+
3+
pub fn main(input: &Vec<i32>) -> io::Result<Vec<i32>> {
4+
Ok(input.iter()
5+
.map(|&mass| ((mass.clone() as f64 / 3.0).floor() as i32) - 2)
6+
.collect())
7+
}
File renamed without changes.

day02/Cargo.toml renamed to day_02/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22
name = "day02"
33
version = "0.1.0"
44
authors = ["Dennis Pettersson <mail@dennispettersson.se>"]
5-
edition = "2018"
6-
7-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
85

96
[dependencies]
File renamed without changes.

day03/Cargo.toml renamed to day_03/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22
name = "day03"
33
version = "0.1.0"
44
authors = ["Dennis Pettersson <mail@dennispettersson.se>"]
5-
edition = "2018"
6-
7-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
85

96
[dependencies]

day03/src/main.rs renamed to day_03/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pub use structs::Point;
1717
fn main() -> Result<()> {
1818
let wires = parse_input(include_str!("../../input/day_03"));
1919

20-
println!("part_01: {:?}", part_01(&wires).unwrap());
21-
println!("part_02: {:?}", part_02(&wires).unwrap());
20+
println!("part_01: {}", part_01(&wires).unwrap());
21+
println!("part_02: {}", part_02(&wires).unwrap());
2222

2323
Ok(())
2424
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy