I\'m trying to write a program with BrainFuck that can read two numbers up to 9, calculate the sum of them and then print the result out, e.g. 3 & 5 give the result 8 .
I also made a program that can only handle single digit entries and answers:
#Make the first cell (Cell 0) hold a value of 48
>++++ ++++
[
<++++ ++
>-
]
#Get inputs and minus 48 from each to get Decimal
,>,
<<
[
>-
>-
<<-
]
#Adds the contents of Cells 1 and 2
>
[
>+
<-
]
#Moves answer to Cell 0
>
[
<+
>-
]
<
[
<+
>-
]
#Converts answer to ASCII
>++++ ++++
[
<++++ ++
>-
]
<
[
<+
>-
]
<
#Print answer
.