Skip to content

Commit

Permalink
Fix character input
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Pandicon authored May 11, 2022
1 parent dbf5242 commit 877903f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion interpreter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 877903f

Please sign in to comment.