From aeeb7856d32a904d22c5f1cdeca443bb7fcd7e49 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 18 Dec 2024 18:58:32 +0100 Subject: Refactor the intcode machine --- 2019/07/Makefile | 1 - 2019/07/machine.lisp | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) delete mode 100644 2019/07/Makefile (limited to '2019/07') diff --git a/2019/07/Makefile b/2019/07/Makefile deleted file mode 100644 index 5a21270..0000000 --- a/2019/07/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../Makefiles/lisp.mk \ No newline at end of file diff --git a/2019/07/machine.lisp b/2019/07/machine.lisp index 798bbb8..64157c7 100755 --- a/2019/07/machine.lisp +++ b/2019/07/machine.lisp @@ -2,5 +2,10 @@ (load "../interpreter.lisp") -(intcode:run (intcode:parse "input") *standard-input* *standard-output* - :initial-arguments (mapcar #'parse-integer (cdr *posix-argv*))) \ No newline at end of file +(intcode:run (intcode:parse "input") + (lambda () + (parse-integer + (if (rest *posix-argv*) + (first (setf *posix-argv* (rest *posix-argv*))) + (read-line)))) + (lambda (x) (format t "~d~%" x))) \ No newline at end of file -- cgit v1.2.3