Interpret an esoteric programming language's code and handle errors.
BF is an esoteric programming language created in 1993 by Urban Müller. The language only has eigth commands, but it is fully Turing complete. BF has no practical uses, but it does challenge programmers, while testing the bounds of computer science.
- '>' Forward pointer. Tell C++ to point to the memory block that is infront of the current memory block
- '<' Backward pointer. Tell C++ to point to the memory block that is behind the current memory block
- '.' Print. Tell C++ to print what is in the memory block that C++ is currently pointing too
- ',' User input. Tell C++ to take user input
- '+' Increment. Tell C++ to increment the memory block by 1
- '-' Decrement. Tell C++ to decrement the memory block by 1
- '[' Start a loop. Tell C++ where the start a loop is located. When a loop starts over it will go to wherever the '[' char is located
- ']' End a loop. Tell C++ where the end of a loop is located. A Loop will only end if the value of the current memory block is 0 and the current char being read is '['
- This interpreter does not read white spaces
- Loops must start and end on the same line
- There are 30,000 memory blocks
- Each memory block is initialized with the value 0
- Each memory block cannot be more than 127
- Each memory block cannot be less than -128
- Attemping to go above 127, or below -128, will result in an error
- If during user input a user enter a std::string each char will be put in a memory block of it's own
- The BF code must be stored in a .bf file
- Built in Visual Studio 2022
- C++ Language standard: ISO C++20 Standard (/std:c++20)
- C Language standard: ISO C17 (2018) Standard (/std:c17)
- Complied on the x64 platform
When running the unit test ensure that Visual Studio Code 2022's configuration manager is set to Debug, or else not all the assert functions will not be called.