From 51b16e5f93a78c64b64314ba90a9a281224600cd Mon Sep 17 00:00:00 2001 From: Ummon Date: Sun, 15 Dec 2019 13:52:22 +0100 Subject: [PATCH] Add a little comment --- src/day13.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/day13.rs b/src/day13.rs index 246fba5..169f4d8 100644 --- a/src/day13.rs +++ b/src/day13.rs @@ -3,7 +3,7 @@ use std::convert::TryFrom; use itertools::Itertools; use num_enum::TryFromPrimitive; -// Not neccesary, to try to parse enum. +// Not neccesary, to try to parse enum in Rust. #[derive(Debug, Eq, PartialEq, TryFromPrimitive)] #[repr(u8)] enum Tile { @@ -42,7 +42,7 @@ impl intcode::IO for State { fn write(&mut self, value: i64) { self.buffer.push(value); if self.buffer.len() == 3 { - if self.buffer[0] == -1 { + if self.buffer[0] == -1 && self.buffer[1] == 0 { self.score = self.buffer[2]; } else { let tile = Tile::try_from(self.buffer[2] as u8).unwrap(); -- 2.45.2