Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lrc572 committed Dec 25, 2017
0 parents commit 728a071
Show file tree
Hide file tree
Showing 9 changed files with 748 additions and 0 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

71 changes: 71 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# ti-brainfck (v1.0.0)
a brainfuck interpreter in ti-basic
-----------------------------------

|Key|Function|
|---|---|
|LN|[|
|STO|]|
|4|>|
|1|<|
|5|+|
|2|-|
|6|.|
|3|,|
|ENTER|Newline|
|(-)|Run|

* ti-brainfck (v1.0.0) has successfully interpreted the [hello-world bf program](https://esolangs.org/wiki/Hello_world_program_in_esoteric_languages#Brainfuck).
* ti-brainfck (v1.0.0) may (probably) have some bugs.
* Bug fixes and new features will come out in the next version.
* More detailed docs will be included in the next version.

--------------------------------------

### How To Install:

#### Interpreter:
- Download BFITPT.8xp to your GC (Ti-84 Plus C SE / Ti-84 Plus CE / ...).
- Edit brainfck source code(Str0)
- Run it.

#### Editor:
- Download EDITOR.8xp to your GC (Ti-84 Plus C SE / Ti-84 Plus CE / ...).
- Run it.

--------------------------------------

### Features:

- Automatically add new line when reaching the end of a line.
- ClrHome when newline is needed at the last line of the screen.
- Memory currently contains 900 cells and the maximum depth of loop allowed is 400, due to constraints of the GC.
- Memory is wrapped on overflow and underflow (Cell(-1)=Cell(900), Cell(901)=Cell(1)).
- Only the 8 command chars are allowed to be in the source.
- Cells are emulated as to be 8-bit (0-255).
- Use ASCII printable characters as input/output.
- Currently only allows numbers and ALPHA characters(excluding theta and SOlVE) as input.
- Type capital letters by pressing 'ALPHA' key followed by the letter keys.
- Type numbers by directly pressing the number keys.
- " sign is always automatically replaced by ' sign because GC does not allow the use of " in string variables.
+ Both "(ASCII:34) and '(ASCII:39) are shown as ' in output.
+ " ("ALPHA" + "+") is converted to 34 in input.
- \ sign is always automatically replaced by / sign due to constraints of the GC.

--------------------------------------

### Todos:

- Add line buffer so as to move all lines up instead of clrhome when reaching the last line.
- When editting source code:
+ Allow non-command chars as comment (which are ignored by the interpreter) (is it necessary?)
- Translate newline to 10 on input, and 10 to newline on output
- Display instructions at the start (to be added when all functions are complete)
- Show cursor when waiting for input

--------------------------------------

* BRAINFCK.8xg is the project file (can be used in [SourceCoder3](https://www.cemetech.net/sc)).
* BFITPT.8xp is the program file of the interpreter.
* Str0.8xs is a [hello-world bf program](https://esolangs.org/wiki/Hello_world_program_in_esoteric_languages#Brainfuck).
* EDITOR.8xp is the program file for the editor.
Binary file added src/BFITPT.8xp
Binary file not shown.
Binary file added src/BRAINFCK.8xg
Binary file not shown.
Binary file added src/EDITOR.8xp
Binary file not shown.
Binary file added src/Str0.8xs
Binary file not shown.
1 change: 1 addition & 0 deletions test/doesnotworkhelloworld.bf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--<-<<+[+[<+>--->->->-<<<]>]<<--.<++++++.<<-..<<.<+.>>.>>.<<<.+++.>>.>>-.<<<+.
1 change: 1 addition & 0 deletions test/errorhelloworld.bf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
1 change: 1 addition & 0 deletions test/workedhelloworld.bf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.

0 comments on commit 728a071

Please sign in to comment.