Closed dreasgrech closed 11 years ago
I'm actually treating this as a bug now because basically all the compilers/interpreters I found use a byte.
Wikipedia says "The brainfuck language uses a simple machine model consisting of the program and instruction pointer, as well as an array of at least 30,000 byte cells initialized to zero".
One program to test the byte cells would be:
.+[.+]
This program prints out the ASCII set.
A byte in C# is an 8-bit unsigned integer, with a range of [0, 255]. In CIL, it's:
uint8
http://msdn.microsoft.com/en-us/library/cc230388(v=prot.20).aspx
I'm currently using a char[] for the domain array and char.MaxValue == 65535. A char in C# is a Unicode 16-bit character.
But when looking at some interpreters and other compilers, I've noticed that they use a byte for the size of the cells i.e. the range of each value in a cell would be [0, 255] rather than [0, 65535].
If I decide to go for the byte approach, I would need to change the type of the domain array to byte.