summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorJustin Wernick <justin@worthe-it.co.za>2019-12-22 00:14:40 +0200
committerJustin Wernick <justin@worthe-it.co.za>2019-12-22 00:14:40 +0200
commit97087f6e1ab5a9260ab1a6a8d9791dba09bf9de8 (patch)
tree26b326216c855906dcfaa04a3a385180535ad251 /src/lib.rs
parent47eabec40889d650834a244cb1951eca14c3e5ad (diff)
Day 13: Pong AI done
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 6be1aba..5df59f4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -71,6 +71,10 @@ pub fn bool_to_intcode(i: bool) -> Intcode {
}
impl IntcodeProgram {
+ pub fn with_mem_0(&self, val: Intcode) -> IntcodeProgram {
+ self.with_memory_set(0.into(), val)
+ }
+
pub fn with_noun_verb_input(&self, noun: Intcode, verb: Intcode) -> IntcodeProgram {
self.with_memory_set(1.into(), noun)
.with_memory_set(2.into(), verb)