27c3_Generate C by TAXTIM

space 33
newline 10
hash 35
zero 48

  abcde
1 x01
2 012
3 123

,>+++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++ [<->-]  fetch char val to  b
[-]>[-]<<[->+>+<<]>>[-<<+>>]<               copy a to b                                b
>                                                                                      c
[-]>[-]<<[->+>+<<]>>[-<<+>>]<               copy b to c                                c
>+[<<->>-]< sub 1 from b                                                               c
a=3
b=2
c=3

<\x09\x09\x09\x09\x09b
[ \x09\x09\x09\x09\x09if input != 1:
>+++++ +++++ +++++ +++++ +++++  <\x09\x09\x09add to c
\x09-\x09\x09\x09\x09\x09b
\x09[\x09\x09\x09\x09\x09if input != 2
\x09>----- ----- ----- ----- ----- <[-]
\x09]
\x09[-]
\x09]
>
>

LINE1
copy charcount
[-]>[-]<<[->+>+<<]>>[-<<+>>]<

>+[>
 ++++[>++++++++<-]>.[-]<
<-]<

repeat
[>
\x09spaces
\x09++[>
\x09 ++++[>++++++++<-]>.[-]<
\x09<-]
\x09hashes
\x09++[>
\x09 +++++[>+++++++<-]>.[-]<
\x09<-]
<-]
newline
+[>[-]++++++++++.[-]<-]

LINE2
copy charcount
[-]>[-]<<[->+>+<<]>>[-<<+>>]<
spaces
>+[>
 ++++[>++++++++<-]>.[-]<
<-]<

hashes
>+[>
 +++++[>+++++++<-]>.[-]<
<-]<
-
repeat
[>
\x09spaces
\x09+++[>
\x09 ++++[>++++++++<-]>.[-]<
\x09<-]
\x09hashes
\x09+[>
\x09 +++++[>+++++++<-]>.[-]<
\x09<-]
<-]
newline
+[>[-]++++++++++.[-]<-]

repeat3
+++[>
\x09copy charcount
\x09[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<

\x09LINE3-5
\x09hashes
\x09>+[>
\x09 +++++[>+++++++<-]>.[-]<
\x09<-]<

\x09repeat
\x09[>
\x09\x09spaces
\x09\x09+++[>
\x09\x09 ++++[>++++++++<-]>.[-]<
\x09\x09<-]
\x09\x09hashes
\x09\x09+[>
\x09\x09 +++++[>+++++++<-]>.[-]<
\x09\x09<-]
\x09<-]
\x09newline
\x09+[>[-]++++++++++.[-]<-]
<-]

LINE6
copy charcount
[-]>[-]<<[->+>+<<]>>[-<<+>>]<
spaces
>+[>
 ++++[>++++++++<-]>.[-]<
<-]<

hashes
>+[>
 +++++[>+++++++<-]>.[-]<
<-]<
-
repeat
[>
\x09spaces
\x09+++[>
\x09 ++++[>++++++++<-]>.[-]<
\x09<-]
\x09hashes
\x09+[>
\x09 +++++[>+++++++<-]>.[-]<
\x09<-]
<-]
newline
+[>[-]++++++++++.[-]<-]

LINE7
copy charcount
[-]>[-]<<[->+>+<<]>>[-<<+>>]<
spaces
>+[>
 ++++[>++++++++<-]>.[-]<
<-]<
repeat
[>
\x09spaces
\x09++[>
\x09 ++++[>++++++++<-]>.[-]<
\x09<-]
\x09hashes
\x09++[>
\x09 +++++[>+++++++<-]>.[-]<
\x09<-]
<-]
newline
+[>[-]++++++++++.[-]<-]

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page