Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 2019/go/cmd/15/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strings"
)

func readCommands() ([]int, error) {
func readCommands(filepath string) ([]int, error) {

content, err := os.ReadFile("cmd/15/input.data")
content, err := os.ReadFile(filepath)
if err != nil {
return []int{}, err
}
Expand All @@ -27,7 +27,7 @@ func readCommands() ([]int, error) {
}
func main() {

nums, err := readCommands()
nums, err := readCommands("cmd/15/input.data")
if err != nil {
println("was not able to read")
}
Expand Down
9 changes: 2 additions & 7 deletions 2021/_4/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(drain_filter)]
use std::num::ParseIntError;
use std::str::FromStr;

Expand Down Expand Up @@ -129,12 +128,8 @@ fn main() {
let mut found_table_indicies: Vec<usize> = vec![];
// let tables_length = tables.len();
for number in choosen_numbers.0 {
tables = tables
.drain_filter(|table| {
table.toggle(number);
table.found_full()
})
.collect();
tables.iter_mut().for_each(|table| table.toggle(number));
tables.retain(|table| !table.found_full());
// tables.retain(|table| (*table).found_full())
}
// tables.retain(|table| {
Expand Down
1 change: 0 additions & 1 deletion 2024/golang/cmd/04.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"bufio"
"errors"
"fmt"
"os"
"strings"
Expand Down
Loading