
-----------------------------------
beard0
Fri Nov 26, 2004 2:43 pm

BF programming challenge
-----------------------------------
Want to learn a new language?  What if you heard that it has only 9, 1-character commands?  The language is BF.  Here is an explanation of the language:
A BF program operates on a simple 1-dimensional array of memory cells.  There is a "pointer" to a current memory cell.  In "vanilla" BF, this array has a size of 30,000, and each cell is an 8-bit integer - that is, it stores a value from 0-255.  Incrementing a cell with a value of 255 wraps around to 0, likewise, decrementing a cell with a value of 0 wraps around to 255.  All cells are initially set to 0, and the pointer points to the left most cell.  The BF program consists of a string.  Each character can be one of 9 commands:

> move the pointer one cell to the right
< move the pointer one cell to the left
+ increment the current cell by 1
- decrement the current cell by 1


So, the challenge is to learn the language, and write a program in it with the least number of charcters possible.  The program should accept two 1 digit numbers as input, multiply them, and then display the answer.  You do not need to display prompts.  You may force your output to be two digits. (i.e. if 2 and 3 are entered, both "6" and "06" are acceptable outputs)

Here is a BF environment that I made in turing to enable you to test your programs as you go.  Be careful: it will not warn you about overwriting files, or saving your work.
