From 97087f6e1ab5a9260ab1a6a8d9791dba09bf9de8 Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Sun, 22 Dec 2019 00:14:40 +0200 Subject: Day 13: Pong AI done --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib.rs') 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) -- cgit v1.2.3