Last active
May 9, 2022 15:56
-
-
Save raklaptudirm/08af8b06a60129152ccbeb3c9f0f5bd6 to your computer and use it in GitHub Desktop.
Optimized Brainfuck Instruction Set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// value instructions | |
/* Set Value (offset, amount) */ memory[pointer+offset] = amount | |
/* Change Value (offset, amount) */ memory[pointer+offset] += amount | |
// i/o instructions | |
/* Input Byte (offset) */ memory[pointer+offset] = stdin.ReadByte() | |
/* Output Byte (offset) */ stdout.Write(string(memory[pointer+offset])) | |
// looping instructions | |
/* Start Loop (offset) */ pointer += offset; for memory[pointer] > 0 { | |
/* End Loop (offset) */ pointer += offset; } | |
// optimizing instructions | |
/* Multiply (target, source, factor) */ memory[pointer+target] += source * factor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment