rawsrc:
@mkdir -p rawsrc
- @for file in $(FILES); do echo "$$file -> raw$$file"; egrep -v "^[[:space:]]*// " "$$file" > "raw""$$file"; done
+ @for file in $(FILES); do echo "$$file -> rawsrc/$$file"; egrep -v "^[[:space:]]*// " "$$file" > "rawsrc/""$$file"; done
// function.
fn main() {
- part00::part_main();
+ part00::main();
}
// Additional material
}
// Putting it all together:
-pub fn part_main() {
+pub fn main() {
let vec = read_vec();
let min = vec_min(vec);
print_number_or_nothing(min);
fn read_vec() -> Vec<i32> {
vec![18,5,7,2,9,27]
}
-pub fn part_main() {
+pub fn main() {
let vec = read_vec();
let min = vec_min(vec);
min.print();
fn read_vec() -> Vec<i32> {
vec![18,5,7,3,9,27]
}
-pub fn part_main() {
+pub fn main() {
let vec = read_vec();
let min = vec_min(vec);
min.print();
// If you update your `main.rs` to use part 03, `cargo run` should now ask you for some numbers,
// and tell you the minimum. Neat, isn't it?
-pub fn part_main() {
+pub fn main() {
let vec = read_vec();
let min = vec_min(vec);
min.print();