From c5e9958fee14d5240458a1653a545161942f2a18 Mon Sep 17 00:00:00 2001 From: Pandicon <70060103+Pandicon@users.noreply.github.com> Date: Thu, 1 Sep 2022 07:01:21 +0200 Subject: [PATCH] Make input chainable --- README.md | 4 ++-- the-golden/src/interpreter/versions/v0-4-0/main.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6a1102b..39f1f93 100644 --- a/README.md +++ b/README.md @@ -114,8 +114,8 @@ The magic of Brainfuck-like syntax is that it is easy and extremely difficult at | ^ | Switch active memory (sets the active as inactive and the inactive as active) | `^` | No | Yes | | $, | Sets the cell to the value of user input as a number (if they input 69, the cell value will be 69) | `$,` | No | Yes | | , | Sets the cell to the value of user input as a character (if they input E, the cell value will be 69) | `,` | No | Yes | -| $. | Output the cell as a number (if the cell value is 69, 69 will be printed) | `$.` | No | Yes | -| . | Output the cell as a character (if the cell value is 69, E will be printed) | `.` | No | Yes | +| $. | Output the cell as a number (if the cell value is 69, 69 will be printed) | `$.` | Yes | Yes | +| . | Output the cell as a character (if the cell value is 69, E will be printed) | `.` | Yes | Yes | | [ | Start a while loop | `[` | No | Yes | | ] | End a while loop | `]` | No | Yes | | [@ | Start a do-while loop | `[@` | No | Yes | diff --git a/the-golden/src/interpreter/versions/v0-4-0/main.rs b/the-golden/src/interpreter/versions/v0-4-0/main.rs index 9d2c7fb..62eade8 100644 --- a/the-golden/src/interpreter/versions/v0-4-0/main.rs +++ b/the-golden/src/interpreter/versions/v0-4-0/main.rs @@ -64,8 +64,8 @@ impl Runner { Regex::new(r"^@?\]").unwrap(), // (do-)while end Regex::new(r"^\$,").unwrap(), // input number Regex::new(r"^,").unwrap(), // input character - Regex::new(r"^\$\.").unwrap(), // output number - Regex::new(r"^\.").unwrap(), // output character + Regex::new(r"^(\|-?[0-9]*\|)*\$\.").unwrap(), // output number + Regex::new(r"^(\|-?[0-9]*\|)*\.").unwrap(), // output character Regex::new(r"^(\|-?[0-9]*\|)*\?=").unwrap(), // break if active memory address is equal to inactive memory address Regex::new(r"^(\|-?[0-9]*\|)*\?>").unwrap(), // break if active memory address is greater than inactive memory address Regex::new(r"^(\|-?[0-9]*\|)*\?<").unwrap(), // break if active memory address is less than inactive memory address