# GO OUT AND VOTE

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:

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.

The shortest answer in bytes wins.

• A bit disappointed my actual sticker doesn't look like yours. Nov 8, 2016 at 13:52
• "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." :/ Nov 8, 2016 at 14:05
• @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. Nov 8, 2016 at 14:13
• If it helps anyone, vowels are red, consonants are blue. Nov 8, 2016 at 15:09
• @mbomb007 Or more usefully, the letters with odd code points are red, and the letters with even code points are blue. Nov 8, 2016 at 15:15

# 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:

# 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!

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.

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

# Bash, 61 bytes

b="\e[34m";r=${b/4/1};echo -e${r}I ${b}V${r}o${b}t${r}e${b}d  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

• Could you set the background to white, please? Nov 8, 2016 at 20:23
• @PaŭloEbermann , done
– Baba
Nov 8, 2016 at 20:39
• oddly, in my terminal program (ROXTerm), the first one is on a white background, while the second one has a slightly light grey background. Nov 9, 2016 at 11:21
• @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. Nov 9, 2016 at 18:32

# Processing, 8385 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)


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

## Quake 3/Live Colour Codes (19 characters)

^1I ^4V^1o^4t^1e^4d

• Add an image showing your output Nov 10, 2016 at 14:37

# Emmet, 496261 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:

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

• That's a cool approach. Unfortunately, I don't think it counts. The OP specified that is not allowed Nov 8, 2016 at 21:14
• I managed to miss that, removed links and added 13 bytes. Nov 8, 2016 at 21:24
• OK, thanks. BTW, welcome to the site! Nov 8, 2016 at 21:25
• 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! Nov 8, 2016 at 21:37
• 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. Nov 8, 2016 at 21:46

# 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"

# 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


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.)

• My comment is valid for this one too. Nov 10, 2016 at 10:09
• @manatwork, thanks! See any other way to reduce it down? Nov 10, 2016 at 10:19
• 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. Nov 10, 2016 at 10:28
• @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! Nov 10, 2016 at 11:01

# 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.

# 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.!'@


# 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

# Python 2 (or 3), (75 bytes)

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.

• 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. Sep 6, 2017 at 13:13

## C#, 262201180170 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:

• 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. Nov 11, 2016 at 12:32
• @LinkNg Managed to save even more thanks to that, a whole lot more now Nov 11, 2016 at 12:41

# Befunge, 47 bytes

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


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

## Bash, 51 bytes

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


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.

# Geometry Dash, 2 objects/276 bytes

Raw text that the level is stored as:

H4sIAAAAAAAAE6WPzQrCMBCEX2iFnc1PU8RDexGPUvC66EWkvoDgw5tkKyJYtHjIDJlhPpJxcImgEoJKVVcVFsEyWOh1BY0KZtZGoQhFkrImxR3ZJZfyGwL_I9qPiIVfES37TyDIC8TfMGEWw0teE2cwNHZwxMWCWTTzlDVSLseusWiyVGxwbb1JVSPUovNVrQWbgXgNajNUCDGQI3CgNuPJo0gGHHEsB-RAw9CdT7f--hqlZhoJ8vU5WkHedodLz7vtfrN-APfUD_t-AgAA


Level editor

Object count in the top-left

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).

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

# 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

• +1 just for the absolutely abstract choice of "language" May 21, 2021 at 1:43

# 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!)

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

# 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).

# 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.

# 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:

# 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:

• The challenge also includes “The background must be white (#FFFFFF).” Nov 15, 2016 at 15:29
• @manatwork Whoops, thanks for mentioning; fixed it. Nov 16, 2016 at 15:41
• Uhm… .colorize(:background=>:white).on_white? Nov 16, 2016 at 15:45
• 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. Nov 16, 2016 at 15:53 • Welcome to PP&CG stack exchange! Nov 17, 2016 at 15:36 # 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. # 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) # SmileBASIC 3, 57 bytes GCLS-1GPUTCHR.,.,"I o e",#RED GPUTCHR.,.," V t d",#BLUE  In recognition of the upcoming US midterm elections. # 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")}  # 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! # 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.... # 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: # Julia, 50 bytes print.("\e[47;$(34-3Int(c)%6)m"*c for c="I Voted")


(Don't) Try it online!