From 877903f186c05b8b284280b7e8f7a4d4047c3511 Mon Sep 17 00:00:00 2001 From: Pandicon <70060103+Pandicon@users.noreply.github.com> Date: Wed, 11 May 2022 11:46:40 +0200 Subject: [PATCH] Fix character input Previously it was taking the whole input line, keeping the first character, and throwing away the rest of the line. Now it keeps the rest of the line for follow-up input reading. --- interpreter/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreter/main.py b/interpreter/main.py index a2afc26..ec6d79a 100644 --- a/interpreter/main.py +++ b/interpreter/main.py @@ -265,7 +265,7 @@ def eval_command(self, command: str, local_memory, local_pointers_mem, local_act if command == "$.": main_mem[main_act][main_mem_ptr[main_act]] = float(input()) if command == "$,": - main_mem[main_act][main_mem_ptr[main_act]] = ord(input()[0]) + main_mem[main_act][main_mem_ptr[main_act]] = ord(sys.stdin.read(1)) if command == "[": if main_mem[main_act][main_mem_ptr[main_act]] == 0: if self.program_pointer in self.loops: