Uh oh! Your current browser is not supported by CodinGame.
You may encounter navigation difficulties. Update your browser with the latest versions of Firefox or Chrome for optimal use.

Back
Close

BrainFuck part 13 - Funky output

DPAmar
1,862 views

Colors

Let's add colors ( but in a less verbose way...)

Color codes are from 30 to 37 and 90 to 97 + 39 for default color code.

Let's write a very simple program that asks for a color code, then prints some text and loop.

Code

>>+++++++++[->+++>++++++++++>++++++>+++++>++++++   generate special chars
++++++>+++++++>+<<<<<<<]>>+>--->+++>+>++>+<<<<<<     ** part 2 **
<++++++++                                          do 7 times
[
  ->.>.>.>.>.<<.>.>>.+.+.+.+.+.----->.<<<+<<<<     print ABCDEF using color 3X
]
>>>++++++>--------<<<<++++++++                     change 3 into 9 and do 7 times
[
  ->.>.>.>.>.<<.>.>>.+.+.+.+.+.----->.<<<+<<<<     print ABCDEF using color 9X
]
>>>----->--------<<<<++++++++                      change 9 into 4 and do 7 times
[
  ->.>.>.>.>.<<.>.>>.+.+.+.+.+.----->.<<<+<<<<     print ABCDEF using color 4X
]
>>>--->--------<<<<++++++++                        change 4 into 1 and do 7 times
[
  ->.>.>.-.+>.>.<<.-.+>.>>.+.+.+.+.+.----->.<<<+<<<<     print ABCDEF using color 10X
]
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants