118
\$\begingroup\$

Today is November 8th, 2016, Election Day in the United States of America.

If you are a U.S. citizen eligible to vote, then go out and vote if you haven't already before answering this challenge. Do not discuss who you voted for. It only matters that you voted.

If you are not a U.S. citizen or not eligible to vote, then, before answering this challenge, do the U.S. a favor by telling anyone you know who is an eligible citizen to go out and vote if they haven't already.

Challenge

Write a program that indicates that you voted, like a digital "I Voted" sticker.

It should take no input and must output in a reasonable way the phrase I Voted where the I, o, and e are red (#FF0000) and the V, t, and d are blue (#0000FF). The background must be white (#FFFFFF).

For example:

"I Voted" example graphic

These colors are of course representative of the American flag (though not the official colors). Red comes first simply because it comes first in the common idiom "red white and blue".

To be valid, an answer must:

  • Use the colors specified in the arrangement specified.

  • Use a single legible font and font size. The example uses 72pt Times New Roman bold but any common font above 6pt is probably fine.

  • Have just the phrase I Voted on a single line, capitalized correctly, with a clear space between the two words. It shouldn't look like IVoted.

  • Not indicate who the answerer voted for or supports for president or any down-ballot races. Let's not start any internet debates. This is about celebrating voting, not candidates.

Any reasonable way of displaying or producing the output is valid, such as:

  • Drawing the text to an image that is then displayed, saved, or output raw.

  • Writing the text to a console using color formatting. In this case you may approximate pure red and blue if necessary, and it's ok if only the area directly behind the text can be made white.

  • Displaying the text on a WPF/Windows form.

  • Outputting an HTML/RTF/PDF file with the text.

Please post an image of your output.

The shortest answer in bytes wins.

\$\endgroup\$
13
  • 30
    \$\begingroup\$ A bit disappointed my actual sticker doesn't look like yours. \$\endgroup\$
    – Geobits
    Nov 8, 2016 at 13:52
  • 41
    \$\begingroup\$ "It only matters that you voted." - @HelkaHomba ... That's like saying "it doesn't matter what code you write, as long as you wrote some code." :/ \$\endgroup\$ Nov 8, 2016 at 14:05
  • 42
    \$\begingroup\$ @MichaelYaeger Well, writing some code is better than writing none. Voting is better than not voting. Chances are people will put some thought into coding and voting if they choose to do it. But really I said that to help avoid angry debates. \$\endgroup\$ Nov 8, 2016 at 14:13
  • 46
    \$\begingroup\$ If it helps anyone, vowels are red, consonants are blue. \$\endgroup\$
    – mbomb007
    Nov 8, 2016 at 15:09
  • 38
    \$\begingroup\$ @mbomb007 Or more usefully, the letters with odd code points are red, and the letters with even code points are blue. \$\endgroup\$
    – Sp3000
    Nov 8, 2016 at 15:15

62 Answers 62

6
\$\begingroup\$

Qbasic, 137, 126, 124, 122, 115, 114, 113 bytes

a$="I m C n d a ":b$=" '   a a i n"
FOR i=1TO 12
c$=MID$(a$,i,1)
IF c$<>" "THEN
COLOR 4,7:?c$;
ELSE
COLOR 7,4:?MID$(b$,i,1);
ENDIF
NEXT

:) And the real program

a$="I  o e":b$="  V t d"
FOR i=1TO 7
c$=MID$(b$,i,1)
IF c$=" "THEN COLOR 4,7:?MID$(a$,i,1);ELSE COLOR 1:?c$;
NEXT

Output:

enter image description here

\$\endgroup\$
0
6
\$\begingroup\$

BASIC (zx spectrum), 24 bytes

1 PRINT "{BRIGHT 1}{INK 2}I {INK 1}V{INK 2}o{INK 1}t{INK 2}e{INK 1}d"

But it’s not a real spectrum code, it is just a text that should be feed to BAS2TAP compiler.

70 ASCII-chars (including the end of line).

Actually, it produces a .TAP file. To easily run it, I give you the encoded version:

data:text/cmd;base64,EwAAAFZPVEUgICAgICAdAAAAHQAIHwD/AAEZAPUiEwEQAkkgEAFWEAJvEAF0EAJlEAFkIg0r

This URI is 93 characters in Base64, but the real TAP file size is 54 bytes.

Visit this online emulator and press “Open file” (4-th button, «folder»), flip “Spectrum 128K” to “Spectrum 48K”, paste that "data:text…" to “Load from web:” field and finally hit “Open URL”!

But my program is even smaller. You see, Spectrum uses one byte for language keywords and control codes.

So PRINT (and spaces around it) is just one “char” from ZX’s point of view. If I will not count line number “1” (piece of code could be executed directly) and final ENTER, then program dump looks like this:

Offset   |  0  1  2  3  4  5  6  7   8  9 10 11 12 13 14 15 |
---------+--------------------------------------------------+-----------------
00000000 | F5 22 13 01 10 02 49 20  10 01 56 10 02 6F 10 01 | х"....I ..V..o..
00000016 | 74 10 02 65 10 01 64 22                          | t..e..d"

24 bytes

Color codes are represented as two byte sequences. But they could be written as one logical character from the keyboard!

Since we don’t need to restore colors after line, my logical length is this: “1” as line number; keyword “PRINT” (typed with only one keypress); quote char. Then comes BRIGHT mode (to make background pure white) and BLUE ink. Then type all letters with according color (can switch to RED directly). And a final quote. That way, I got 18.

Also we can count actual keystrokes that are needed to write this program to Spectrum! Go here.

Ctrl key stand for SYMBOL SHIFT and Shift stand for CAPS SHIFT. The combination “Ctrl+Shift” will put the cursor in "E" mode and back, so don’t hold it for long.

To type my golfing, press this key sequence:

1 P CTRL+P CTRL+SHIFT 9 CTRL+SHIFT SHIFT+2 SHIFT+I SPACE CTRL+SHIFT SHIFT+1 SHIFT+V CTRL+SHIFT SHIFT+2 O CTRL+SHIFT SHIFT+1 T CTRL+SHIFT SHIFT+2 E CTRL+SHIFT SHIFT+1 D CTRL+P ENTER R ENTER

We have as much as 28 keystrokes!

0 OK, 1:1


Moderator Note: for anyone interested in seeing the remaining part of this answer (the polyglot code which is not a serious competitive contender), it is now in a gist here to save space.

\$\endgroup\$
3
  • 2
    \$\begingroup\$ Holy hell, this might be the craziest (as in crazy good) thing I've seen on PCCG. You got my upvote! \$\endgroup\$
    – ave
    Dec 5, 2016 at 21:10
  • 3
    \$\begingroup\$ Welcome to PPCG! I think this is the best first post I've ever seen! \$\endgroup\$
    – Riker
    Dec 5, 2016 at 21:13
  • \$\begingroup\$ Link to Bas2tap compiler is dead. \$\endgroup\$ Feb 15, 2021 at 21:03
5
\$\begingroup\$

Bash, 61 bytes

b="\e[34m";r=${b/4/1};echo -e ${r}I ${b}V${r}o${b}t${r}e${b}d

enter image description here

with white background 61 + 9 byte:

b="\e[34m";r=${b/4/1};echo -e "\e[107m"${r}I ${b}V${r}o${b}t${r}e${b}d
\$\endgroup\$
4
  • \$\begingroup\$ Could you set the background to white, please? \$\endgroup\$ Nov 8, 2016 at 20:23
  • \$\begingroup\$ @PaŭloEbermann , done \$\endgroup\$
    – Baba
    Nov 8, 2016 at 20:39
  • \$\begingroup\$ oddly, in my terminal program (ROXTerm), the first one is on a white background, while the second one has a slightly light grey background. \$\endgroup\$
    – trlkly
    Nov 9, 2016 at 11:21
  • \$\begingroup\$ @trlkly the first one doesn't set any background, so it will show with the default background. (Which would be a light green for me, and seemingly a white for you.) The second one selects the "white" background from the palette, which looks white here, but can be configured in most terminals. \$\endgroup\$ Nov 9, 2016 at 18:32
5
\$\begingroup\$

Processing, 83 85 83 bytes

Had to increase byte count to include spaces to avoid overlapping letters

Then I reduced byte count by changing the positions and removing spaces

Processing is basically Java, but more artistic and less verbose (emphasis on less verbose).

background(255);fill(#ff0000);text("I   o e",2,9);fill(#0000ff);text("V  t d",9,9);

Explanation:

background(255); //sets background colour to white
fill(#ff0000); //setting the text colour to red
text("I   o e",2,9); //Display text "I   o e" (in red) at position (2,9) [Origin is top left]
fill(#0000ff); //set the text colour to blue
text("V  t d"); //Display text "  V  t d" (in blue) at position (9,9)

enter image description here

\$\endgroup\$
5
  • \$\begingroup\$ @sanchises I don't know how to fix it yet \$\endgroup\$
    – user41805
    Nov 8, 2016 at 14:21
  • \$\begingroup\$ @sanchises I tried it, but that just messes things up even more so \$\endgroup\$
    – user41805
    Nov 8, 2016 at 14:23
  • \$\begingroup\$ @sanchises Done! \$\endgroup\$
    – user41805
    Nov 8, 2016 at 14:41
  • \$\begingroup\$ Could you try tabs (\t) instead to try and save bytes? \$\endgroup\$
    – Artyer
    Nov 8, 2016 at 21:20
  • \$\begingroup\$ @Artyer The tabs don't help, I've tried. \$\endgroup\$
    – user41805
    Nov 9, 2016 at 5:25
5
\$\begingroup\$

Quake 3/Live Colour Codes (19 characters)

^1I ^4V^1o^4t^1e^4d
\$\endgroup\$
1
  • 6
    \$\begingroup\$ Add an image showing your output \$\endgroup\$
    – user41805
    Nov 10, 2016 at 14:37
4
\$\begingroup\$

Emmet, 49 62 61 68 bytes

a{I}+r{V}+a{o}+r{t}+a{e}+r{d}+style{r{color:red}}
r{I&nbsp;}+w{V}+r{o}+w{t}+r{e}+w{d}+style{r{color:red}w{color:#00f}}

Running this will generate the following HTML code:

<w>I</w> <r>V</r> <w>o</w> <r>t</r> <w>e</w> <r>d</r> <style>r{color:red}w{color:00f}</style>

And it looks like this:
1

It's using the blue of links, so the only color that needs to be set is red, saving us some bytes.

\$\endgroup\$
10
  • \$\begingroup\$ That's a cool approach. Unfortunately, I don't think it counts. The OP specified that is not allowed \$\endgroup\$
    – DJMcMayhem
    Nov 8, 2016 at 21:14
  • \$\begingroup\$ I managed to miss that, removed links and added 13 bytes. \$\endgroup\$
    – DecentM
    Nov 8, 2016 at 21:24
  • \$\begingroup\$ OK, thanks. BTW, welcome to the site! \$\endgroup\$
    – DJMcMayhem
    Nov 8, 2016 at 21:25
  • 1
    \$\begingroup\$ I like the answer, and I would let it slide, but you may want to add a space between the I and V. you can also change 'blue' to 0ffto save a byte! \$\endgroup\$
    – tuskiomi
    Nov 8, 2016 at 21:37
  • \$\begingroup\$ I did have a space in there at first, but Emmet adds a newline after every element. Because of this, adding a space would not increase the distance between the two letters. \$\endgroup\$
    – DecentM
    Nov 8, 2016 at 21:46
4
\$\begingroup\$

Encapsulated Postscript, 103 bytes

Copy-paste and save as .eps to display it:

%!PS
/run{100 500 moveto setrgbcolor show}def/Courier 60 selectfont(I  o e)1 0 0 run(  V t d)0 0 1 run

Explanation:

/run{100 500 moveto setrgbcolor show}def 

Declares a procedure "run" that expects to have in the stack a string and 3 rgb values. The procedure moves the cursor to 100 500, takes the 3 rgb values from the stack to set the color, then takes the string from the stack and displays it,

/Courier 60 selectfont

Sets the Courier font with size 60

(I  o e)1 0 0 run

Puts the string and the 3 rgb componets in the stack and calls "run"

\$\endgroup\$
4
\$\begingroup\$

Printf (in sh), 49 44 bytes

Sad to see no one has used printf, only echo. (See Why is printf better than echo?)

:)

printf '\e[47;1;31m%s\e[34m%s' I\  V o t e d

enter image description here

Thanks to matatwork for helping shave off five bytes. :)


As noted in the comments, two more bytes could be shaved off by using literal escape characters rather than \e in both places where that appears.

(I've chosen not to update the screenshot, and of course can't include literal escape characters in the code anyway. I don't know if I should reduce the byte count to 42 bytes, since I didn't make those updates.)

\$\endgroup\$
4
  • \$\begingroup\$ My comment is valid for this one too. \$\endgroup\$
    – manatwork
    Nov 10, 2016 at 10:09
  • \$\begingroup\$ @manatwork, thanks! See any other way to reduce it down? \$\endgroup\$
    – Wildcard
    Nov 10, 2016 at 10:19
  • \$\begingroup\$ Only the usual one of using literal escape character instead of \e. In terminal press Ctrl-V, Esc – will appear ^[ but is a single character. \$\endgroup\$
    – manatwork
    Nov 10, 2016 at 10:28
  • \$\begingroup\$ @manatwork, ah, that would be codegolf indeed. I think I'll pass on updating the screenshot and code, but I'll include a note. Thanks! \$\endgroup\$
    – Wildcard
    Nov 10, 2016 at 11:01
4
\$\begingroup\$

IRC - 19 bytes

4I 2V4o2t4e2d

Here it is with the nonprintables escaped, UNIX style:

^C4I ^C2V^C4o^C2t^C4e^C2d

xxd output:

00000000: 0334 4920 0332 5603 346f 0332 7403 3465  .4I .2V.4o.2t.4e
00000010: 0332 64                                  .2d

This makes use of IRC coloring, which uses ASCII character 03 and a colour palette.

I didn't vote though, being a non-USAian

\$\endgroup\$
3
\$\begingroup\$

Mouse2002, 84 bytes

"[47;31;1mI "#B,86;#R,111;#B,116;#R,101;#B,100;$B1%c:"[34m"c.!'@$R1%c:"[31m"c.!'@

Ungolfed:

"[47;31;1mI " #B,86; #R,111; #B,116; #R,101; #B,100;


$B 1% c: "[34m" c. !' @
$R 1% c: "[31m" c. !' @

A hexdump of the golfed code (note the unprintables), reversible with xxd -r:

00000000: 221b 5b34 373b 3331 3b31 6d49 2223 422c  ".[47;31;1mI"#B,
00000010: 3836 3b23 522c 3131 313b 2342 2c31 3136  86;#R,111;#B,116
00000020: 3b23 522c 3130 313b 2342 2c31 3030 3b0a  ;#R,101;#B,100;.
00000030: 0a0a 2442 3125 633a 221b 5b33 346d 2263  ..$B1%c:".[34m"c
00000040: 2e21 2740 0a24 5231 2563 3a22 1b5b 3331  .!'@.$R1%c:".[31
00000050: 6d22 632e 2127 40                        m"c.!'@

enter image description here

\$\endgroup\$
0
3
\$\begingroup\$

SVG, 71 bytes

This may not parse as an .svg file, but it works if you save it as html.

<svg letter-spacing=8><text y=20 fill=red>I oe<tspan x=16 fill=blue>Vtd

\$\endgroup\$
3
\$\begingroup\$

Python 2 (or 3), (75 bytes)

I Voted

a="\033[3%sm"
r,b=a%"1;47",a%4
print(r+"I "+b+"V"+r+"o"+b+"t"+r+"e"+b+"d")

Resized my terminal font size to 72 for a bigger picture, outputs in colour in most terminals.

\$\endgroup\$
1
  • \$\begingroup\$ If you allow Python 2, you can save a byte by replacing print(...) with print ...; you can save another byte by replacing \033 with \33. \$\endgroup\$ Sep 6, 2017 at 13:13
3
\$\begingroup\$

C#, 262 201 180 170 166 bytes

using c=System.Console;using o=System.ConsoleColor;static void M(){c.BackgroundColor=(o)15;foreach(var a in "I Voted"){c.ForegroundColor=(o)(a%2<1?9:12);c.Write(a);}}

Saved 46 bytes thanks to Link Ng

Outputs the following to console:

Output

\$\endgroup\$
2
  • \$\begingroup\$ Modify M() to be {o r=o.Red,b=o.Blue;c.BackgroundColor=o.White;foreach(var a in"I Voted"){if(a%2<1)f(b);else f(r);c.Write(a);}} to save 46 bytes. If you can make if-else into ternary operator you may save more. \$\endgroup\$
    – Link Ng
    Nov 11, 2016 at 12:32
  • \$\begingroup\$ @LinkNg Managed to save even more thanks to that, a whole lot more now \$\endgroup\$ Nov 11, 2016 at 12:41
3
\$\begingroup\$

Befunge, 47 bytes

41+:+"detoV I":v:,,,\<
93"[47;3m"g0%2:_@>,,,^#*

Try it online - you'll need to Compile then Execute

enter image description here

\$\endgroup\$
3
\$\begingroup\$

Bash, 51 bytes

GREP_COLORS='sl=34;47' grep [Ioe] --col<<<I\ Voted

enter image description here

Without the white background (who says terminals have to be black??), it is even shorter: 46 bytes.

GREP_COLORS=sl=34 grep [Ioe] --col<<<I\ Voted

But it looks like OP wouldn't accept the latter.

grep highlights any of letters I, o or e red (default coloring). I don't think there is a regex for vowels in general which could shorten the syntax. For blue color and white background, instead of stating the complicated bash color codes, you can let grep do that when defining GREP_COLORS:

grep takes care of assembling the result into a complete SGR sequence (\33[...m).

Looks like the syntax highlighting on Codegolf is a bit based though.

\$\endgroup\$
3
\$\begingroup\$

Geometry Dash, 2 objects/276 bytes

Raw text that the level is stored as:

H4sIAAAAAAAAE6WPzQrCMBCEX2iFnc1PU8RDexGPUvC66EWkvoDgw5tkKyJYtHjIDJlhPpJxcImgEoJKVVcVFsEyWOh1BY0KZtZGoQhFkrImxR3ZJZfyGwL_I9qPiIVfES37TyDIC8TfMGEWw0teE2cwNHZwxMWCWTTzlDVSLseusWiyVGxwbb1JVSPUovNVrQWbgXgNajNUCDGQI3CgNuPJo0gGHHEsB-RAw9CdT7f--hqlZhoJ8vU5WkHedodLz7vtfrN-APfUD_t-AgAA

Level editor

enter image description here

Object count in the top-left

enter image description here

This is made by converting RGB to Geometry Dash's version of HSL (in Geometry Dash its hue, saturation, and brightness), and coloring "V t d" blue (hue -120, saturation 1, and brightness 0) and "I o e" red (hue 0, saturation 1, and brightness 0).

\$\endgroup\$
6
  • \$\begingroup\$ How many bytes is this? Surely this level is saved somewhere as a file. \$\endgroup\$
    – Jo King
    Aug 15, 2019 at 23:13
  • \$\begingroup\$ @JoKing Sure, I'll check. \$\endgroup\$
    – MilkyWay90
    Aug 15, 2019 at 23:16
  • \$\begingroup\$ @JoKing Updated. \$\endgroup\$
    – MilkyWay90
    Aug 15, 2019 at 23:28
  • \$\begingroup\$ I never expected to see this game on this SE. Very creative \$\endgroup\$
    – Belhenix
    Aug 16, 2019 at 17:24
  • 1
    \$\begingroup\$ @Belhenix You can see other answers by typing in is:answer "Geometry Dash" into the search bar \$\endgroup\$
    – MilkyWay90
    Aug 16, 2019 at 17:57
3
\$\begingroup\$

Trackmania Nations Forever, 31 bytes

Uses colour codes for in-game nickname. When selecting profile on startup, the background is white.

Code

$f00I $00fV$f00o$00ft$f00e$00fd

Output

"Output"

\$\endgroup\$
1
  • \$\begingroup\$ +1 just for the absolutely abstract choice of "language" \$\endgroup\$
    – Makonede
    May 21, 2021 at 1:43
2
\$\begingroup\$

Python 2, 77 bytes

r='\033[91m'
b='\033[94m'
print r+'\033[47mI '+b+'V'+r+'o'+b+'t'+r+'e'+b+'d'

I don't know about other platforms, and it does not work online but on Windows 10 this works just fine with the command line, it looks like this:

I tried this:

e='\033[9
r=e+'1m'
b=e+'4m'
print r+'\033[47mI '+b+'V'+r+'o'+b+'t'+r+'e'+b+'d'

And this:

r='\033[91m'
b='\033[94m'
v,o,t,e,d='Voted'
print r+'\033[47mI '+b+v+r+o+b+t+r+e+b+d

But they did not actually help (but they are much cooler!)

\$\endgroup\$
4
  • \$\begingroup\$ @HelkaHomba I completely forgot, thank you! \$\endgroup\$
    – nedla2004
    Nov 9, 2016 at 0:12
  • \$\begingroup\$ Could you use a printf-like syntax to reduce this? (don't do Python, just a thought, seeing all those +s). \$\endgroup\$ Nov 9, 2016 at 7:55
  • \$\begingroup\$ @mojimonster I don't think that exists in Python, though it might just be called something else, I am not sure. \$\endgroup\$
    – nedla2004
    Nov 9, 2016 at 13:35
  • \$\begingroup\$ Are you sure the background is #FFFFFF? \$\endgroup\$
    – MilkyWay90
    Aug 15, 2019 at 23:23
2
\$\begingroup\$

Ruby - 46 45 bytes

puts"1I 4V1o4t1e4d".gsub(/\d/){"\e[47;3#$&m"}

The digits are placeholders for colors. They are injected into escape sequences via '#$&' (interpolation of the last match).

enter image description here

\$\endgroup\$
2
\$\begingroup\$

PHP, 132 bytes

imagefill($i=imagecreatetruecolor(62,13),0,0,~0);($s=imageString)($i,6,0,0,"I Vote",255<<16);$s($i,6,18,0,"V t d",255);imagepng($i);

Based on Kodos Johnson´s answer (prints image data to stdout)

create image with full alpha background, add I Vote in red, add V t d in blue, output image.

I Voted

\$\endgroup\$
2
\$\begingroup\$

SVG - 205 bytes

(167 bytes bzip2, for comparison's sake)

Yes, I know this is old and been over for a while, but I finally had time to do what I said in my comment on the SVG + bzip2 example.

Here's just plain SVG, golfed down by hand as much as I can. UTF-8 is the default, which means this each character is one byte:

<svg xmlns="http://www.w3.org/2000/svg"><rect fill="#fff" width="99" height="99"/><text fill="blue" y="99"><tspan fill="red">I</tspan> V<tspan fill="red">o</tspan>t<tspan fill="red">e</tspan>d</text></svg>

Problem is, there is no default font or text size for SVG, so I had to just guess a reasonable number for other elements. The background white rectangle is 99x99 (and the text bottom at y=99) just because that's the largest 2 digit number, and every default font I've seen is at most 2 digits high.

And, while SVG is already an image format, here's a PNG from Wikimedia Commons:

\$\endgroup\$
1
\$\begingroup\$

Ruby, 85 Bytes

UPDATE: Forgot the white background

require"colorize";puts ("I".red+"V".blue+"o".red+"t".blue+"e".red+"d".blue).on_white

Output:

\$\endgroup\$
5
  • 4
    \$\begingroup\$ The challenge also includes “The background must be white (#FFFFFF).” \$\endgroup\$
    – manatwork
    Nov 15, 2016 at 15:29
  • \$\begingroup\$ @manatwork Whoops, thanks for mentioning; fixed it. \$\endgroup\$ Nov 16, 2016 at 15:41
  • \$\begingroup\$ Uhm… .colorize(:background=>:white).on_white? \$\endgroup\$
    – manatwork
    Nov 16, 2016 at 15:45
  • \$\begingroup\$ By the way, if you count 61 byte code $><<("I ".red+?V.blue+?o.red+?t.blue+?e.red+?d.blue).on_white + 11 byte command line option -rcolorize , it looks less lengthy. \$\endgroup\$
    – manatwork
    Nov 16, 2016 at 15:53
  • \$\begingroup\$ Welcome to PP&CG stack exchange! \$\endgroup\$
    – tuskiomi
    Nov 17, 2016 at 15:36
1
\$\begingroup\$

OCL 2, 96 bytes

ShowCanvas
setFillColor 255 0 0
DrawText 0 9 "I  o e"
setFillColor 0 0 255
DrawText 4 9 "V t  d"

I'm a bit late for this, but I think I did alright. I've tried optimizing it, but I literally can not find any way of making it shorter, despite it looking very optimizable.

\$\endgroup\$
0
\$\begingroup\$

Decimal, 108 88 bytes

Saved 20 bytes by reusing resources (manipulating stack instead of pushing ANSI colors repeatedly)

13027091051049109D13027091051052109D00D301I12032D301201D301V00D301o01D301t00D301e01D301d

Try it online! Be warned that the online version displays raw ANSI escape sequences and not the actual colors. Ungolfed and commented:

13027091051049109D     ; push STRING "ESC[31m" (idx 0)
13027091051052109D     ; push STRING "ESC[34m" (idx 1)
00D301I                ; set DSI to 0, print, print I
12032D3012             ; push CHAR ' ', print, pop
01D301V                ; set DSI to 1, print, print V
00D301o                ; set DSI to 0, print, print o
01D301t                ; set DSI to 1, print, print t
00D301e                ; set DSI to 0, print, print e
01D301d                ; set DSI to 1, print, print d

How it works:

  • ESC[31m is the ANSI color code to set the foreground output color to red.
  • ESC[34m is the ANSI color code to set the foreground output color to blue.
  • Decimal automatically prints every non-Decimal character in the source (I,V,o,t,e,d)
\$\endgroup\$
0
\$\begingroup\$

SmileBASIC 3, 57 bytes

GCLS-1GPUTCHR.,.,"I  o e",#RED
GPUTCHR.,.,"  V t d",#BLUE

In recognition of the upcoming US midterm elections.

\$\endgroup\$
0
\$\begingroup\$

Rust, 61 bytes

fn main(){print!("[47;31mI[34m V[31mo[34mt[31me[34md")}

Since the code above contains unprintable bytes, here's a reversible hexdump:

00000000: 666e 206d 6169 6e28 297b 7072 696e 7421  fn main(){print!
00000010: 2822 1b5b 3437 3b33 316d 491b 5b33 346d  (".[47;31mI.[34m
00000020: 2056 1b5b 3331 6d6f 1b5b 3334 6d74 1b5b   V.[31mo.[34mt.[
00000030: 3331 6d65 1b5b 3334 6d64 2229 7d         31me.[34md")}
\$\endgroup\$
0
\$\begingroup\$

CodingLang, 136 bytes

(I )>b(color:red)@style(V)>b(color:blue)@style(o)>b(color:red)@style(t)>b(color:blue)@style(e)>b(color:red)@style(d)>b(color:blue)@style

Try it!(code needs to be pasted)

I'm not sure how classes and stuff work in this. If someone else knows how to use predefined classes repeatedly, it would save a lot of bytes.

Please do vote this year!

\$\endgroup\$
0
\$\begingroup\$

SmallBasic, 244 bytes

s="IVoted"
For i=1 To 7
x=Text.GetSubText(s,i,1)
If Math.Remainder(i,2)=0 then
If i=2 then 
TextWindow.Write(" ")
EndIf
TextWindow.ForegroundColor="Blue"
TextWindow.Write(x)
Else
TextWindow.ForegroundColor="Red"
TextWindow.Write(x)
EndIf
EndFor

This is also self explanatory. It changes console colors at even and odd character in the string, plus insert a space after first char.

I wish I could use With here....

\$\endgroup\$
0
\$\begingroup\$

PostScript, 157 bytes

Code (compressed):

0 0 moveto/Courier 72 selectfont 1 0 0 setrgbcolor/i true def{pop 73 eq{30 0 rmoveto}if i{0 0 1}{1 0 0}ifelse setrgbcolor/i i not def}(IVoted) kshow showpage

Code (uncompressed, with comments):

0 0 moveto
/Courier 72 selectfont
1 0 0 setrgbcolor     % red
/i true def
{
    pop
    73 eq {           % 'I' ?
        30 0 rmoveto  % insert space
    } if
    i {
        0 0 1         % blue
    }{
        1 0 0         % red
    } ifelse
    setrgbcolor
    /i i not def      % toggle i
} (IVoted) kshow
showpage

Result:

result

\$\endgroup\$
0
\$\begingroup\$

Julia, 50 bytes

print.("\e[47;$(34-3Int(c)%6)m"*c for c="I Voted")

(Don't) Try it online!

image in REPL

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.