Skip to content

Instantly share code, notes, and snippets.

@seanballais
Created July 29, 2015 13:34
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 seanballais/12d6706b54a0cacb2f4e to your computer and use it in GitHub Desktop.
Save seanballais/12d6706b54a0cacb2f4e to your computer and use it in GitHub Desktop.
Prints "Happy Independence Day!"
+++++ +++++ initialize counter (cell #0) to 10
[ use loop to set cell #1 to 60
> +++++ + add 6 to cell #1 (Capital letters)
> +++++ ++++ add 9 to cell #2 (Lowercase letters)
> +++ add 2 to cell #3 to represent space
> + add 1 to cell #4 to represent a new line
<<<< - decrement counter (cell #0)
]
>>>> . go to cell #4 and print a new line
<<<< go to cell #0
>> +++++ ++ set cell #2 to 97 for 'a'
> ++ set cell #3 to 32 for space
< go to cell #2
< +++++ +++++ ++ . set cell #1 to 72 for 'H' and print it
> go to cell #2
. print 'a'
+++++ +++++ +++++ .. set cell #2 to 112 for 'p' and print it twice
+++++ ++++ . set cell #2 to 121 for 'y' and print it
> . go to cell #3 and print the space
<< + . set cell #1 to 73 for 'I' and print it
> go to cell #2
----- ----- - . set cell #2 to 110 for 'n' and print it
----- ----- . set cell #2 to 100 for 'd' and print it
+ . set cell #2 to 101 for 'e' and print it
+++++ +++++ + . set cell #2 to 112 for 'p' and print it
----- ----- - . set cell #2 to 101 for 'e' and print it
+++++ ++++ . set cell #2 to 110 for 'n' and print it
----- ----- . set cell #2 to 100 for 'd' and print it
+ . set cell #2 to 101 for 'e' and print it
+++++ ++++ . set cell #2 to 110 for 'n' and print it
----- ----- - . set cell #2 to 99 for 'c' and print it
++ . set cell #2 to 101 for 'e' and print it
> . go to cell #3 and print a space
<< go to cell #1
----- . set cell #1 to 68 for 'D' and print it
> go to cell #2
---- . set cell #2 to 97 for 'a' and print it
+++++ +++++ ++++++ ++++++ ++ . set cell #2 to 121 for 'y' and print it
> go to cell #3
+ . set cell #3 to 33 for '!' and print it
> .. go to cell #4 and print a new line twice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment