Small changes.
This commit is contained in:
@@ -19,7 +19,7 @@ fn main() {
|
||||
|
||||
fn follow_instructions(input: &str) -> (Option<(i32, i32)>, Option<(i32, i32)>) {
|
||||
let instructions = input
|
||||
.split(",")
|
||||
.split(',')
|
||||
.map(|x| x.trim())
|
||||
.map(|x| x.split_at(1))
|
||||
.map(|(x, y)| (x, y.parse::<i32>().unwrap()));
|
||||
@@ -36,7 +36,7 @@ fn follow_instructions(input: &str) -> (Option<(i32, i32)>, Option<(i32, i32)>)
|
||||
delta = match direction {
|
||||
"R" => (delta.1, delta.0 * -1),
|
||||
"L" => (delta.1 * -1, delta.0),
|
||||
_ => delta,
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
for _ in 0..steps {
|
||||
|
||||
Reference in New Issue
Block a user