# 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. – Geobits Nov 8 '16 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." :/ – Michael Yaeger Nov 8 '16 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. – Calvin's Hobbies Nov 8 '16 at 14:13
• If it helps anyone, vowels are red, consonants are blue. – mbomb007 Nov 8 '16 at 15:09
• @mbomb007 Or more usefully, the letters with odd code points are red, and the letters with even code points are blue. – Sp3000 Nov 8 '16 at 15:15

## Minecraft Chat (vanilla 1.10 client, spigot 1.10 server): 19 bytes

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


or from the clientside:

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


Minecraft uses a color coding system with these colors programmed in.

Mind the rules:

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

All of these are true, as:
the red and blue ARE approximations (though still very similar).
The background in Minecraft chat is transparent, meaning that it's possible to put this on a white background (such as an empty world or a world which is still generating).

• Wow. I'm speechless. That's a very clever answer! – James Nov 8 '16 at 17:58
• I don't think Minecraft Chat is Turing-complete or considered a programming language (although this may no longer be a requirement). Very creative though! :) – Kade Nov 8 '16 at 17:58
• @Shebang gaming.stackexchange.com/questions/20219/… Minecraft chat has (nearly) all the same commands as command blocks, and certainly all the commands from back when the question was asked :-) – tuskiomi Nov 8 '16 at 17:59
• Technically, in vanilla Minecraft, the &s should be §s – Oliver Ni Nov 8 '16 at 23:33
• Hmmm I think it can be done in Quake 3, too – Display Name Nov 9 '16 at 8:58

# C, 82807874 54 bytes

Thanks to @WillihamTotland and @criptych for saving 2 bytes each!

f(){puts("␛[47;31mI␛[34m V␛[31mo␛[34mt␛[31me␛[34md");}


Where the ␛s represent 0x1B bytes (escape key). As this code contains unprintable control characters, here is a reversible hexdump:

00000000: 6628 297b 7075 7473 2822 1b5b 3437 3b33  f(){puts(".[47;3
00000010: 316d 491b 5b33 346d 2056 1b5b 3331 6d6f  1mI.[34m V.[31mo
00000020: 1b5b 3334 6d74 1b5b 3331 6d65 1b5b 3334  .[34mt.[31me.[34
00000030: 6d64 2229 3b7d                           md");}


Output on my phone:

• @KritixiLithos that line defines a as "\x1B[%dm", which is an ANSI escape sequence for coloring, with a placeholder. The numbers in printf() fill those placeholders. – betseg Nov 8 '16 at 13:49
• Two bytes can be shaved off by replacing a with "\x1B[47;31m" and defining b to "\x1B[34m", then using puts with alternating a and b prefixes. – Williham Totland Nov 9 '16 at 12:35
• You can save another 2 bytes with "\33" instead of "\x1B". – criptych stands with Monica Nov 9 '16 at 16:46
• Extending what criptych said, I don't know if this is allowed, but you'd save another four bytes by using a literal escape character instead of \33. Not sure what the C standard thinks of that... – user61954 Nov 10 '16 at 6:41
• @paxdiablo according to this meta thread, functions are OK for code golf. – betseg Nov 11 '16 at 4:57

# Google Blockly, 10 14 blocks, 2841 35 blytes

### Output

Try it here

Not counting the hide turtle block because it's just aesthetics.

A blyte is a combination of a block and a byte, there's no meta post yet as how to count this, but I'll create one later. As for now, this is how I count:

• I o e, 8 blytes
• V t d, 10 blytes (2 leading spaces here)
• Colours, 1 blyte each, 2 total
• 90, 2 blytes
• 999, 3 blytes
• 0, 1 blyte
• turn right, 2 blytes
• move forward, 2 blytes
• normal blocks, 1 blyte each, 5 total

Since Google Blockly is rarely used for golfing and I'm thinking waaay outside of the box for this challenge, I hope this is a valid submission.

• For the record this is valid. It's nice to see unique languages. Though, unless there's a meta concensus on byte-counting in Google Blockly, I may ignore it when selecting a winner. – Calvin's Hobbies Nov 8 '16 at 14:47
• You may find discussion here relevant. CC @HelkaHomba. – Scimonster Nov 8 '16 at 21:45
• Have you though about replacing those three spaces in I o with two em spaces? – Andrea Lazzarotto Nov 11 '16 at 17:21
• Google Blockly will be translated to JavaScript and then run. You need to Inspect Element and run code in Blockly API to get the real JavaScript code. – user61451 Nov 13 '16 at 14:27
• Wait so could Scratch be used? – Adamawesome4 Nov 15 '16 at 22:30

# HTML, 52 bytes

I <c>V<e>o<c>t<e>e<c>d<style>*{color:red}c{color:0ff

• Also, I think that #FF0000 -> #F00 and #0000FF -> #00F works – Conor O'Brien Nov 8 '16 at 13:22
• Why not turn this into a Stack Snippet? – Neil Nov 8 '16 at 13:35
• <r>I <c>V<r>o<c>t<r>e<c>d<style>r{color:red}c{color:blue works – ASCII-only Nov 8 '16 at 13:35
• actually you can just keep nesting without closing I <c>V<e>o<c>t<e>e<c>d<style>*{color:red}c{color:0ffand note change to blue 0ff – user21677 Nov 8 '16 at 14:17
• Sadly the current version doesn't seem to work as a Stack Snippet, the latest version that works for me is the c{color:blue} version. – Neil Nov 9 '16 at 9:39

# LaTeX, 147 126 bytes

\documentclass{proc}\input color\begin{document}\def\z{\color{red}}\def\y{\color{blue}}\z I \y V\z o\y t\z e\y d\end{document}


Saved 21 bytes and got better kerning thanks to @AndreïKostyrka.

This prints an a4 page with this on the first line (note that this also prints page 1 on the bottom):

• I would have thought LaTeX would typeset the Vo kerning prettier... But apparently it considers each letter separately due to the colours. – Sanchises Nov 8 '16 at 17:21
• @sanchises Since each letter is in a separate command, I think it destroys proper kerning. – Fatalize Nov 8 '16 at 18:30
• Yeah exactly. Although I'm sure it would be possible somehow if golfing was not a requirement. – Sanchises Nov 8 '16 at 19:09
• @sanchises this is definitely possible, but this is indeed longer than this ugly solution. – Fatalize Nov 8 '16 at 19:12
• \documentclass{proc}\input color\begin{document}\def\z{\color{red}}\def\y{\color{blue}}\z I \y V\z o\y t\z e\y d\end{document} saves 21 bytes and results in 126 bytes of pure typographical beauty. – Andreï Kostyrka Nov 9 '16 at 9:39

## Windows 10 Batch, 51 50 bytes

@color fc&echo I ␛[94mV␛[91mo␛[94mt␛[91me␛[94md␛[m


Where ␛ represents the ANSI Escape 0x1B character. Outputs using colour formatting. Edit: Saved 1 byte thanks to @brianush1. I tried writing the code to generate this but it took 97 bytes. Output:

• You can golf it down by 1 byte if you use @color fc&echo I... – brianush1 Nov 9 '16 at 2:51
• interesting, I didn't realise Windows terminal supported ANSI escape sequences – Mark K Cowan Nov 9 '16 at 15:40
• @MarkKCowan It's only Windows 10, and (I think!) post Redstone Update. It's one of the few things that stop me from just installing XP over it. – wizzwizz4 Nov 9 '16 at 19:16
• @wizzwizz4 ConEmu supports these too :) Indeed this is from Windows 10 anniversary (ie redstone 1) – Asu Jan 24 '19 at 7:43
• @Asu I installed XP over it. – wizzwizz4 Jan 24 '19 at 7:43

# JavaScript, 71 bytes

console.log('%cI %cV%co%ct%ce%cd',r='color:red',b='color:blue',r,b,r,b)


Makes use of console.log's ability to print in color. Doesn't work in a stack snippet so you should paste this answer to the console to test it.

Picture credits to @Mast

• That's exactly what I just came up with, haha. I think the shortest alternative would be console.log([...' I Voted'].join%c,r='color:red',r,b='color:blue',r,b,r,b) – ETHproductions Nov 8 '16 at 15:33
• Doesn't work in Node.js either. :( – Jordan Nov 8 '16 at 17:02
• I was surprised this actually works, but it does. – Mast Nov 8 '16 at 19:58

# R, 113 85 81 74 73 55 bytes

Edit: Saved a bunch of bytes thanks to @rturnbull and @JDL

plot(8:1,0:7*0,pc=el(strsplit("detoV  I","")),co=2:1*2)


The size of the output (and spacing etc) depends on the resolution of the currently open graphics device. Tested in RGui and RStudio on my monitor and produces:

• Oh, I've never seen el() before. Thanks for helping me learn more R! Since text is vectorized, you can skip the for-loop and just write: text(seq(.3,.6,.05),.5,s,col=c("red","blue")). (I modified your x positions for golfier code, although the spacing may be a little less neat.) – rturnbull Nov 8 '16 at 15:03
• Also, thanks to partial argument matching you can use co= rather than col=. And finally, 6:12*.05 is several bytes shorter than seq(.3,.6,.05). – rturnbull Nov 8 '16 at 15:17
• Good catch! And now I realize that 6:12/20 is of course 1 byte shorter than 6:12*.05, apologies for leading you astray and suggesting suboptimal edits. – rturnbull Nov 8 '16 at 15:26
• Aren't the colours off? Shouldn't the "I" and "V" be different colours? – JDL Nov 8 '16 at 15:37
• I'm pretty sure el() improves 99% of all previous strsplit answers by 1 byte. – Vlo Nov 8 '16 at 20:44

## LÖVE, 152 142 136 bytes

Let's show some löve for a fun little prototyping language! It's not perfect for the task of golfing (c'mon, it's LUA based), but it's easy to write.

function love.draw()l=love.graphics
a=255
l.setBackgroundColor(a,a,a)s=l.setColor
p=l.print
s(a,0,0)p('I   o e')s(0,0,a)p('  V  t d')end


Screenshot:

Fully ungolfed version:

function love.draw()
love.graphics.setBackgroundColor(255,255,255)
love.graphics.setColor(255,0,0)
love.graphics.print('I   o e')
love.graphics.setColor(0,0,255)
love.graphics.print('  V  t d')
end

• I löve that you used something other than Java. – AdmBorkBork Nov 8 '16 at 14:24
• So many 255… A variable for them? – manatwork Nov 8 '16 at 15:46
• @ConorO'Brien This is a full program. love.draw() is a built-in function that you override, which runs on the draw step. There's also things like love.update() and love.load() for various parts of the render loop, but they're optional. It's a nice language, and you can get started with it very easily. I sometimes use it to prototype game ideas. – Geobits Nov 8 '16 at 16:01
• @cat They just don't. It's not like I'm overprinting them on a console, it's a graphical print. So a space here is just "paint nothing in this area", not "paint this area background colored". – Geobits Nov 9 '16 at 2:50
• @ZoltánSchmidt Thanks! There are a few other LÖVE answers, if you want to take a look through them :D – Geobits Nov 12 '16 at 21:46

## Hot Soup Processor, 48 bytes

color 255
mes"I  o e
pos,0
color,,-1
mes"  V t d


The ungolfed version is:

color 255,0,0
mes "I  o e"
pos 0,0
color 0,0,255
mes "  V t d"


If you bear in mind that mes (message) is HSP's echo, I think this is fairly readable.

Weirdly, if you try to do pos or pos,, the blue line doesn't overwrite the red line and appears beneath it. Even weirder, color is only meant to take values in 0-255, but 0,0,-1 works for blue, 0,-1,0 works for green and -1,0,0 works for... black? (-257,0,0 and 511,0,0 work for red though, so something's funky about the mod 256 going on)

• Why don't the spaces in the second mes overwrite the first? – cat Nov 9 '16 at 2:51
• @cat Spaces don't actually draw anything, it just advances the cursor position in a sense – Sp3000 Nov 9 '16 at 3:41
• Clever using -1 for 255. Have a +1 – Cyoce Nov 10 '16 at 1:44
• @Cyoce Or maybe it's actually -255? – sagiksp May 25 '17 at 12:02

## MATLAB, 74 bytes

We create a white 50x50 (one column for each state) background using imshow of an array of ones. We then display a text, using my trick of shortening property names to get the colours. Since the default font is not fixed width, the text is padded with spaces.

imshow(ones(50))
text(2,9,'I   o e','Co','r')
text(8,9,'V  t  d','Co','b')


### MATLAB, 99 bytes, fixed width font

The first version uses fiddling with spaces and coordinates to get a proper kerning on the default font, and might not display properly on your computer. Instead, we can use a fixed width font, like Courier (or, for some more bytes, FixedWidth which works on any system that has a fixed width font installed). This does come at the cost of quite a few extra bytes. We can mitigate this slightly by using a for loop to print the text. The text and corresponding colours are stored in a cell array. The background needs to be a little bit larger.

imshow(ones(80))
for y={'I  o e ','  V t d';'r','b'}
text(9,9,y{1},'Co',y{2},'FontN','Courier')
end


### Matlab, 80 bytes bonus edition

Sadly, underlined blue text is not allowed. Otherwise, this answer would have highlighted some interesting behaviour in MATLAB. You can print red text using fprintf(2,txt), and you can print blue underlined text with fprintf('<a href="">txt</a>'). Combining this works... sometimes. Completely at random, it may also create red underlined text. You can issue drawnow between consecutive f calls if this is the case on your system.

f=@(p)fprintf(2,'%s<a href>%s</a>',p(1:end-1),p(end));f('I V');f('ot');f('ed');fprintf('\n')


• You can write <a href> instead of <a href="">. If you don't like it, you can use <a href=#>. – Ismael Miguel Nov 10 '16 at 19:28
• @IsmaelMiguel Clever. <a> didn't work. – Sanchises Nov 10 '16 at 21:37
• Using only <a> isn't considered a clickable link. to get it's blue color, it has to be considered as one. In CSS, the selector may be a[href]. As long as the attribute href is there, it is a clickable link. That's why using only <a> won't work. – Ismael Miguel Nov 11 '16 at 8:58

# ImageMagick, 102 bytes

magick xc:[x60] -fill red -draw 'text 5,30 "I     o  e"' -fill blue -draw 'text 15,30 "V   t   d"' x:


Ungolfed:

magick convert canvas:white[60x60!] \
-fill red  -draw 'text 5,30   "I     o  e"' \
-fill blue -draw 'text 15,30      "V   t   d"' \
show:


Golfing the full ImageMagick command consisted of

• not explicitly calling the default convert utility

• using xc: instead of canvas: (xc: is an old synonym for canvas:; I don't foresee ImageMagick ever eliminating it)

• not specifying the canvas color but relying on ImageMagick's default, which happens to be white

• removing the width 60 from the geometry (when it's omitted, width==height)

• removing the "!" from the geometry which is only needed to produce a non-square canvas, like canvas:white[60x30!]

• using the older x: instead of show: as the output file (assumes that ImageMagick was built with X support)

• removing some whitespace that I had used to line up the text strings

• joining the multiple lines of the command (removed the backslash-CR between lines)

If you are so inclined after the election, add 12 bytes -rotate 180 preceding the show: directive:

• I love how the ungolfed version drastically differs from the golfed one. – Andreï Kostyrka Nov 11 '16 at 13:25

# Bash, 35 bytes

My script looks like this

echo "^[[47;31mI hope^[[34md^H^H^Ht^H^H^Hv"


xxd of script file:

0000000: 6563 686f 2022 1b5b 3437 3b33 316d 4920  echo ".[47;31mI
0000010: 686f 7065 1b5b 3334 6d64 0808 0874 0808  hope.[34md...t..
0000020: 0876 22                                  .v"

Typing it: ctrl-v-esc and ctrl-v-h will insert the escapes and backspaces (^[ and ^H).

• How does this work? An explanation would be super – cat Nov 9 '16 at 19:16
• @cat it appears to write all the red letters (with "h" and "p" as stand-ins), then sets the colour to blue and writes "d" at the end. Finally it moves the cursor left to add the "t" and "V" over the earlier stand-ins (ascii 0x08, represented by "^H" in the display above, moves left 1 character). Clever way of avoiding lots of escape sequences for colour changes. It also uses a literal escape character (0x1B, represented as "^[") which saves some space compared to similar answers like mine. – Dave Nov 9 '16 at 22:29
• Also: could save 3 bytes by assuming the terminal is set to a white background by default (most other terminal answers already assume this). – Dave Nov 9 '16 at 22:31
• You can save a byte by removing the two quotes and adding a backslash (escape character) before the semicolon. Also your script has a lower case v (your command line one is fine). – user56228 Nov 11 '16 at 5:08

# Mathematica (REPL image output), 65 49 bytes

Overlay@{"I  o e"~Style~Red,"  V t d"~Style~Blue}


Graphical REPL expression.

• "Private use?" What is that? – Conor O'Brien Nov 8 '16 at 13:14
• @ConorO'Brien enwp.org/Private_Use_Areas – LegionMammal978 Nov 8 '16 at 13:15
• This is 49 bytes: Overlay@{"I o e"~Style~Red," V t d"~Style~Blue} (there are supposed to be two spaces between I and o and before V) – Gerli Nov 11 '16 at 10:01

# Java, 322319318309304229 217 bytes

-9 Bytes thanks to kevin.
-75 Bytes thanks to Angzuril, nice callout on the old awt classes, always forget those exist.
-12 Bytes thanks to user902383.

import java.awt.*;
void n(){new Frame(){{add(new Panel(){public void paint(Graphics g){int i=0;for(String c:"IVoted".split("")){g.setColor(i%2<1?Color.RED:Color.BLUE);g.drawString(c,i++*8,10);}}});setVisible(0<1);}};}


Output:

• JFrame j= can be golfed to Frame j=; (c==' '||i++%2==0)? can be golfed to c<33|i++%2<1? and true can be golfed to 1>0. Also, @HelkaHomba, is this a valid output? Since it also has spaces between the V o t e d? Oh, and why 0,0,999,99? 0,0,99,99 is large enough for the text on my screen. – Kevin Cruijssen Nov 8 '16 at 14:46
• (c<33||i++%2<1)? can stil be golfed by three bytes by removing the parenthesis and change || to | – Kevin Cruijssen Nov 8 '16 at 15:25
• I found some more things to golf: new JComponent to new Container (-1); remove char c="IVoted".charAt(i); and change g.drawString(c+"" to g.drawString("IVoted".charAt(i)+""(-8). – Kevin Cruijssen Nov 9 '16 at 12:52
• First improvement, change Frame j=new JFrame();j.add(new JComponent() to Frame j=new Frame();j.add(new Container() and you can also drop the import import javax.swing.*; and g.setColor(Color.WHITE);g.fillRect(0,0,99,99) as a result (-63) – Angzuril Nov 10 '16 at 17:20
• void n(){new Frame(){{add(new Panel(){public void paint(Graphics g){int i=0;for(String c:"IVoted".split("")){g.setColor(i%2<1?Color.RED:Color.BLUE);g.drawString(c,i++*8,10);}}});setVisible(0<1);}};} allows you to reduce by 12 bytes – user902383 Nov 11 '16 at 22:26

# Bubblegum, 28 bytes

0000000: 938e 3636 ccf5 0492 e6b9 0a40 d224 370c  ..66.......@.$7. 0000010: 2c92 0f66 9780 d9a9 6076 0a00 ,..f....v..  Does not work online since it uses ANSI color codes for coloring. • Is this a straight-up encoding, or is does it employ some other clever trick? – Conor O'Brien Nov 8 '16 at 15:56 • @ConorO'Brien There is no such thing as clever tricks in Bubblegum. To be honest, this answer was mostly a side-effect of the actual answer I'm working on. – a spaghetto Nov 8 '16 at 15:57 ## PowerShell v2+, 715957 55 bytes "I Voted"[0..6]|%{Write-Host -b w -n -f (9,12)[$_%2]$_}  Saved two bytes thanks to @flashbang ... saved two more thanks to @ConnorLSW Takes "I Voted" and turns it into a char-array, then loops |%{...}. Each letter, we execute Write-Host with the -background color to White, -noNewLine, and the -foreground color to be the appropriate index. This leverages the fact that odd ASCII values are Red, while even ASCII values are Blue via $_%2 as the index.

Console colors in PowerShell are very limited, so this is the closest approximation I could get. It would be golfier to use 4 (DarkRed) for the red, but it doesn't look right, so I'm sacrificing a couple bytes for the sake of color accuracy.

Below is the output, followed by the 16 available colors the console can display. Note that the background isn't truly white, since Microsoft in their wisdom opted to have the background colors ever-so-slightly-off from the foreground colors.

• IIRC, in ancient stuff, you had 4 bits for the foreground and 3 bits for the background, so backgrounds could only be the 'dark' colors 0-7. Is the console still following that? – user16488 Nov 8 '16 at 14:39
• @Hurkyl Kinda. It appears to be based on the EGA color palette, but I'm not sure the historical reasons for PowerShell keeping that scheme. Likely something buried in the Win32 API backwards-compatibility that forced them to only use those 16 colors. – AdmBorkBork Nov 8 '16 at 15:03
• It doesn't work if you set the background color to 15? – Random832 Nov 9 '16 at 7:21
• @Random832 it is for the sake of the white background of the sticker. – geisterfurz007 Nov 9 '16 at 9:43
• @geisterfurz007, TimmyD, I was asking if you could set the background to "15" rather than "white" [since the actual background in your image appears to be #7] to get a brighter white. But on looking at it more, your whole display looks strange - the borders between the lines in your example and the gray line between "I" and the following space don't make sense if PowerShell is being run in the console - are you using some other tool like ConEmu? If so it doesn't make sense to blame Microsoft for this. – Random832 Nov 9 '16 at 14:39

# Python, 91 bytes + termcolor

Not gonna win, but posted it for fun.

from termcolor import*
for c in'I Voted':cprint(c,'brleude'[ord(c)%2::2],'on_white',end='')


Half the credit goes to Sp3000.

• Using ANSI codes should be shorter – TuxCrafting Nov 8 '16 at 13:32
• @TùxCräftîñg It isn't supported on all platforms, i.e. Windows. – Kade Nov 8 '16 at 13:34
• Mind adding an image? – Calvin's Hobbies Nov 8 '16 at 13:36
• You can save 5 bytes by changing 'blue' if c else 'red' to 'brleude'[c^1::2]. – Kade Nov 8 '16 at 13:37
• You should probably put + termcolor in the title since it's not a standard module. Also: from termcolor import*\nfor c in'I Voted':cprint(c,'brleude'[ord(c)%2::2],'on_white',end='') – Sp3000 Nov 8 '16 at 13:45

# Jolf, 53 bytes

"<z>I <w>V<z>o<w>t<z>e<w>d<style>w{ΞΩ4blue}z{ΞΩ4red


There are unprintables. Try it here!

Jolf's output is HTML capable. I tried doing something clever like modulus 2 to decide color, but that only wound up longer (around 69 bytes). So, the output is in HTML.

Output:

(larger version)

• This is terrible you've only saved three bytes over HTML :P – ASCII-only Nov 8 '16 at 13:41
• @EriktheGolfer It really only works in firefox. – Conor O'Brien Nov 8 '16 at 15:28
• @ConorO'Brien Oh, I use Chrome. Thanks. – Erik the Outgolfer Nov 8 '16 at 15:32
• ...aand the HTML answer outgolfed this. – betseg Nov 8 '16 at 21:05
• Can't blue be written as 00f? – Ismael Miguel Nov 10 '16 at 19:20

# Python, 99 87 bytes

from turtle import*
up()
for c in"I Voted":color("brleude"[ord(c)%2::2]);write(c);fd(7)


Try it online

• Mind adding an image? – Calvin's Hobbies Nov 8 '16 at 22:32
• @HelkaHomba All you need to do it click the link. – mbomb007 Nov 8 '16 at 22:56

# sh, 61 49 bytes

echo "[47;31;1mI [34mV[31mo[34mt[31me[34md"


Because this contains unprintables, here is a reversible xxd hexdump:

00000000: 6563 686f 2022 1b5b 3437 3b33 313b 316d  echo ".[47;31;1m
00000010: 4920 1b5b 3334 6d56 1b5b 3331 6d6f 1b5b  I .[34mV.[31mo.[
00000020: 3334 6d74 1b5b 3331 6d65 1b5b 3334 6d64  34mt.[31me.[34md
00000030: 22                                       "

Xterm(322)

Thanks to 4198 (manatwork) for -12 bytes.

• Why setting the background and foreground colors separately? Start it with [47;31;1m. And the 1 for bold persists until a 0, so no need to set it again and again for each letter. – manatwork Nov 8 '16 at 15:56
• @manatwork Oh god, I thought you have to re-set it! – Erik the Outgolfer Nov 8 '16 at 16:00
• If that sh is anything more modern than the old Bourne shell, some parameter expansion may help: s=":1;47;1mI :4mV:1mo:4mt:1me:4md";echo ${s//:/^[[3}. – manatwork Nov 8 '16 at 16:06 • @manatwork It does not work. It seems it's not more modern. – Erik the Outgolfer Nov 8 '16 at 16:07 • @manatwork ${VAR/FROM/TO} requires ksh93, bash or zsh, not just “anything more modern than the old Bourne shell”. POSIX requires the # and % parameter expansion modifiers but not /…/ or :…: – Gilles 'SO- stop being evil' Nov 8 '16 at 21:05

# SVG + bzip2, 1807 bytes

A vectorized version of the example image, then compressed with bzip2 to about half (4385 -> 1807 bytes). You can download it here. (direct GitHub Pages link)

BZh91AY&SY!�l�ß�x��>�ߠ/���    0����Ҁ�D�5��ޠII�T񡤙�O!45J??��i�@JzH���
.�M�&�Q�vا����bB���� �쾾�4AV�8�8���)Z�ޣ�j�q}�����?�t�/
�±%��"A����B�X�(␌�[⎺;Z/┐├*��%�␤�       I���Uƒ�Y�9ǝK���B��┤�=���±?�W���
��ڰj�?�H��\����^��m�=X�d���>�!C�@�.���9�" DZ+��V1+�;�����58Q���-:�5,HDQŧA>����W�+h��>m��G�m�uWv�&�U�|mq�u���?=S�\{(��Z�a�I��G{Cd��;Bz���qX7��?P�@�Jt[w�]����%W���37f���-񴁭�iԳ]c��|�;i�k�H��
sHz��Y�$�.�*�?�ڐ��Us=\뫅6%�Ud�9w���D ��H��^�Q��P��%n�O����l��+*q�U�"F%��*� *b�� @mP���Z�(ZL bIv⦳�~�F=��>H�Ti����0@≠R≥��T�E��┴��D����␍│��2*◆=└6&⎽M�◆␊?�/�U�����r�.�gƅ���E'��^��ILPz@���zR&u$��l^�U�n�'O\�Xj+چ�o�*�O�w��JP8���]���r��k=��N�b�ƵpM�8|���=7���N��W�M(����*�E�DݐT��Zi�v"���49�J�0}�F�*x�K���P��⎼*�������6[G,4� ү)UUT␍��%4D��Թ␉��⎻�8�CZ_3ɷwW�9��-&�Ov�a՜
�'ӥtߢ�>��^�m-������c�]:��*��2��촄Ujr�?"�J�"���DE�f?┴⎻��␍3·└���Ԉ��? ׌�5|ᫎ���|DO���%�4ƯW�ƐV/=�]Vgˇ��^Z��cP������.{������6   o.*�sɽ���U?E.3�,�H$�{�? �%�0��2 ��n�C!%�>��]�� #߽v�E��K��?X|���5�ΰ@>A;#J���,��Q��$���ݨ��^����7�g�Xn�k����d욒�fQ/7��vh|�ȥ*^M
�[����׈���i�I��    $��4�� Y��V.��ح��?�eT����5K˱~�瞯r�fL^I �#b�@�pBƞ���V5��a��qH���Ş�t�V3��┌���T���1␉�␍$5��@T␤$�>$����π���S�[۸£�[ȟ␋CO≥�ގ^��>��]E�A��┘���I(�㴨Z�J'��:�-_┤±�K␌�ۓ#:�?m��^�Z�+�����G
�k�t�O��SD�4����^o��Z�n���6M�)!��r��w�3\�R����
�X6<#����.��p� Cj"�2�ĭ�*h�S�}�L���C?�� �چZc'kG��


Not gonna win, but posted it for fun.

• bzip2 is not a programming language. – Peter Taylor Nov 8 '16 at 20:55
• @PeterTaylor Per meta rules, it doesn't have to be a programming language. (meta.codegolf.stackexchange.com/a/10426/41088 – noɥʇʎԀʎzɐɹƆ Nov 8 '16 at 20:56
• should post a reversible xxd of the file – cat Nov 8 '16 at 22:04
• try using brotli for even more compression – Display Name Nov 9 '16 at 9:03
• If you're really interested in golfing this, it would probably make more sense to just create the SVG by hand with a couple text elements set to the right colors. Here's a starting point: <svg xmlns="http://www.w3.org/2000/svg"><text fill="blue"><tspan fill="red">I</tspan> V<tspan fill="red">o</tspan>t<tspan fill="red">e</tspan>d</text></svg> Note that this actually renders it outside the printable area and has no background color. Like I said, it's just a start. – trlkly Nov 9 '16 at 11:45

## C, 65 bytes

i;main(c){for(;c="I Voted"[i++];printf("\33[3%dm%c",c&1?1:4,c));}


or, more accurately:

i;main(c){for(i=90;c="\0.noitcele ym saw ti fi enod evah dluow I sseug I tuB .hsitirB ma I esuaceb ,etov ton did I"[i--];printf("\33[3%dm%c",c&1?1:4,c));}


Uses the same bash colour technique used by betseg, but with the octal escape sequence instead of hex, and with Sp3000's observation that all odd codepoints are red.

Leaves the terminal in blue. Reset with:

printf "\33[0m";

• If || works in C like it does in JavaScript (x||y -> x?x:y), you could do c&1||4 to save a byte. – ETHproductions Nov 8 '16 at 21:45
• @ETHproductions doesn't work that way in C. While || and && are short-circuiting, they always return 1 or 0, regardless of the values involved. – Dave Nov 8 '16 at 21:50
• @Dave I learned something today... – cat Nov 9 '16 at 2:56
• This doesn't set the background color. Also, you could use a literal escape character instead of \33 to save two bytes, if that isn't against the rules somehow. – user61954 Nov 10 '16 at 6:51
• @yellowantphil this assumes the default terminal background is set to white (since the challenge says it just needs to be possible to have it on a white background). In fact in OS X, the terminal is black-on-white out-of-the-box. – Dave Nov 10 '16 at 8:15

# Node, 5755 41 bytes

console.log("q47;91mI  o eHHHHq94mV t d")


Replace each q with the literal byte 1B and H with byte 08 before running.

Here's how it looks in the ConEmu terminal emulator on my Windows computer (zoomed in):

• What terminal emulator is that!? – cat Nov 9 '16 at 19:05
• @cat ConEmu: conemu.github.io – ETHproductions Nov 9 '16 at 20:20

# Python IDLE, 979678 69 bytes

Thanks to DrMcMoylex for shaving off some bytes!

EDIT: Figured out that a direct .write() was 9 bytes shorter

Not really a proper answer, more abuse of a standard theme. IDLE is Python's IDE, and unless it's customized, STDOUT is blue, STDERR is red, and the background is white. So, the following code:

from sys import*
for i in'I Voted':[stdout,stderr][ord(i)%2].write(i)


Prints this:

This works because ord(i)%2 checks the parity of the letter's code point and prints it to ERR/OUT accordingly.

## REBOL, 10090 95 bytes (-7 bytes with REPL for 88)

REBOL[]view layout[style b tt blue white space 0 across b"I"red b b"V"b"o"red b"t"b"e"red b"d"]


In REPL, the initial REBOL[] is not required. That's 7 bytes.

The ungolfed version is:

REBOL[]
view layout[
; by default, tt (text) has a grey background and a 2x2 padding
style b tt blue white space 0
; this one doesn't appear in the golfed version as it's slightly shorter to just manually set red everywhere needed
style r b red

; by default, vertical stack panel
across
r "I"
r
b "V"
r "o"
b "t"
r "e"
b "d"
]


On the left, with "space 0x0" added to each text block, on the right, with the default 2x2 padding.

(source: canardpc.com)

# Perl, 57 + 17 = 74 bytes

Run with -MTerm::ANSIColor

sub c{color$a++%2?blue:red}say c,"I ",c,V,c,o,c,t,c,e,c,d  Your terminal may be blue at the end (append ,c("reset") at the end of the code to restore it to normal). By default, terminals are usually black background, but they can be optionally changed to white, which I personally don't think is cheating. With picture: # PHP, 199201 151 bytes This script outputs image to standard output. Updated thanks to manatwork imagefill($i=imagecreatetruecolor(99,99),0,0,2**24-1);foreach([I,' ',V,o,t,e,d]as$k=>$e)imagestring($i,2,$k*9,0,$e,!$k|$k&1?0xFF0000:255);imagepng($i);


Run it in the command line like this:

php -d error_reporting=0 -r "imagefill($i=imagecreatetruecolor(99,99),0,0,2**24-1);foreach([I,' ',V,o,t,e,d]as$k=>$e)imagestring($i,2,$k*9,0,$e,!$k|$k&1?0xFF0000:255);imagepng($i);" > output.png  Output: • Skip the header() call. Your code works fine run from command line too. As error_reporting's default value not shows notices, is generally acceptable to not quote your string literals. Or if you not like that, str_split("I Voted") is still shorter than enumerating the characters separately. And move the assignment to$i to its first usage. – manatwork Nov 9 '16 at 9:08
• ~2**24 seems to work instead of 0xFFFFFF. Not sure if this is valid for all architectures. If not, 2**24-1 should be portable. – manatwork Nov 9 '16 at 9:19
• @manatwork awesome thanks. That got it down to 152. I tried ~2**24 and 2**24-1 but I got errors. I don't even know how those work. – Kodos Johnson Nov 9 '16 at 18:49
• Probably your PHP is older than 5.6.0: “Added an exponentiation operator (**).” – PHP changelog. Same as pow(), but handier for golfing. pastebin.com/jFn6ahFk – manatwork Nov 9 '16 at 18:57
• Oh I see. Well since php 5.5 seems to be unsupported, I'll use your solution. Now it's 150. Thanks again. – Kodos Johnson Nov 9 '16 at 19:06

# Xamarin.Forms C#, 317 313 bytes

using Xamarin.Forms;public class A:Application{public A(){var s=new StackLayout{BackgroundColor=Color.White,Orientation=(StackOrientation)1,VerticalOptions=LayoutOptions.End};foreach(var c in"I Voted")s.Children.Add(new Label{Text=c+"",TextColor=c%2<1?Color.Blue:Color.Red});MainPage=new ContentPage{Content=s};}}


VerticalOptions=LayoutOptions.End is needed for iOS, otherwise the text will be overlayed by status bar. No problem on Android so can save 34 bytes including comma.

Edit: 2016-11-14: -4 bytes

Ungolfed

using Xamarin.Forms;
public class A : Application
{
public A()
{
// Make a horizontal StackLayout for labels
var s = new StackLayout
{
BackgroundColor = Color.White,
Orientation = (StackOrientation)1,   // StackOrientation.Horizontal
VerticalOptions = LayoutOptions.End
};
foreach(var c in "I Voted")
// Make a new label for each letter, then add to StackLayout
{
// Cast char to string
Text = c + "",
// Happens that 'I', 'o', and 'e' are all odd in ASCII, and 'V', 't', and 'd' are all even :)
TextColor = c%2<1 ? Color.Blue : Color.Red
}
);
// Set app MainPage to be a new ContentPage, where the content is the StackLayout above
MainPage = new ContentPage { Content = s };
}
}

• Well that's a new kind of idea. +1 – Addison Crump Nov 9 '16 at 7:54

# x86 machine code + DOS + BIOS, 25 bytes

Hexdump:

b8 02 13 b1 07 bd 0b 01 cd 10 c3 49 74 20 74 56
71 6f 74 74 71 65 74 64 71


Assembly code (suitable as input to debug.com, so all numbers are hexadecimal):

mov ax, 1302
mov cl, 7
mov bp, 10b
int 10
ret
db 'It tVqottqetdq'


It uses a BIOS routine to output the string to the display memory. The string will appear at a "random" position on screen (see below), like this:

The string contains the letters I V o t e d, interleaved with "attributes"

74 74 71 74 71 74 71


that specify the colour of the letters. Here 7 as the most significant digit means "white background", and the least significant digit specifies the foreground (1=blue; 4=red).

The display position of the string is specified by the dx register. As mentioned here, the initial value of this register is equal to the value of the cs register. And the value of that one is the first available address in memory, after DOS is loaded.

The size of DOS is typically less than 64K, that is, the segment address of the loaded user's program is less than hexadecimal 1000. So the output will appear somewhere around the first 16 lines of text on the display. In my example, it appeared at line 8 (the upper half of dx, called dh, is equal to 8).

The low half of dx, called dl, contains the column at which the text is output. Experiments show that BIOS doesn't check overflow, so it doesn't matter if dx` asks for output at e.g. column 100.

• clever, short, and really intuitive. – tuskiomi Nov 14 '16 at 21:46