Execute Brain****/TI-83 BASIC: Difference between revisions

Some extra explanation
(Fixed a few copy errors, I wish TI-BASIC had custom variable names for strings...)
(Some extra explanation)
Line 1:
[[Category:TI-83 BASIC]]{{implementation|Brainf***}}{{collection|RCBF}}
This implementation is extremely limited by the TI-83 calculator. The closest thing the calculator has to an [[array]] for memory space is a list. Lists in the calculator can't be given a size, they have to be filled in element by element. This program initializes the memory space to 35 elements (all 0's). To expand the space, an element must be added one space after the end and no farther. The maximum memory space size is dependent on the amount of memory already taken up by variables and other programs, but is theoretically unlimited. Also, the calculator doesn't use ASCII, so its input and output is a bit different. It takes in a single number (any number of digits, truncates decimal places) for input, and outputs a single number (any number of digits) on each line. If letters are used on input, their variable value is used. For undefined variables, 0 is used. For words typed in without quotes, all of the variables are multiplied and that result is used (if any variable is not defined, 0 is used for that variable). If a word is typed in quotes as input, an error is thrown since it is expecting a number and the program exits. The speed of this program isn't pretty. The code <tt>,[.-]</tt> works as a pretty good seconds countdown. The calculator probably wasn't designed with these kinds of string operations in mind.
 
<br clear=all>
String variable definitions:
*Str1: raw input
*Str2: valid code characters
*Str3: cleaned up code (removing illegal characters)
*Str4: each individual instruction (basically a loop variable for each character in Str3).
"+-.,[]<>"→Str2
" "→Str3
Anonymous user