# Print a ballot!

As you all know, today is election day!

Your task today is to print out a ballot, given an input.

If the input is Hillary Clinton, print:

Hillary Clinton   ===-----===>
Donald Trump      ===     ===>
____________      ===     ===>


However, if the input is Donald Trump, print:

Hillary Clinton   ===     ===>
Donald Trump      ===-----===>
____________      ===     ===>


If it is something else, write it on the third line:

Hillary Clinton   ===     ===>
Donald Trump      ===     ===>
Oliver Ni         ===-----===>


(Technically, I'm not 18 yet...)

Remember, this is , so the code with the fewest bytes wins.

• No "none of the above option"? :) – Kritixi Lithos Nov 9 '16 at 5:27
• @KritixiLithos Hm, nah... – Oliver Ni Nov 9 '16 at 5:28
• Any max length on the name of "something else"? (There are 18 characters before the first equal sign in your examples) – Link Ng Nov 9 '16 at 6:49
• Is it case sensitive or insensitive? Judging by the test cases I'm assuming sensitive at the moment. – Kevin Cruijssen Nov 9 '16 at 9:37
• @KritixiLithos but that would be rigging the system! – OldBunny2800 Nov 9 '16 at 21:18

# Jelly, 55 53 bytes

³ẇị⁾- x5⁾ =,”=x3¤j;”>ṭ


Try it online!

### Explanation

³ẇị⁾- x5⁾ =,”=x3¤j;”>ṭ   Helper link. Argument: row
³ẇ                       Check if the user's vote is in this row
ị⁾-                    Take "-" if it was, " " otherwise
x5                 Take five of that character
⁾ =,”=           Take the array [" =", "="]
x3         Turn it into ["   ===", "==="]
¤        Combine the two previous steps into a nilad
j       Join the list by the five character string
ṭ   Prepend the original row

“Gụ©l⁴“%eŻƤ(»                   Take the array ["Hillary Clinton", "Donald Trump"]
ṭ                                Add the user's vote to the list
”_                 Take "_"
x12              Take twelve times that
¤             Combine the two previous steps into a nilad
ṭ            Add that string to the list
Q           Remove duplicates
ḣ3         Take the three first items
Z      Transpose back
Ç€    Apply the helper to each row
Y   Join with newlines


## Python 2, 127 bytes

X=['Hillary Clinton','Donald Trump']
i=input()
X+=[[i],['_'*12]][i in X]
for x in X:print x.ljust(18)+'==='+' -'[i==x]*5+'===>'


# 05AB1E, 7459 57 bytes

Uses CP-1252 encoding.

”ŽÏaryµÍ””¹Ñ Trump”I'_12×)Ù3£vyð18yg-×„ -¹yQè5×'=3×.ø'>J,


Try it online!

# Java 7, 390339 335 bytes

String c(String s){String h="Hillary Clinton",d="Donald Trump",r=h+"   ===Q===>\n"+d+"      ===X===>\nZ===J===>";boolean H=h.equals(s),D=d.equals(s);for(int i=s.length();i++<18;s+=" ");return r.replace(H?"Q":D?"X":"J","-----").replace(H|D?"Z":"~","____________      ").replaceAll(H?"X|J":D?"Q|J":"Q|X","     ").replace(H|D?"~":"Z",s);}


Ungolfed & test code:

Try it here.

class M{
static String c(String s){
String h = "Hillary Clinton",
d = "Donald Trump",
r = h+"   ===Q===>\n"+d+"      ===X===>\nZ===J===>";
boolean H = h.equals(s),
D = d.equals(s);
for(int i = s.length(); i++ < 18; s += " ");
return r.replace(H?"Q":D?"X":"J", "-----")
.replace(H|D?"Z":"~", "____________      ")
.replaceAll(H?"X|J":D?"Q|J":"Q|X", "     ")
.replace(H|D?"~":"Z", s);
}

public static void main(String[] a){
System.out.println(c("Hillary Clinton"));
System.out.println();
System.out.println(c("Donald Trump"));
System.out.println();
System.out.println(c("Anyone else?.."));
System.out.println();
System.out.println(c("S"));
System.out.println();
System.out.println(c("Anyone who is willing to take the job"));
}
}


Output:

Hillary Clinton   ===-----===>
Donald Trump      ===     ===>
____________      ===     ===>

Hillary Clinton   ===     ===>
Donald Trump      ===-----===>
____________      ===     ===>

Hillary Clinton   ===     ===>
Donald Trump      ===     ===>
Anyone else?..    ===-----===>

Hillary Clinton   ===     ===>
Donald Trump      ===     ===>
S                 ===-----===>

Hillary Clinton   ===     ===>
Donald Trump      ===     ===>
Anyone who is willing to take the job===-----===>


## JavaScript (ES6), 149 bytes

s=>['Hillary Clinton','Donald Trump',0].map(S=>((S?S:s||'____________')+p+p+p+p+p).slice(0,18)+===${!S^S==s?(s=0,'-----'):p}===>,p=' ').join   ### Demo let f = s=>['Hillary Clinton','Donald Trump',0].map(S=>((S?S:s||'____________')+p+p+p+p+p).slice(0,18)+===${!S^S==s?(s=0,'-----'):p}===>,p='     ').join

console.log(f('Hillary Clinton'))
console.log(f('Donald Trump'))
console.log(f('Obi-Wan Kenobi'))

# V, 104 bytes

OHillary Clinton³ ³=µ ³=>YpRDonald Trump   p15r_ñ/^¨á« á«¾©.*î¨.*î©*\1
22|5r-Gdññ3GjéRDk@"Í_/
22|5r-


Try it online!

This answer is way too hacky, and way too long. I guess that's what you get when you design a golfing-language off of a text-editor. ¯\_(ツ)_/¯

• wait what does O do? It looks like it functions like i – Conor O'Brien Nov 11 '16 at 1:53
• @conor That's correct, they both enter insert mode. The only difference is where in the buffer the cursor starts. There's also iIaAoOsSR that all enter insert mode in some way or another – DJMcMayhem Nov 11 '16 at 1:56

## Batch, 210 bytes

@set s=%1
@call:l %1 "Hillary Clinton"
@call:l %1 "Donald Trump"
@call:l %1 %s%
@exit/b
:l
@set v=
@if %1==%2 set v=-----&set s=____________
@set t=%~2
@echo %t:~0,18%===%v%===^>


Note: the line @set v= has 5 trailing spaces, and the line @set t=%~2 has 18. Accepts input as a quoted command-line parameter.

# C#, 266 Bytes

Golfed:

string B(string s){var h="Hilary Clinton".PadRight(17);var d="Donald Trump".PadRight(17);var r="===     ===>\n";var c=r.Replace(" ", "-");var b="____________".PadRight(17);return s==h.Trim()?s.PadRight(17)+c+d+r+b+r:s==d.Trim()?h+r+d+c+b+r:h+r+d+r+s.PadRight(17)+c;}


Ungolfed:

public string B(string s)
{
var r = "===     ===>\n";
var c = r.Replace(" ", "-");
return s == h.Trim() ? s.PadRight(17) + c + d + r + b + r :
s == d.Trim() ? h + r + d + c + b + r :
h + r + d + r + s.PadRight(17) + c;
}


Tried to create a Func for all those PadRights...Exactly the same byte count...

Testing:

var printABallot = new PrintABallot();
Console.WriteLine(printABallot.B("Hilary Clinton"));

Hilary Clinton   ===-----===>
Donald Trump     ===     ===>
____________     ===     ===>

Console.WriteLine(printABallot.B("Donald Trump"));

Hilary Clinton   ===     ===>
Donald Trump     ===-----===>
____________     ===     ===>

Console.WriteLine(printABallot.B("Kanye West"));

Hilary Clinton   ===     ===>
Donald Trump     ===     ===>
Kanye West       ===-----===>


# Python 3.6, 132 bytes

i=input()
s=['Hillary Clinton','Donald Trump','_'*12]
if x not in s:s[2]=i
for k in s:print(f'{k:18}==={" -"[k==i]*5}===>')


Uses 3.6's new f-strings.

# Pyth, 76 bytes

V{+_tW!}zJ[*\_12"Donald Trump""Hillary Clinton")Jzs[.[Nd18K*\=3*?qzN\-d5K\>