At 4/12/09 12:02 PM, littleMonsterGames wrote:
Also, what you're saying about not being able to add and stuff is totally false.
by assuming that i dont know what i am talking about, youve successfully incurred the following:
lets say that your tape is three cells and has just been initialized. it contains the following values [48, 48, 48] if you want to add the first and second cells, and place the result in the third cell (which is a common sample BF program), the result will not be what is expected.
let us say that the tape is default and three cells. the expected result is a tape with [0, 0, 0]. first we put the values in the tape that we want. the following program puts 4 and 5 in the first two cells:
++++>+++++
now, let us assume that the tape head is at the first cell. to add these values together, the following should work:
[->>+<<]>[->+<]>
with the tape head now at the third cell, containing the value 9. this is to be expected. use these SAME two codes on your implementation, and the last cell will now be holding 153. wtf? why 153? this is not a value that represents anything valuable. in fact, because all cells start at 48, any math must FIRST zero out all the cells it plans to use.
i could continue to make you feel stupid by explaining how you will ALWAYS overflow multiplication computations, how divisions wont make sense, and how the only thing youve done with your implementation is to make it a tiny bit easier to print "Hello, world!". congratulations, but your implementation is now useless and doesnt conform to the brainfuck standard.
i believe the brainfuck standard makes it perfectly understandable:
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; a movable data pointer (initialized to point to the leftmost byte of the array); and two streams of bytes for input and output.