7
i.e each byte appears in a different ANSI shell colour.
Rules
- Resetting the color of the shell after output is not required
- Must be output in STDOUT or the primary colour text output of your language.
- Must be done programmatically (iterating through each color and letter of the string induvidually) instead of just writing a fixed string to shell like the reference command.
- Must output the same as the reference command:
echo -e '\e[30mH\e[31me\e[32my\e[33m!\e[34mH\e[35me\e[36my\e[37m!\e[90mH\e[91me\e[92my\e[93m!\e[94mH\e[95me\e[96my\e[97m!'
on a recent version of bash (I am using 4.3 installed via Homebrew on OS X) i.e like this: Obviously colours will vary based on terminal colour scheme.
Scoring
This is code-golf, so lowest bytes wins.
9
"Must be done programmatically (with iteration) instead of just writing a fixed string to shell like the reference command." Restrictions like this are highly problematic (several other answers on that post also apply). For a start it's not clear how much iteration is enough: can I have a loop with only two iterations that prints the first half and then the second half? Can I have a loop with ten iterations that prints the string on the first run and does nothing at all on the other nine?
– Martin Ender – 2016-07-10T11:33:39.10711
If you're worried that printing the fixed string is always going to beat printing the output in a loop, then that usually indicates a problem of the challenge. Either, loops are going to beat fixed-output answers, in which case the restriction is unnecessary, or the fixed-output answers will be shorter in which case the restriction seems like a very artifical patch to a fundamental problem of the challenge.
– Martin Ender – 2016-07-10T11:35:51.0603Is the example order of colors binding, or may we use any order as long as all 16 are used? – Adám – 2016-07-10T18:01:01.373
Can I write "Heyyyyy..."?
– A. Mirabeau – 2016-08-02T03:25:56.540