From dd53a47b035051f022ac37477b17d20cf2e5cb14 Mon Sep 17 00:00:00 2001 From: miguel Date: Wed, 20 Nov 2024 10:36:36 +0000 Subject: [PATCH] docs(brainfuck): improve instructions --- subjects/brainfuck/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subjects/brainfuck/README.md b/subjects/brainfuck/README.md index 9231a8950a..79d10f1697 100644 --- a/subjects/brainfuck/README.md +++ b/subjects/brainfuck/README.md @@ -11,15 +11,15 @@ The source code will be given as the first parameter, and will always be valid w Your `Brainfuck` interpreter will consist of an array of 2048 bytes, all initialized to 0, with a pointer to the first byte. Every operator consists of a single character: + - `>`: increment the pointer. - `<`: decrement the pointer. - `+`: increment the pointed byte. - `-`: decrement the pointed byte. -- `.`: print the pointed byte to the standard output. -- `[`: if the pointed byte is 0, then instead of moving onto the next command, skip to the command after the matching `]`. -- `]`: if the pointed byte is **not** 0, then instead of moving onto the next command, move back to the command after the matching `[`. - -Any other character is a comment. +- `.`: print the pointed byte to standard output. +- `[`: If the byte at the current pointer is 0, skip forward to the command after the matching `]`. +- `]`: If the byte at the current pointer is not 0, jump back to the command after the matching `[`. +- Any other character is treated as a comment and ignored. ### Usage