Skip to content

Instantly share code, notes, and snippets.

@Sobsz
Last active April 3, 2021 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sobsz/1385246ac92189381529c4e70896b0ae to your computer and use it in GitHub Desktop.
Save Sobsz/1385246ac92189381529c4e70896b0ae to your computer and use it in GitHub Desktop.
#hbfInfo
msg %7---
msg %ethis is a brainfuck interpreter in cc script
msg %emade by hecko the very good time spender
msg %esign runs, red clay stops, the things in the back
msg %eload programs into the plaques (hence the edit perms)
msg %emore info on brainfuck:
msg %bhttps://esolangs.org/wiki/Brainfuck
msg %esee the awful code here (cc0 btw):
msg %bhttps://gist.github.com/Sobsz/1385246ac92189381529c4e70896b0ae
msg %7---
quit
#hbfRun
int hbfStopping set 0
int hbfPointer set 0
int hbfBrackets set 0
int hbfLowest set 0
int hbfHighest set 0
int hbfTape0 set 0
int hbfShowMem set 0
cmd tempbot remove hbfCursor
cmd tempbot add hbfCursor 1 11 0 90 0 urfriendmae+dontfuckants empty
cmd tempbot model hbfCursor urfriendmae+dontfuckants
cmd tempbot remove hbfFastCursor
cmd tempbot add hbfFastCursor 1 11 0 90 0 a %7ⁿhbfPointerⁿ:%fⁿhbfFastCursorⁿ
int hbfX set ⁿMBXⁿ
int hbfY set ⁿMBYⁿ
int hbfZ set ⁿMBZⁿ
int hbfY2 set hbfY
int hbfY2 add 2
goto #hbfNext
quit
#hbfStop
int hbfStopping set 1
delay 200
cmd tempbot remove hbfCursor
cmd tempbot remove hbfFastCursor
quit
#hbfNext
cmd tempbot summon hbfCursor ⁿhbfXⁿ ⁿhbfY2ⁿ ⁿhbfZⁿ 90 0
call #hbfShow
int hbfX add 1
if int hbfStopping|=|0 cmd x ⁿhbfXⁿ ⁿhbfYⁿ ⁿhbfZⁿ
quit
#hbfPrev
cmd tempbot summon hbfCursor ⁿhbfXⁿ ⁿhbfY2ⁿ ⁿhbfZⁿ 270 0
call #hbfShow
int hbfX add -1
if int hbfStopping|=|0 cmd x ⁿhbfXⁿ ⁿhbfYⁿ ⁿhbfZⁿ
quit
#hbfShow
int hbfShowMemInt set hbfTapeⁿhbfPointerⁿ
int hbfBracketsNeg set -hbfBrackets
if int hbfBrackets|=|0 string hbfShowMem set %7ⁿhbfPointerⁿ:%fⁿhbfShowMemIntⁿ
if int hbfBrackets|>|0 string hbfShowMem set %e→ %7ⁿhbfPointerⁿ:%fⁿhbfShowMemIntⁿ %e.ⁿhbfBracketsⁿ
if int hbfBrackets|<|0 string hbfShowMem set %b← %7ⁿhbfPointerⁿ:%fⁿhbfShowMemIntⁿ %b.ⁿhbfBracketsNegⁿ
cmd tempbot remove hbfFastCursor
cmd tempbot add hbfFastCursor ⁿhbfXⁿ ⁿhbfY2ⁿ ⁿhbfZⁿ 0 0 a ²hbfShowMem²
cpemsg announce ²hbfShowMem²
quit
#hbfLazyClear
if int hbfPointer|>|hbfHighest int hbfTapeⁿhbfPointerⁿ set 0
if int hbfPointer|>|hbfHighest int hbfHighest set hbfPointer
if int hbfPointer|<|hbfLowest int hbfTapeⁿhbfPointerⁿ set 0
if int hbfPointer|<|hbfLowest int hbfLowest set hbfPointer
quit
#hbf>
if int hbfBrackets|<|0 goto #hbfPrev
if int hbfBrackets|>|0 goto #hbfNext
int hbfPointer add 1
call #hbfLazyClear
goto #hbfNext
quit
#hbf<
if int hbfBrackets|<|0 goto #hbfPrev
if int hbfBrackets|>|0 goto #hbfNext
int hbfPointer add -1
call #hbfLazyClear
goto #hbfNext
quit
#hbf+
if int hbfBrackets|<|0 goto #hbfPrev
if int hbfBrackets|>|0 goto #hbfNext
int hbfTapeⁿhbfPointerⁿ add 1
int hbfTapeⁿhbfPointerⁿ mod 256
goto #hbfNext
quit
#hbf-
if int hbfBrackets|<|0 goto #hbfPrev
if int hbfBrackets|>|0 goto #hbfNext
int hbfTapeⁿhbfPointerⁿ add -1
int hbfTapeⁿhbfPointerⁿ mod 256
goto #hbfNext
quit
#hbf.
if int hbfBrackets|<|0 goto #hbfPrev
if int hbfBrackets|>|0 goto #hbfNext
string hbfOutAddress set hbfTapeⁿhbfPointerⁿ
int hbfOut set ²hbfOutAddress²
msg ⁿhbfOutⁿ
goto #hbfNext
quit
#hbf,
if int hbfBrackets|<|0 goto #hbfPrev
if int hbfBrackets|>|0 goto #hbfNext
int hbfTapeⁿhbfPointerⁿ set 0
goto #hbfNext
quit
#hbf[
if int hbfBrackets|!=|0 int hbfBrackets add 1
if int hbfBrackets|<|0 goto #hbfPrev
if int hbfBrackets|>|0 goto #hbfNext
// absolute evil i know
if int hbfTapeⁿhbfPointerⁿ|=|0 int hbfBrackets set 1
goto #hbfNext
quit
#hbf]
if int hbfBrackets|!=|0 int hbfBrackets add -1
if int hbfBrackets|<|0 goto #hbfPrev
if int hbfBrackets|>|0 goto #hbfNext
if int hbfTapeⁿhbfPointerⁿ|!=|0 int hbfBrackets set -1
if int hbfTapeⁿhbfPointerⁿ|!=|0 goto #hbfPrev
goto #hbfNext
quit
#hbfLoadInit
cmd z air
cmd x 1 9 0
cmd x 4095 10 0
delay 500
int hbfLoadX set 1
int hbfLoadY set 9
int hbfLoadZ set 0
int hbfLoadY1 set 10
quit
#hbfLoad>
cmd mb Plaque /osrs #hbf> repeatable
cmd x ⁿhbfLoadXⁿ ⁿhbfLoadYⁿ ⁿhbfLoadZⁿ
cmd place 766 ⁿhbfLoadXⁿ ⁿhbfLoadY1ⁿ ⁿhbfLoadZⁿ
int hbfLoadX add 1
quit
#hbfLoad<
cmd mb Plaque /osrs #hbf< repeatable
cmd x ⁿhbfLoadXⁿ ⁿhbfLoadYⁿ ⁿhbfLoadZⁿ
cmd place 767 ⁿhbfLoadXⁿ ⁿhbfLoadY1ⁿ ⁿhbfLoadZⁿ
int hbfLoadX add 1
quit
#hbfLoad+
cmd mb Plaque /osrs #hbf+ repeatable
cmd x ⁿhbfLoadXⁿ ⁿhbfLoadYⁿ ⁿhbfLoadZⁿ
cmd place 376 ⁿhbfLoadXⁿ ⁿhbfLoadY1ⁿ ⁿhbfLoadZⁿ
int hbfLoadX add 1
quit
#hbfLoad-
cmd mb Plaque /osrs #hbf- repeatable
cmd x ⁿhbfLoadXⁿ ⁿhbfLoadYⁿ ⁿhbfLoadZⁿ
cmd place 365 ⁿhbfLoadXⁿ ⁿhbfLoadY1ⁿ ⁿhbfLoadZⁿ
int hbfLoadX add 1
quit
#hbfLoad.
cmd mb Plaque /osrs #hbf. repeatable
cmd x ⁿhbfLoadXⁿ ⁿhbfLoadYⁿ ⁿhbfLoadZⁿ
cmd place . ⁿhbfLoadXⁿ ⁿhbfLoadY1ⁿ ⁿhbfLoadZⁿ
int hbfLoadX add 1
quit
#hbfLoad,
cmd mb Plaque /osrs #hbf, repeatable
cmd x ⁿhbfLoadXⁿ ⁿhbfLoadYⁿ ⁿhbfLoadZⁿ
cmd place ? ⁿhbfLoadXⁿ ⁿhbfLoadY1ⁿ ⁿhbfLoadZⁿ
int hbfLoadX add 1
quit
#hbfLoad[
cmd mb Plaque /osrs #hbf[ repeatable
cmd x ⁿhbfLoadXⁿ ⁿhbfLoadYⁿ ⁿhbfLoadZⁿ
cmd place 444 ⁿhbfLoadXⁿ ⁿhbfLoadY1ⁿ ⁿhbfLoadZⁿ
int hbfLoadX add 1
quit
#hbfLoad]
cmd mb Plaque /osrs #hbf] repeatable
cmd x ⁿhbfLoadXⁿ ⁿhbfLoadYⁿ ⁿhbfLoadZⁿ
cmd place 447 ⁿhbfLoadXⁿ ⁿhbfLoadY1ⁿ ⁿhbfLoadZⁿ
int hbfLoadX add 1
quit
#hbfLoadEnd
cmd mb Plaque &6done!
cmd x ⁿhbfLoadXⁿ ⁿhbfLoadYⁿ ⁿhbfLoadZⁿ
cmd place 74 ⁿhbfLoadXⁿ ⁿhbfLoadY1ⁿ ⁿhbfLoadZⁿ
quit
#hbfHW
call #hbfLoadInit
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad[
call #hbfLoad>
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad[
call #hbfLoad>
call #hbfLoad+
call #hbfLoad+
call #hbfLoad>
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad>
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad>
call #hbfLoad+
call #hbfLoad<
call #hbfLoad<
call #hbfLoad<
call #hbfLoad<
call #hbfLoad-
call #hbfLoad]
call #hbfLoad>
call #hbfLoad+
call #hbfLoad>
call #hbfLoad-
call #hbfLoad>
call #hbfLoad+
call #hbfLoad>
call #hbfLoad>
call #hbfLoad+
call #hbfLoad[
call #hbfLoad<
call #hbfLoad]
call #hbfLoad<
call #hbfLoad-
call #hbfLoad]
call #hbfLoad>
call #hbfLoad>
call #hbfLoad.
call #hbfLoad>
call #hbfLoad>
call #hbfLoad-
call #hbfLoad-
call #hbfLoad-
call #hbfLoad.
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad.
call #hbfLoad.
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad.
call #hbfLoad>
call #hbfLoad.
call #hbfLoad<
call #hbfLoad<
call #hbfLoad-
call #hbfLoad.
call #hbfLoad>
call #hbfLoad.
call #hbfLoad+
call #hbfLoad+
call #hbfLoad+
call #hbfLoad.
call #hbfLoad-
call #hbfLoad-
call #hbfLoad-
call #hbfLoad-
call #hbfLoad-
call #hbfLoad-
call #hbfLoad.
call #hbfLoad-
call #hbfLoad-
call #hbfLoad-
call #hbfLoad-
call #hbfLoad-
call #hbfLoad-
call #hbfLoad-
call #hbfLoad-
call #hbfLoad.
call #hbfLoad>
call #hbfLoad+
call #hbfLoad.
call #hbfLoad>
call #hbfLoad+
call #hbfLoad+
call #hbfLoad.
call #hbfLoadEnd
quit
@yeti0904
Copy link

yeti0904 commented Apr 3, 2021

woah, nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment