Wasnt working with the original input file. Crashed with the new line.
This commit is contained in:
parent
1a87d8c6b3
commit
b90110ef0f
|
@ -20,7 +20,9 @@ struct Position {
|
|||
|
||||
pub fn parse_input(input: &str) -> Vec<Move> {
|
||||
input
|
||||
.split(", ")
|
||||
.lines()
|
||||
.map(|line| {
|
||||
line.split(", ")
|
||||
.map(|item| {
|
||||
let num = item[1..].parse::<u16>().unwrap();
|
||||
match &item[0..1] {
|
||||
|
@ -29,6 +31,9 @@ pub fn parse_input(input: &str) -> Vec<Move> {
|
|||
_ => panic!("invalid"),
|
||||
}
|
||||
})
|
||||
.collect::<Vec<Move>>()
|
||||
})
|
||||
.flatten()
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue