aboutsummaryrefslogtreecommitdiff
path: root/2019/07/machine.lisp
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-12-18 18:58:32 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-12-18 18:58:32 +0100
commitaeeb7856d32a904d22c5f1cdeca443bb7fcd7e49 (patch)
tree4aacd9f841f515254ed581970070b3e1aa72301f /2019/07/machine.lisp
parent65beb3ea0223e693ac348c6133e496ada2b2352f (diff)
Refactor the intcode machine
Diffstat (limited to '2019/07/machine.lisp')
-rwxr-xr-x2019/07/machine.lisp9
1 files changed, 7 insertions, 2 deletions
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