Rainbow
fn main() {
let colors: (int, int, int)[7] = [
(255, 0, 0), // red
(255, 128, 0), // orange
(255, 255, 0), // yellow
( 0, 255, 0), // green
( 0, 0, 255), // blue
( 75, 0, 130), // indigo
(128, 0, 255) // violet
];
let s = "RAINBOW";
for i in 0..7 {
let fore = "\e[38;2;;;m";
print "";
}
println "";
}
Output:
RAINBOW
Attribution: This is a community solution for the Rosetta Code task Rainbow in Zen C.
This article uses material from the Rosetta Code article Rainbow, which is released under the GNU Free Documentation License 1.3. A list of the original authors can be found in the page history.