答:
MATL, 15 bytes

```<code>'_|__'700:)70e!
</code>```

Of course, you can Try it online!
Explanation:

```<code>'_|__' % Put a brick on the stack
700    % 700 times
:)     % Makes a happy mason...
70e!   % Secret freemason code
</code>```

OK, actually, it works as follows:

```<code>'_|__' % Put the first bit of the string on the stack
700:   % Put 1, 2, ..., 700 on the stack as array
)      % Index into the string, modularly. Result: '_|___|__ ... __'
70e    % Reshape into 70 rows (and consequently, 10 columns)
!      % Transpose to get the desired output.
</code>```

Title: Build me a brick wall!

Body:
Challenge

I need help building a brick wall! Throw together some code for me
 using no input and produce the following output wall shown below:

```<code>_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
</code>```

Now, this wall is exactly 10 characters high and 70 characters
 wide.

As stated above, no inputs, only code. Least amount of bytes, we have
 to efficiently build this brick wall. Obviously, this program has to
 function to get the wall built..? or it obviously won't build itself!
 Good luck!

Winner

The winner goes to Marinus using the APL language, requiring a whole 12 bytes!
https://codegolf.stackexchange.com/a/99028/61857

Thank you everyone for participating!

Body:
MATL, 15 bytes

'_|__'700:)70e!

Of course, you can Try it online!
Explanation:

'_|__' % Put a brick on the stack
700    % 700 times
:)     % Makes a happy mason...
70e!   % Secret freemason code

OK, actually, it works as follows:

'_|__' % Put the first bit of the string on the stack
700:   % Put 1, 2, ..., 700 on the stack as array
)      % Index into the string, modularly. Result: '_|___|__ ... __'
70e    % Reshape into 70 rows (and consequently, 10 columns)
!      % Transpose to get the desired output.


问:
Spell out the Revu'a
Actually not inspired neither by Atbash Self Palindromes nor by Generalized Gematria Calculator.

Given a string s of length n, output the Revu'a sequence, which is the first character of s, the first two characters of s, ... the first n–2 characters of s, the first n–1 characters of s, the entire s.

The string will only consist of Unicode (any encoding you want) characters that have strong directionality and are found in the range 0x0000 through 0xFFFF. However, no directionality control characters will occur. All characters in any given string will have the same directionality.

You may return in array notation ["t","te","tes","test"], as a space-separated string "t te tes test", as multi-line text
t
te
tes
test
, a pre-formatted array```t
te
tes
test```, or anything similar. Amounts of leading, separating, and trailing spacing is not important, and neither are trailing newline. Ask if in doubt.

Right-to-Left input must result in Right-to-Left output in proper order:

Input: "נחמן"

Output: "נ  נח  נחמ  נחמן" or```נ
נח
נחמ
נחמן
```, or ["נ","נח","נחמ","נחמן"]. Among invalid results are "נחמן  נחמ  נח  נ" ,"ן  מן  חמן  נחמן", and "נחמן  חמן  מן  ן".

答:
Python, 32 bytes

f=lambda s:s and f(s[:-1])+" "+s
```

<p>Recursive function that outputs a space-separated string with a leading space.</p>

<p>A 34-byte program (Python 2):</p>

<pre class="lang-python prettyprint-override"><code>s=""
for c in input():s+=c;print s
</code>```

ContentLicense: CC BY-SA 3.0

Title: Spell out the Revu'a

Body:
Python, 32 bytes

f=lambda s:s and f(s[:-1])+" "+s

Recursive function that outputs a space-separated string with a leading space.

A 34-byte program (Python 2):

s=""
for c in input():s+=c;print s


问:
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.

Please post an image of your output.

The shortest answer in bytes wins.

答:
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)

```<code>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/=�]V`gˇ��^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ƞ���V`5��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��
</code>```

Not gonna win, but posted it for fun.

Title: GO OUT AND VOTE

Body:
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/=�]V`gˇ��^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ƞ���V`5��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.


答:
V, 5 bytes

```<code>òÄ$xh
</code>```

Try it online!

Explanation:

```<code>ò       " Recursively:
 Ä      "   Duplicate this line
  $     "   Move to the end of this line
   x    "   Delete one character
    h   "   Move one character to the right, which will throw an error when the line is one character long
</code>```

Title: Spell out the Revu'a

Body:
Actually not inspired neither by Atbash Self Palindromes nor by Generalized Gematria Calculator.

Given a string s of length n, output the Revu'a sequence, which is the first character of s, the first two characters of s, ... the first n–2 characters of s, the first n–1 characters of s, the entire s.

The string will only consist of Unicode (any encoding you want) characters that have strong directionality and are found in the range 0x0000 through 0xFFFF. However, no directionality control characters will occur. All characters in any given string will have the same directionality.

You may return in array notation ["t","te","tes","test"], as a space-separated string "t te tes test", as multi-line text
t
te
tes
test
, a pre-formatted array```t
te
tes
test```, or anything similar. Amounts of leading, separating, and trailing spacing is not important, and neither are trailing newline. Ask if in doubt.

Right-to-Left input must result in Right-to-Left output in proper order:

Input: "נחמן"

Output: "נ  נח  נחמ  נחמן" or```נ
נח
נחמ
נחמן
```, or ["נ","נח","נחמ","נחמן"]. Among invalid results are "נחמן  נחמ  נח  נ" ,"ן  מן  חמן  נחמן", and "נחמן  חמן  מן  ן".

Body:
V, 5 bytes

òÄ$xh

Try it online!

Explanation:

ò       " Recursively:
 Ä      "   Duplicate this line
  $     "   Move to the end of this line
   x    "   Delete one character
    h   "   Move one character to the right, which will throw an error when the line is one character long

ContentLicense: CC BY-SA 4.0


答:
PowerShell v2+, 28 bytes

```<code>[char[]]$args[0]|%{($o+=$_)}
</code>```

Takes input $args[0], casts it as a char-array, pipes the characters into a loop |%{...}. Each iteration, we accumulate onto $o via += the current character $_. That expression is encapsulated in parens so a copy is placed on the pipeline. At end of execution, the pipeline is flushed via Write-Output which puts a newline between elements.

```<code>PS C:\Tools\Scripts\golfing> .\spell-out-the-revua "נחמן"
נ
נח
נחמ
נחמן

PS C:\Tools\Scripts\golfing> .\spell-out-the-revua "PPCG"
P
PP
PPC
PPCG
</code>```

Title: Spell out the Revu'a

Body:
PowerShell v2+, 28 bytes

[char[]]$args[0]|%{($o+=$_)}

Takes input $args[0], casts it as a char-array, pipes the characters into a loop |%{...}. Each iteration, we accumulate onto $o via += the current character $_. That expression is encapsulated in parens so a copy is placed on the pipeline. At end of execution, the pipeline is flushed via Write-Output which puts a newline between elements.

PS C:\Tools\Scripts\golfing> .\spell-out-the-revua "נחמן"
נ
נח
נחמ
נחמן

PS C:\Tools\Scripts\golfing> .\spell-out-the-revua "PPCG"
P
PP
PPC
PPCG


答:
Brachylog, 5 bytes

```<code>@[@w\
</code>```

Try it online!

Explanation

```<code>@[       Take a prefix of the input
  @w     Write this prefix to STDOUT followed by a linebreak
    \    False: try another prefix
</code>```

Right-to-left strings seem to work properly, even though I never even considered them.

Title: Spell out the Revu'a

Body:
Brachylog, 5 bytes

@[@w\

Try it online!

Explanation

@[       Take a prefix of the input
  @w     Write this prefix to STDOUT followed by a linebreak
    \    False: try another prefix

Right-to-left strings seem to work properly, even though I never even considered them.


问:
I deserve a castle for it only being Tuesday
It is only Tuesday, ugh. I deserve a treat. Golf me a Castle. The Least amount of bytes wins!

Taken no input and output this image exactly:

```<code> /\           /\
/  \         /  \
----         ----
|  |^^^^^^^^^|  |
-----------------
|       _       |
|   |  | |  |   |
|      | |      |
</code>```

Edit

Build me a brick wall!
36 votes versus my -9. Okay.

Body:
Bubblegum, 52 bytes

00000000: 35c8 3111 c030 1443 b1fd a310 815c 08f5  5.1..0.C.....\..
00000010: 5a22 06df 64b0 263f db0f 7562 367d b831  Z"..d.&?..ub6}.1
00000020: eb50 3726 e4ad 9059 5513 c007 c804 2142  .P7&...YU.....!B
00000030: f441 74fc                                .At.

Obligatory Bubblegum answer.


Title: Build me a brick wall!

Body:
Retina, <s>23</s> <s>21</s> 20 bytes

175$*_

_|_
!`.{70}

Try it online


问:
Primenary Strings

A Primenary (binary-prime) string is one which, when written as a binary grid, every row and column has a prime total.

That's quite a vague explanation, so let's break it down with a worked example...

For this example we'll use the string bunny:

First, find the ASCII code point of each character and its binary representation:

```<code>Char | ASCII | Binary

b      98      1100010
u      117     1110101
n      110     1101110
n      110     1101110
y      121     1111001
</code>```

Take these binary values, from top to bottom, and arrange them into grid (adding leading zeros if necessary):

```<code>1 1 0 0 0 1 0
1 1 1 0 1 0 1
1 1 0 1 1 1 0
1 1 0 1 1 1 0
1 1 1 1 0 0 1
</code>```

Then, count the number of 1s in each row and column:

```<code>1 1 0 0 0 1 0   > 3
1 1 1 0 1 0 1   > 5
1 1 0 1 1 1 0   > 5
1 1 0 1 1 1 0   > 5
1 1 1 1 0 0 1   > 5

v v v v v v v

5 5 2 3 3 3 2
</code>```

If, and only if, every single total is prime (such as here) then the string is a valid binary-prime.

The Challenge

Your task is to create a function or program which, when given a string, returns/outputs truthy if the string is primenary, and falsy otherwise.

Rules/Details

You may assume that the string's characters will always be in the ASCII range 33-126 (inclusive).

The string will not be empty.

A primenary string does not have to have a prime length - for example, W1n* is valid, despite having 4 characters.

This is code-golf, so the shortest answer (in bytes) wins - but all submissions are welcome.

Standard loopholes are banned.

Test Cases

```<code>'husband'     -> True
'HOTJava'     -> True
'COmPaTIBILE' -> True
'AuT0HACk'    -> True

'PPCW'        -> False
'code-golf'   -> False
'C++'         -> False
'/kD'         -> False

'HI'          -> False
'A'           -> False
</code>```

There is also a working, but incredibly verbose Python example on repl.it that you can test your solution against.

答:
JavaScript, 234 bytes

```<code>f=z=>(z=[...z].map(v=>v.charCodeAt(0))).map(v=>v.toString(2).replace(/0/g,"").length).every((p=v=>{for(i=2;i<v;i++){if(v%i===0){return 0}};return v>1}))&&[...""+1e6].map((v,i)=>z.reduce((a,e)=>!!(e&Math.pow(2,i))+a,0)).every(v=>p(v))
</code>```

We get the horizontal values by converting the number to binary, removing the zeros using a string replacement, and then counting the 1s.
The vertical sums are obtained by looping 1 to 7 and using a bitwise AND with 2 raised to the nth power.

Title: Primenary Strings

Body:
JavaScript, 234 bytes

f=z=>(z=[...z].map(v=>v.charCodeAt(0))).map(v=>v.toString(2).replace(/0/g,"").length).every((p=v=>{for(i=2;i<v;i++){if(v%i===0){return 0}};return v>1}))&&[...""+1e6].map((v,i)=>z.reduce((a,e)=>!!(e&Math.pow(2,i))+a,0)).every(v=>p(v))

We get the horizontal values by converting the number to binary, removing the zeros using a string replacement, and then counting the 1s.
The vertical sums are obtained by looping 1 to 7 and using a bitwise AND with 2 raised to the nth power.


Title: GO OUT AND VOTE

Body:
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.

Please post an image of your output.

The shortest answer in bytes wins.

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


答:
Emmet, 49 62 61 68 bytes

a{I}+r{V}+a{o}+r{t}+a{e}+r{d}+style{r{color:red}}

r{I }+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>

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.

Title: GO OUT AND VOTE

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

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


Title: I deserve a castle for it only being Tuesday

Body:
It is only Tuesday, ugh. I deserve a treat. Golf me a Castle. The Least amount of bytes wins!

Taken no input and output this image exactly:

```<code> /\           /\
/  \         /  \
----         ----
|  |^^^^^^^^^|  |
-----------------
|       _       |
|   |  | |  |   |
|      | |      |
</code>```

Edit

Build me a brick wall!
36 votes versus my -9. Okay.

Body:
Ruby, 130 bytes

f=->a,b=' '{a+b*9+a};g=->s{?|+s.center(15)+?|};puts f[' /\\ '],f['/  \\'],f[c=?-*4],f[d='|  |',?^],f[c,?-],g[?_],g[d+' '+d],g['| |']

This can probably be golfed down more.


答:
ImageMagick, 102 bytes

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

Ungolfed:

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

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:

Title: GO OUT AND VOTE

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


答:
C, 65 bytes

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

<p>or, more accurately:</p>

<pre class="lang-c prettyprint-override"><code>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));}
</code>```

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";
```

Title: GO OUT AND VOTE

Body:
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";


Title: Build me a brick wall!

Body:
Challenge

I need help building a brick wall! Throw together some code for me
 using no input and produce the following output wall shown below:

```<code>_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
</code>```

Now, this wall is exactly 10 characters high and 70 characters
 wide.

As stated above, no inputs, only code. Least amount of bytes, we have
 to efficiently build this brick wall. Obviously, this program has to
 function to get the wall built..? or it obviously won't build itself!
 Good luck!

Winner

The winner goes to Marinus using the APL language, requiring a whole 12 bytes!
https://codegolf.stackexchange.com/a/99028/61857

Thank you everyone for participating!

Body:
Perl, 37 bytes

print$_.$/x!(++$i%35)for('_|',__)x175

Ungolfed:

my $i = 0;
print($_, "\n" x !(++$i % 35)) for ('_|', '__') x 175;


Title: Build me a brick wall!

Body:
Lithp, 72 bytes

#::((print (replace (repeat "_|__" 175) (regex "(.{70})" "g") "$1\n"))))

Sample usage:

% wall.lithp
(
    (def x #::((print (replace (repeat "_|__" 175) (regex "(.{70})" "g") "$1\n"))))
    (x)
)

Output:

$ ./run.js wall.lithp
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__


Title: Build me a brick wall!

Body:
JavaScript (ES6), 48 bytes

f=(n=350)=>n?(n%35?'_':`
_`)+"|_"[n%2]+f(n-1):""

Because recursion.


问:
Simulate the Universe!
One nice property of a Turing-complete language is that it can be used to write any program, up to and including the simulation of the entire Universe.

Your job is to do exactly that: write a program which simulates the Universe.

Note: although I don't doubt you'll be able to accomplish this task, nowadays I don't have enough spare time to verify whether all 1090 of the particles in your simulation do what they really should do. Therefore, solely to simplify testing and evaluation, it is enough if your universe simulator only works with a single starting particle. To keep things interesting, let's assume this particle is the recently discovered Higgs Boson.

Your universe starts with nothing but a single Higgs Boson of approximately 120 GeV in the middle of it. To not make the output too long, let's make this universe tick at only 10-25 seconds instead of its "usual clock rate" of 5.4×10−44 seconds..

This Higgs boson will decay sooner or later as it has a half-life of 1.6×10−22 seconds, so at every tick of the simulation, it has a 0.0433% chance of decaying. You can check here what it will decay into. To have a central and simplified requirement, I list the branching ratios you should use:

Running the simulation

At each tick of the simulation, the Higgs boson has a 0.0433% chance of decaying. If that happens, it will decay into the following particles, with the listed probabilities (you should use these names in the output):

bottom quark + bottom antiquark (64.8%)

2 W bosons (14.1%)

2 gluons (8.82%)

tau lepton + antitau lepton (7.04%)

charm quark + charm antiquark (3.27%)

2 Z bosons (1.59%)

2 photons (0.223%)

1 Z boson + 1 photon (0.111%)

muon + antimuon (0.0244%)

top quark + top antiquark (0.0216%)

For a total of 100%.

Some of these particles will decay further.

W boson: half-life of 10-25 seconds, this means a 50% chance to decay at every tick into one of the following, with equal probabilities:

positron + neutrino

antimuon + neutrino

antitau lepton + neutrino

Z boson: half-life of 10-25 seconds, this means a 50% chance to decay at every tick into one of the following:

neutrino + antineutrino (20.6%)

electron + positron (3.4%)

muon + antimuon (3.4%)

tau lepton + antitau lepton (3.4%)

down quark + down antiquark (15.2%)

strange quark + strange antiquark (15.2%)

bottom quark + bottom antiquark (15.2%)

up quark + up antiquark (11.8%)

charm quark + charm antiquark (11.8%)

top quark: half-life of 5×10-25 seconds, this means a 12.95% chance to decay at every tick into the following, with equal probabilities:

W boson + down quark

W boson + strange quark

W boson + bottom quark

Of course, the W boson will also soon decay...

The top antiquark behaves similarly to the top quark: it decay into a W boson and a d/s/b antiquark.

All other particles (so all except for the Z and W bosons and top quarks) have a half life many orders of magnitude longer, so to not clutter the output, they are all considered stable for our simulation.

As the universe is largely empty, all the particles will have enough space for themselves and will not interact with each other. Therefore all individual particles are independent from each other in every regard, including the probabilities of splitting.

Output:

Every tick of the simulation, you have to print the contents of the simulated universe into a new line. For example:

```<code>The universe contains 1 Higgs boson.
The universe contains 1 Higgs boson.
The universe contains 1 Higgs boson.
The universe contains 1 Higgs boson.
The universe contains 2 W bosons.
The universe contains 2 W bosons.
The universe contains 1 W boson, 1 positron and 1 neutrino.
The universe contains 1 positron, 1 antitau lepton and 2 neutrinos.
Simulation ended after 0.8 yoctoseconds.
</code>```

The order of the particles in the line is not important. The formatting, however, must be exactly as in the example above, including punctuation and pluralization. If you simulate an entire (mini-) universe, it should look nice (And I wanted to eliminate the abusing of a not sufficiently strict output requirement)

Each line corresponds to 0.1 yoctoseconds, but you will be forgiven if it takes longer than that for your program to print the output.

The simulation ends when only "stable" particles remain.

Scoring

Standard code golf rules apply.

The random number generator can be pseudo-random, but you must seed it if the language doesn't seed it by default. The probability distribution of your RNG must be uniform.

You will get a bonus -10% to the code size if the program takes an integer as an input, and starts with that many Higgs bosons.

Exception for Turing machine enthusiasts.

For those who dare to try their luck with an actual Turing machine or a similar language (like Brainfuck), their task is made easier by the following rule changes (only applicable if the language is a Brainfuck-derivative or otherwise a very simplified Turing-machine, incapable of assignment, lacking an ALU, and values on the tape can only be incremented and decremented by one):

The particle names are simplified to d, s, b, t, u, c for the quarks, v for the neutrino, T for tau lepton, m for muon, g for gluon, p for photon, Z, W and H for the bosons, - for the electron and + for the positron. At each tick, an input with the value of 0 or 1 are provided from the standard input, indicated whether the first unstable particle in the list decays or not.

The example output will therefore become

```<code>H
H
H
H
W W
W W
W + n
+ !T n n
</code>```

答:
D, 1172 1101 bytes - 10% = 990.9 bytes

```<code>import std.random,std.conv,std.stdio,std.algorithm,std.range;alias I=int,V=void,S=string,F=float,U=uniform01!F,W=writef,J=join,X=split;V main(S[]v){I[26]c;c[0]=to!I(v[1]);S[84]s;s[65..$]="antiX bosonXcharm Xdown XelectronXZXgluonXHiggsXtop Xbottom Xup Xtau leptonXmuonXneutrinoXWXphotonXquarkXpositronXstrange ".X('X');S[]f="HBXOBXFBXKQXKAQXDQXDAQXIQXIAQXJQXJAQXSQXSAQXCQXCAQXLXALXEXRXGXPXMXAMXNXAN".X('X');V
D(I i,F p,F[]d,S v){d~=200;if(c[i]&&U()<p){c[i]--;p=U();foreach(j,q; d){if(p<q/100){c[v[2*j]-65]++;c[v[2*j+1]-65]++;break;}}}}S
C(T)(T s){return(s.length>1)?s[0..$-1].J(", ")~" and "~s[$-1]:s.J(" and ");}I
y=0;while(1){W("The universe contains "~C(iota(0,c.length).filter!(i=>c[i]).map!(i=>to!S(c[i])~" "~f[i].map!(a=>s[a]).J~((c[i]>1)?"s":"")).array)~".\n");y++;if(c[0]+c[1]+c[7]+c[8]<1)break;F[]u=[100/3.0,200/3.0];D(0,.000433,[.0216,.0460,.157,.38,1.97,5.24,12.28,21.1,35.2],"HIVWCUUUCCNOPQTTBBJK");D(2,.5,[11.8,23.6,38.8,54.,69.2,72.6,76.,79.4],"XYRSVWPQFGLMJKDENO");D(1,.5,u,"SXWXQX");D(7,.1295,u,"BFBLBJ");D(8,.1295,u,"BGBMBK");}W("Simulation ended after %f yoctoseconds.\n",y/10.0);}
</code>```

Ungolfed

```<code>import std.random,std.conv,std.stdio,std.algorithm,std.range;
alias I=int,V=void,S=string,F=float,U=uniform01!F;

//uppercase is antiparticle.  The enums are replaced with constants
//in the golfed version.
enum P{
    h, w, z, //bosons
    u,U, d,D, t,T, b,B, s,S, c,C,//quarks
    l,L, //tau lepton, antitau lepton
    e,E, //electron,positron
    g, //gluon
    p, //photon
    m,M, //muon, antimuon
    n, N, //neutrino, antineutrino
};

void main(string[] v) {
    int[26]c;//particle counts
    c[0]=to!int(v[1]);//mandatory argument

    string format_particle(ulong i) {
        string[84] strs;
        strs[65..$]=["anti"," boson","charm ","down ","electron",/*f*/"Z",
        "gluon","Higgs",/*i*/"top ",/*j*/"bottom ",/*k*/"up ","tau lepton","muon","neutrino",/*o*/"W","photon","quark",/*r*/"positron","strange "];
        string[] fmt = [
            "HB","OB","FB",//bosons
            "KQ","KAQ",//up
            "DQ","DAQ",//down
            "IQ","IAQ",//top
            "JQ","JAQ",//bottom
            "SQ","SAQ",//strange
            "CQ","CAQ",//charm
            "L","AL",//Tau leptons
            "E","R",//electron/positron
            "G", //gluon
            "P", //photon
            "M","AM", //muon, antimuon
            "N", "AN", //neutrino, antineutrino
        ];
        //In the golfed version, we instead use X to delimit strings and call split to convert to array.

        return to!string(c[i])
            ~ " " ~ fmt[i].map!(a=>strs[a]).join
            ~ ((c[i]>1) ? "s" : "");
    }

    /* if there exist any of particle `i`,
       it decays with probability `p`.
       into the particles specified in `v[j]`
       where `j` is drawn from distribution `decay_probs` */
    void decay(int i, float p, float[] decay_probs, P[] v...) {
        decay_probs ~= 2;//1.0, but with a margin for error in case of floating point precision issues
        if (c[i] && U()<p){
            c[i]--;

            p=U();
            foreach(j,q; decay_probs) {
                if (p<q) {
                    c[v[2*j]]++;
                    c[v[2*j+1]]++;
                    /*writef("Decay %s, Add: %s, %s\n",
                        format_particle(i),
                        format_particle(v[2*j]), format_particle(v[2*j+1]));*/
                    break;
                }
            }
        }
    }

    int y=0;
    while(1) {
        string commas(T)(T s) {
            return (s.length > 1)
                ?  s[0..$-1].join(", ") ~ " and " ~ s[$-1]
                :  s.join(" and ");
        }

        //print line for particle `d`
        writef("The universe contains "
            ~ commas(
                iota(0,c.length)
                    .filter!(i=>c[i])
                    .map!(i=>format_particle(i))
                    .array) ~ ".\n");

        y++;
        if(c[P.h]+c[P.w]+c[P.t]+c[P.T]<1)break;

        F[] u = [1/3.0,2/3.0];
        decay(P.h, .000433,
            [.000216,.000460,.00157,.0038,.0197,.0524,.1228,.211,.352],
            P.t,P.T, P.m,P.M, P.z,P.p, P.p,P.p, P.z,P.z, P.c,P.C, P.l,P.L, P.g,P.g, P.w,P.w, P.b,P.B);
        decay(P.z, .5,
            [.118,.236,.388,.54,.692,.726,.76,.794],
            P.n,P.N, P.e,P.E, P.m,P.M, P.l,P.L, P.d,P.D, P.s,P.S, P.b,P.B, P.u,P.U, P.c,P.C);
        decay(P.w,    .5, u, P.E,P.n, P.M,P.n, P.L,P.n);
        decay(P.t, .1295, u, P.w,P.d, P.w,P.s, P.w,P.b);
        decay(P.T, .1295, u, P.w,P.D, P.w,P.S, P.w,P.B);
        //In the golfed version, the list of enums is replaced by a string: each char is 65 + the enum's value.  D() is adjusted to subtract it again.
    }

    writef("Simulation ended after %f yoctoseconds.\n", y/10.0);
}
</code>```

Title: Simulate the Universe!

Body:
D, 1172 1101 bytes - 10% = 990.9 bytes

import std.random,std.conv,std.stdio,std.algorithm,std.range;alias I=int,V=void,S=string,F=float,U=uniform01!F,W=writef,J=join,X=split;V main(S[]v){I[26]c;c[0]=to!I(v[1]);S[84]s;s[65..$]="antiX bosonXcharm Xdown XelectronXZXgluonXHiggsXtop Xbottom Xup Xtau leptonXmuonXneutrinoXWXphotonXquarkXpositronXstrange ".X('X');S[]f="HBXOBXFBXKQXKAQXDQXDAQXIQXIAQXJQXJAQXSQXSAQXCQXCAQXLXALXEXRXGXPXMXAMXNXAN".X('X');V
D(I i,F p,F[]d,S v){d~=200;if(c[i]&&U()<p){c[i]--;p=U();foreach(j,q; d){if(p<q/100){c[v[2*j]-65]++;c[v[2*j+1]-65]++;break;}}}}S
C(T)(T s){return(s.length>1)?s[0..$-1].J(", ")~" and "~s[$-1]:s.J(" and ");}I
y=0;while(1){W("The universe contains "~C(iota(0,c.length).filter!(i=>c[i]).map!(i=>to!S(c[i])~" "~f[i].map!(a=>s[a]).J~((c[i]>1)?"s":"")).array)~".\n");y++;if(c[0]+c[1]+c[7]+c[8]<1)break;F[]u=[100/3.0,200/3.0];D(0,.000433,[.0216,.0460,.157,.38,1.97,5.24,12.28,21.1,35.2],"HIVWCUUUCCNOPQTTBBJK");D(2,.5,[11.8,23.6,38.8,54.,69.2,72.6,76.,79.4],"XYRSVWPQFGLMJKDENO");D(1,.5,u,"SXWXQX");D(7,.1295,u,"BFBLBJ");D(8,.1295,u,"BGBMBK");}W("Simulation ended after %f yoctoseconds.\n",y/10.0);}

Ungolfed

import std.random,std.conv,std.stdio,std.algorithm,std.range;
alias I=int,V=void,S=string,F=float,U=uniform01!F;

//uppercase is antiparticle.  The enums are replaced with constants
//in the golfed version.
enum P{
    h, w, z, //bosons
    u,U, d,D, t,T, b,B, s,S, c,C,//quarks
    l,L, //tau lepton, antitau lepton
    e,E, //electron,positron
    g, //gluon
    p, //photon
    m,M, //muon, antimuon
    n, N, //neutrino, antineutrino
};

void main(string[] v) {
    int[26]c;//particle counts
    c[0]=to!int(v[1]);//mandatory argument

    string format_particle(ulong i) {
        string[84] strs;
        strs[65..$]=["anti"," boson","charm ","down ","electron",/*f*/"Z",
        "gluon","Higgs",/*i*/"top ",/*j*/"bottom ",/*k*/"up ","tau lepton","muon","neutrino",/*o*/"W","photon","quark",/*r*/"positron","strange "];
        string[] fmt = [
            "HB","OB","FB",//bosons
            "KQ","KAQ",//up
            "DQ","DAQ",//down
            "IQ","IAQ",//top
            "JQ","JAQ",//bottom
            "SQ","SAQ",//strange
            "CQ","CAQ",//charm
            "L","AL",//Tau leptons
            "E","R",//electron/positron
            "G", //gluon
            "P", //photon
            "M","AM", //muon, antimuon
            "N", "AN", //neutrino, antineutrino
        ];
        //In the golfed version, we instead use X to delimit strings and call split to convert to array.

        return to!string(c[i])
            ~ " " ~ fmt[i].map!(a=>strs[a]).join
            ~ ((c[i]>1) ? "s" : "");
    }

    /* if there exist any of particle `i`,
       it decays with probability `p`.
       into the particles specified in `v[j]`
       where `j` is drawn from distribution `decay_probs` */
    void decay(int i, float p, float[] decay_probs, P[] v...) {
        decay_probs ~= 2;//1.0, but with a margin for error in case of floating point precision issues
        if (c[i] && U()<p){
            c[i]--;

            p=U();
            foreach(j,q; decay_probs) {
                if (p<q) {
                    c[v[2*j]]++;
                    c[v[2*j+1]]++;
                    /*writef("Decay %s, Add: %s, %s\n",
                        format_particle(i),
                        format_particle(v[2*j]), format_particle(v[2*j+1]));*/
                    break;
                }
            }
        }
    }

    int y=0;
    while(1) {
        string commas(T)(T s) {
            return (s.length > 1)
                ?  s[0..$-1].join(", ") ~ " and " ~ s[$-1]
                :  s.join(" and ");
        }

        //print line for particle `d`
        writef("The universe contains "
            ~ commas(
                iota(0,c.length)
                    .filter!(i=>c[i])
                    .map!(i=>format_particle(i))
                    .array) ~ ".\n");

        y++;
        if(c[P.h]+c[P.w]+c[P.t]+c[P.T]<1)break;

        F[] u = [1/3.0,2/3.0];
        decay(P.h, .000433,
            [.000216,.000460,.00157,.0038,.0197,.0524,.1228,.211,.352],
            P.t,P.T, P.m,P.M, P.z,P.p, P.p,P.p, P.z,P.z, P.c,P.C, P.l,P.L, P.g,P.g, P.w,P.w, P.b,P.B);
        decay(P.z, .5,
            [.118,.236,.388,.54,.692,.726,.76,.794],
            P.n,P.N, P.e,P.E, P.m,P.M, P.l,P.L, P.d,P.D, P.s,P.S, P.b,P.B, P.u,P.U, P.c,P.C);
        decay(P.w,    .5, u, P.E,P.n, P.M,P.n, P.L,P.n);
        decay(P.t, .1295, u, P.w,P.d, P.w,P.s, P.w,P.b);
        decay(P.T, .1295, u, P.w,P.D, P.w,P.S, P.w,P.B);
        //In the golfed version, the list of enums is replaced by a string: each char is 65 + the enum's value.  D() is adjusted to subtract it again.
    }

    writef("Simulation ended after %f yoctoseconds.\n", y/10.0);
}


问:
Alternating Fibonacci
In the alternating Fibonacci sequence, you first start with 1 and 1 as usual.

However, instead of always adding the last two values to get the next number, you alternate starting with adding, and every other time you subtract instead.

The sequence starts like this:

```<code>1
1
2    # 1 + 1
-1   # 1 - 2
1    # 2 + -1
-2   # -1 - 1
-1   # 1 + -2
-1   # -2 - -1
-2   # -1 + -1
1    # -1 - -2
-1   # -2 + 1
2    # 1 - -1
1    # -1 + 2
1    # 2 - 1
</code>```

etc.

Notice that after it starts over once it gets to 1 and 1 again.

Given a number N, print the Nth term of the alternating fibonacci sequence.

Remember, this is code-golf, so the code with the smallest number of bytes wins.

答:
JavaScript (ES6), 25 bytes

```<code>n=>"334130110314"[n%12]-2
</code>```

0-indexed. You can shorten the string with a slightly recursive version, though it adds 6 bytes:

```<code>f=n=>"3341301"[n]-2||f(13-n%12)
</code>```

This is still shorter than the definitive recursive formula:

```<code>f=n=>n<2||f(n-2)+f(n-1)*(-n%2|1)
</code>```

Title: Alternating Fibonacci

Body:
JavaScript (ES6), 25 bytes

n=>"334130110314"[n%12]-2

0-indexed. You can shorten the string with a slightly recursive version, though it adds 6 bytes:

f=n=>"3341301"[n]-2||f(13-n%12)

This is still shorter than the definitive recursive formula:

f=n=>n<2||f(n-2)+f(n-1)*(-n%2|1)


答:
MATL, <s>17</s> <s>16</s> 15 bytes

```<code>'"Bl)e'F5Za2-i)
</code>```

Input is 1-based.

Try it online!

Explanation

The sequence has period [1 1 2 -1 1 -2 -1 -1 -2 1 -1  2].

```<code>'"Bl)e     % Compressed array [1 1 2 -1 1 -2 -1 -1 -2 1 -1 2] with source
           % alphabet [-2 -1 0 1 2]
F5Za       % Decompress with target alphabet [0 1 2 3 4]
2-         % Subtract 2 to transform alphabet into [-2 -1 0 1 2]
i)         % Input N and use as (modular, 1-based) index into the sequence
</code>```

Title: Alternating Fibonacci

Body:
In the alternating Fibonacci sequence, you first start with 1 and 1 as usual.

However, instead of always adding the last two values to get the next number, you alternate starting with adding, and every other time you subtract instead.

The sequence starts like this:

```<code>1
1
2    # 1 + 1
-1   # 1 - 2
1    # 2 + -1
-2   # -1 - 1
-1   # 1 + -2
-1   # -2 - -1
-2   # -1 + -1
1    # -1 - -2
-1   # -2 + 1
2    # 1 - -1
1    # -1 + 2
1    # 2 - 1
</code>```

etc.

Notice that after it starts over once it gets to 1 and 1 again.

Given a number N, print the Nth term of the alternating fibonacci sequence.

Remember, this is code-golf, so the code with the smallest number of bytes wins.

Body:
MATL, <s>17</s> <s>16</s> 15 bytes

'"Bl)e'F5Za2-i)

Input is 1-based.

Try it online!

Explanation

The sequence has period [1 1 2 -1 1 -2 -1 -1 -2 1 -1  2].

'"Bl)e     % Compressed array [1 1 2 -1 1 -2 -1 -1 -2 1 -1 2] with source
           % alphabet [-2 -1 0 1 2]
F5Za       % Decompress with target alphabet [0 1 2 3 4]
2-         % Subtract 2 to transform alphabet into [-2 -1 0 1 2]
i)         % Input N and use as (modular, 1-based) index into the sequence


答:
Mathematica, <s>45</s> <s>41</s> 38 bytes

Thanks to @MartinEnder for 3 bytes.

```<code>±0=±1=1;±n_:=±(n-2)+±(n-1)(1-2n~Mod~2)
</code>```

0-indexed.

Usage

```<code>±5
</code>```

-2

Title: Alternating Fibonacci

Body:
Mathematica, <s>45</s> <s>41</s> 38 bytes

Thanks to @MartinEnder for 3 bytes.

±0=±1=1;±n_:=±(n-2)+±(n-1)(1-2n~Mod~2)

0-indexed.

Usage

±5

-2


问:
Next Friday the 13th
What is the shortest program that can predict the next time Friday will fall on the 13th day of the month?

Must be an complete functioning program (not just a function/subroutine)

Must print out date in the following format: YYYY-MM-DD

Allow user to provide a start date either as a command line argument or through STDIN

If user provides no start date, use today as the start date.

If the start date is a Friday the 13th, the program should find the next Friday the 13th.

If I were to run the program today (Feb 16 2011) I should get the following output.

```<code>$ ./fr13th 2013-05-09
2013-09-13
$ ./fr13th 2007-06-29
2007-07-13
$ ./fr13th 2007-07-13
2008-06-13
$ ./fr13th
2011-05-13
</code>```

ContentLicense: CC BY-SA 2.5

Title: Next Friday the 13th

Body:
Javascript

F13=function(x){
    z=function(x){return (''+x).replace(/^(.)$/,'0$1')}
    D=x?new Date(x):new Date(),Z=864e5,X=D.getDay()%7,X+=+D+(X?Z*(5-X):0);
    do{
        X+=Z*7;
        D=new Date(X);
    }while(D.getDate()!=13)
    return D.getFullYear()+"-"+z(D.getMonth()+1)+"-"+z(D.getDate());
}

ps: yeah, I know, I broke the first rule (couldn't be just a function)

Tests on javascript shell

F13("2013-05-09") // 2013-09-13
2013-09-13
F13("2007-06-29") // 2007-07-13
2007-07-13
F13("2007-07-13") // 2008-06-13
2008-06-13
F13() //2011-05-13
2011-05-13


答:
Python 2, 77 bytes

```<code>r='\033[91m'
b='\033[94m'
print r+'\033[47mI '+b+'V'+r+'o'+b+'t'+r+'e'+b+'d'
</code>```

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:

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

And this:

```<code>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
</code>```

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

Title: GO OUT AND VOTE

Body:
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.

Please post an image of your output.

The shortest answer in bytes wins.

Body:
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!)


答:
Jelly, 12 bytes

```<code>“½Ġ⁻S’b5_2⁸ị
</code>```

TryItOnline!

1-based, given the first and second values are 1.

Not sure if this is shorter yet, but for this I noted that the series has a period of 12:

[1, 1, 2, -1, 1, -2, -1, -1, -2, 1, -1, 2]

So, I took that and added 2 to give

[3, 3, 4, 1, 3, 0, 1, 1, 0, 3, 1, 4]

then converted that as a base 5 number to base 250, to give:

[11, 197, 140, 84]

(which is 184222584).

```<code>“½Ġ⁻S’b5_2⁸ị - Main link: n
“½Ġ⁻S’       - base 250 number      184222584
      b5     - convert to base 5   [3, 3, 4, 1, 3, 0, 1, 1, 0, 3, 1, 4]
        _2   - subtract 2          [1, 1, 2, -1, 1, -2, -1, -1, -2, 1, -1, 2]
          ⁸  - left argument, n
           ị - index into (1-based and modular)
</code>```

Title: Alternating Fibonacci

Body:
Jelly, 12 bytes

“½Ġ⁻S’b5_2⁸ị

TryItOnline!

1-based, given the first and second values are 1.

Not sure if this is shorter yet, but for this I noted that the series has a period of 12:

[1, 1, 2, -1, 1, -2, -1, -1, -2, 1, -1, 2]

So, I took that and added 2 to give

[3, 3, 4, 1, 3, 0, 1, 1, 0, 3, 1, 4]

then converted that as a base 5 number to base 250, to give:

[11, 197, 140, 84]

(which is 184222584).

“½Ġ⁻S’b5_2⁸ị - Main link: n
“½Ġ⁻S’       - base 250 number      184222584
      b5     - convert to base 5   [3, 3, 4, 1, 3, 0, 1, 1, 0, 3, 1, 4]
        _2   - subtract 2          [1, 1, 2, -1, 1, -2, -1, -1, -2, 1, -1, 2]
          ⁸  - left argument, n
           ị - index into (1-based and modular)


答:
Pyth - 13 bytes

Base encoded once cycle series, modular indexed.

```<code>@-R2jC"
ûx"5
</code>```

Try it online here.

Title: Alternating Fibonacci

Body:
Pyth - 13 bytes

Base encoded once cycle series, modular indexed.

@-R2jC"
ûx"5

Try it online here.


答:
Python, 31 bytes

lambda n:2-33107256/5**(n%12)%5
```

<p>Doesn't bother trying to compute the value. Just looks in up in the peroidic length-12 list <code>[1, 1, 2, -1, 1, -2, -1, -1, -2, 1, -1, 2]</code>, which is compressed in base 5.</p>

<p>Compare to a recursive solution (37 bytes) with <code>True</code>'s for 1:</p>

<pre class="lang-python prettyprint-override"><code>f=lambda n:n<2or(-1)**n*f(n-1)+f(n-2)
</code>```

or to string storage

lambda n:int('334130110314'[n%12])-2
```

<p>or an attempt at an arithmetical expression.</p>

<pre class="lang-python prettyprint-override"><code>lambda n:4**n%7%3*(-1)**((n+n%2*4)/6)
</code>```

Title: Alternating Fibonacci

Body:
Python, 31 bytes

lambda n:2-33107256/5**(n%12)%5

Doesn't bother trying to compute the value. Just looks in up in the peroidic length-12 list [1, 1, 2, -1, 1, -2, -1, -1, -2, 1, -1, 2], which is compressed in base 5.

Compare to a recursive solution (37 bytes) with True's for 1:

f=lambda n:n<2or(-1)**n*f(n-1)+f(n-2)

or to string storage

lambda n:int('334130110314'[n%12])-2

or an attempt at an arithmetical expression.

lambda n:4**n%7%3*(-1)**((n+n%2*4)/6)


答:
Mathematica, 40 bytes

Just creates a lookup table and accesses it cyclically, as in ETHproductions's answer. Unnamed function, 1-indexed.

```<code>Join[s={2,1,1,2,-1,1},-s][[#~Mod~12+1]]&
</code>```

Title: Alternating Fibonacci

Body:
Mathematica, 40 bytes

Just creates a lookup table and accesses it cyclically, as in ETHproductions's answer. Unnamed function, 1-indexed.

Join[s={2,1,1,2,-1,1},-s][[#~Mod~12+1]]&


Title: Build me a brick wall!

Body:
GolfSharp, 38 bytes

c(r(175).s(n=>"_|__").j().S(70).j(N));


答:
Oasis, 10 bytes

Reminds me to implement some more built-ins :p. The input is 0-indexed.

Code:

```<code>n>2%x<*c+V
</code>```

Translated version:

```<code>a(n) = (2*((n+1)%2)-1) * a(n-1) + a(n-2)
a(1) = 1
a(0) = 1
</code>```

And calculates the nth term.

Try it online!

Title: Alternating Fibonacci

Body:
Oasis, 10 bytes

Reminds me to implement some more built-ins :p. The input is 0-indexed.

Code:

n>2%x<*c+V

Translated version:

a(n) = (2*((n+1)%2)-1) * a(n-1) + a(n-2)
a(1) = 1
a(0) = 1

And calculates the nth term.

Try it online!


答:
WinDbg, 26 bytes

```<code>?(85824331b>>@$t0%c*3&7)-2
</code>```

Input is passed in through the pseudo-register $t0. 0-indexed. +2 of each term in the sequence is stored in 3 bits making 85824331b.

How it works:

```<code>? (85824331b >> @$t0 % c * 3 & 7) - 2 ;*? Evalutes the expression. Shifts 85824331b to get
                                       *the 3 bits for the @$t0'th term (mod c (12) when
                                       *the sequence repeats). Bitwise AND by 7 to get the
                                       *desired 3 bits, finally subtract 2 since the terms
                                       *where stored as +2.
</code>```

Sample output, a loop printing the first 14 values of the sequence:

```<code>0:000> .for(r$t0=0;@$t0<e;r$t0=@$t0+1){?(85824331b>>@$t0%c*3&7)-2}
Evaluate expression: 1 = 00000001
Evaluate expression: 1 = 00000001
Evaluate expression: 2 = 00000002
Evaluate expression: -1 = ffffffff
Evaluate expression: 1 = 00000001
Evaluate expression: -2 = fffffffe
Evaluate expression: -1 = ffffffff
Evaluate expression: -1 = ffffffff
Evaluate expression: -2 = fffffffe
Evaluate expression: 1 = 00000001
Evaluate expression: -1 = ffffffff
Evaluate expression: 2 = 00000002
Evaluate expression: 1 = 00000001
Evaluate expression: 1 = 00000001
</code>```

Title: Alternating Fibonacci

Body:
WinDbg, 26 bytes

?(85824331b>>@$t0%c*3&7)-2

Input is passed in through the pseudo-register $t0. 0-indexed. +2 of each term in the sequence is stored in 3 bits making 85824331b.

How it works:

? (85824331b >> @$t0 % c * 3 & 7) - 2 ;*? Evalutes the expression. Shifts 85824331b to get
                                       *the 3 bits for the @$t0'th term (mod c (12) when
                                       *the sequence repeats). Bitwise AND by 7 to get the
                                       *desired 3 bits, finally subtract 2 since the terms
                                       *where stored as +2.

Sample output, a loop printing the first 14 values of the sequence:

0:000> .for(r$t0=0;@$t0<e;r$t0=@$t0+1){?(85824331b>>@$t0%c*3&7)-2}
Evaluate expression: 1 = 00000001
Evaluate expression: 1 = 00000001
Evaluate expression: 2 = 00000002
Evaluate expression: -1 = ffffffff
Evaluate expression: 1 = 00000001
Evaluate expression: -2 = fffffffe
Evaluate expression: -1 = ffffffff
Evaluate expression: -1 = ffffffff
Evaluate expression: -2 = fffffffe
Evaluate expression: 1 = 00000001
Evaluate expression: -1 = ffffffff
Evaluate expression: 2 = 00000002
Evaluate expression: 1 = 00000001
Evaluate expression: 1 = 00000001


答:
ForceLang, 153 bytes

```<code>def s set
s a 1
s b 1
s p 1
s k io.readnum()
if k=0
goto b
label a
s c b.mult p
s c a+c
s a b
s b c
s p p.mult -1
s k k+-1
if k
goto a
label b
io.write a
</code>```

Title: Alternating Fibonacci

Body:
ForceLang, 153 bytes

def s set
s a 1
s b 1
s p 1
s k io.readnum()
if k=0
goto b
label a
s c b.mult p
s c a+c
s a b
s b c
s p p.mult -1
s k k+-1
if k
goto a
label b
io.write a


答:
05AB1E, 10 bytes

```<code>•É&Â†º•sèÍ
</code>```

Uses the CP-1252 encoding. Try it online!

Title: Alternating Fibonacci

Body:
05AB1E, 10 bytes

•É&Â†º•sèÍ

Uses the CP-1252 encoding. Try it online!


答:
Node, <s>57</s> <s>55</s> 41 bytes

```<code>console.log("q47;91mI  o eHHHHq94mV t d")
</code>```

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

Title: GO OUT AND VOTE

Body:
Node, <s>57</s> <s>55</s> 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):


问:
Solve the Halting Problem for Befinge
Let's define a simple 2D language, which we'll give the incredibly original name befinge. Befinge has 5 instructions:

<>^v, as in most 2D esolangs, redirect the instruction pointer in their respective directions.

. is  a no-op.

The instruction pointer starts out at the top-left corner going right. If the instruction pointer gets to an edge, the program halts. Every Befinge program will obviously either halt or go into an infinite loop which does nothing. Here are two examples:

Halting:

```<code>>.v
..<
</code>```

Non-Halting:

```<code>>....v
..v..<
..>v..
^..<..
</code>```

The halting problem is not solvable for a Turing-complete language, but it is for this one. Your task is to write a program (or function) that takes as input a string representing the befinge program and returns a truthy or falsey value depending on whether it halts or not.

You can assume that the input will consist only of these characters and will be padded with spaces to form a rectangle.

You can use any set of five characters for the instructions (e.g. adws ).

Test Cases

Halting:

```<code>.
</code>```

```<code>v>
>^
</code>```

```<code>....v....
....>...v
.^..<....
.......v<
.......v.
....^..<.
</code>```

```<code>v<>v>v^
>v^>^>v
<>>^v<v
v^<>v^<
</code>```

Non-Halting:

```<code>>..v
^..<
</code>```

```<code>>v<
v<.
>v.
v<.
>.^
</code>```

```<code>>.>.>.v
.><.<.<
</code>```

This is code-golf, so the shortest program (in bytes) wins.

答:
Python 2, 182 bytes

```<code>m,v,d,x,y=input(),[],'>',0,0
try:
 while 1:
  if[x,y]in v:print 0;break
  c=m[y][x]
  if c!='.':d=c;v+=[[x,y]]
  if d in'><':x+=[-1,1][d=='>']
  else:y+=[-1,1][d=='v']
except:print 1
</code>```

Takes a string array as input. I have to golf this more but for now it's time to stress over the election.

Ungolfed:

```<code>input = input()

visited = [  ]

dir = ">"
x=0
y=0

try:
    while True:
        if[x,y]in visited:print False;break
        char=input[y][x]
        if char!=".":
            dir=char
            visited+=[[x,y]]

        if dir==">":
            x+=1
        if dir=="<":
            x-=1
        if dir=="v":
            y+=1
        if dir=="^":
            x-=1
except:
    print True
</code>```

Title: Solve the Halting Problem for Befinge

Body:
Python 2, 182 bytes

m,v,d,x,y=input(),[],'>',0,0
try:
 while 1:
  if[x,y]in v:print 0;break
  c=m[y][x]
  if c!='.':d=c;v+=[[x,y]]
  if d in'><':x+=[-1,1][d=='>']
  else:y+=[-1,1][d=='v']
except:print 1

Takes a string array as input. I have to golf this more but for now it's time to stress over the election.

Ungolfed:

input = input()

visited = [  ]

dir = ">"
x=0
y=0

try:
    while True:
        if[x,y]in visited:print False;break
        char=input[y][x]
        if char!=".":
            dir=char
            visited+=[[x,y]]

        if dir==">":
            x+=1
        if dir=="<":
            x-=1
        if dir=="v":
            y+=1
        if dir=="^":
            x-=1
except:
    print True


答:
Turtlèd, 146 bytes

```<code>!u[*.[ r+.]l[ l]dr_+]#*#[ u]d[ (.r)(>.r{.r}@>)(v.d{.d}@v)(<.l{.l}@<)(^.u{.u}@^)(*@0' )],@1(0@0)(v' d)(<' r)(>' l)(^' d)[ u]d[ l]r[ [ r]l[ ' l]dr],
</code>```

This program takes I/O differently: please terminate each line with a space, including the last one. Turtlèd doesn't like newlines, as it uses a grid for it's second dimension of characters.

Try it online!

0 for loops forever, 1 for halts.

General explanation:

It writes the input on the grid, then it actually follows the path the arrows make around the grid, replacing each arrow with a * as it goes, also saving the direction in the char var. If it encounters an *, an arrow it hit before, the program would not halt, so it sets the char var to 0, exit the loop. Otherwise, it will hit the end of the grid and exit the loop. It will write the char var. If it hit the end of grid, it uses the direction stored in the char var to get back to the grid, and sets the char var to 1, for halts. If the char var was actually 0, not a direction, it does not need to get back, as it is still there, and it sets it back to 0. It clears the grid off, then writes the char var, 1 for halts, else 0.

Title: Solve the Halting Problem for Befinge

Body:
Let's define a simple 2D language, which we'll give the incredibly original name befinge. Befinge has 5 instructions:

<>^v, as in most 2D esolangs, redirect the instruction pointer in their respective directions.

. is  a no-op.

The instruction pointer starts out at the top-left corner going right. If the instruction pointer gets to an edge, the program halts. Every Befinge program will obviously either halt or go into an infinite loop which does nothing. Here are two examples:

Halting:

```<code>>.v
..<
</code>```

Non-Halting:

```<code>>....v
..v..<
..>v..
^..<..
</code>```

The halting problem is not solvable for a Turing-complete language, but it is for this one. Your task is to write a program (or function) that takes as input a string representing the befinge program and returns a truthy or falsey value depending on whether it halts or not.

You can assume that the input will consist only of these characters and will be padded with spaces to form a rectangle.

You can use any set of five characters for the instructions (e.g. adws ).

Test Cases

Halting:

```<code>.
</code>```

```<code>v>
>^
</code>```

```<code>....v....
....>...v
.^..<....
.......v<
.......v.
....^..<.
</code>```

```<code>v<>v>v^
>v^>^>v
<>>^v<v
v^<>v^<
</code>```

Non-Halting:

```<code>>..v
^..<
</code>```

```<code>>v<
v<.
>v.
v<.
>.^
</code>```

```<code>>.>.>.v
.><.<.<
</code>```

This is code-golf, so the shortest program (in bytes) wins.

Body:
Turtlèd, 146 bytes

!u[*.[ r+.]l[ l]dr_+]#*#[ u]d[ (.r)(>.r{.r}@>)(v.d{.d}@v)(<.l{.l}@<)(^.u{.u}@^)(*@0' )],@1(0@0)(v' d)(<' r)(>' l)(^' d)[ u]d[ l]r[ [ r]l[ ' l]dr],

This program takes I/O differently: please terminate each line with a space, including the last one. Turtlèd doesn't like newlines, as it uses a grid for it's second dimension of characters.

Try it online!

0 for loops forever, 1 for halts.

General explanation:

It writes the input on the grid, then it actually follows the path the arrows make around the grid, replacing each arrow with a * as it goes, also saving the direction in the char var. If it encounters an *, an arrow it hit before, the program would not halt, so it sets the char var to 0, exit the loop. Otherwise, it will hit the end of the grid and exit the loop. It will write the char var. If it hit the end of grid, it uses the direction stored in the char var to get back to the grid, and sets the char var to 1, for halts. If the char var was actually 0, not a direction, it does not need to get back, as it is still there, and it sets it back to 0. It clears the grid off, then writes the char var, 1 for halts, else 0.


Title: Alternating Fibonacci

Body:
In the alternating Fibonacci sequence, you first start with 1 and 1 as usual.

However, instead of always adding the last two values to get the next number, you alternate starting with adding, and every other time you subtract instead.

The sequence starts like this:

```<code>1
1
2    # 1 + 1
-1   # 1 - 2
1    # 2 + -1
-2   # -1 - 1
-1   # 1 + -2
-1   # -2 - -1
-2   # -1 + -1
1    # -1 - -2
-1   # -2 + 1
2    # 1 - -1
1    # -1 + 2
1    # 2 - 1
</code>```

etc.

Notice that after it starts over once it gets to 1 and 1 again.

Given a number N, print the Nth term of the alternating fibonacci sequence.

Remember, this is code-golf, so the code with the smallest number of bytes wins.

Body:
Perl 6, <s> 39 35 </s> 32 bytes

{(1,1,{|(($/=$^a+$^b),$b-$/)}...*)[$_]}

{(|(334130110314.comb X-2)xx*)[$_]}

{(|334130110314.comb xx*)[$_]-2}

{334130110314.substr($_%12,1)-2}


答:
Turtlèd, 35 bytes

```<code>#112-1_--_1-2#?:[*l+].(-r'1)(_"-2")
</code>```

0 indexed

Explanation:

```<code>#112-1_--_1-2#                      the 12 values of sequence. - is -1, _ is -2
              ?:                    input a number and move right that many
                [*l+]               move back to the asterisk on start cell,
                                    increment sting pointer by amount moved
                     .              write pointed char
                      (-r'1)        if it was -, move right, write 1
                            (_"-2") if it was _, write "-2"
      [print grid]
</code>```

Try it online!

Title: Alternating Fibonacci

Body:
Turtlèd, 35 bytes

#112-1_--_1-2#?:[*l+].(-r'1)(_"-2")

0 indexed

Explanation:

#112-1_--_1-2#                      the 12 values of sequence. - is -1, _ is -2
              ?:                    input a number and move right that many
                [*l+]               move back to the asterisk on start cell,
                                    increment sting pointer by amount moved
                     .              write pointed char
                      (-r'1)        if it was -, move right, write 1
                            (_"-2") if it was _, write "-2"
      [print grid]

Try it online!


问:
Draw a hollow square of # with given width
I got this challenge from Codingame and am curious about better solutions than mine:

Given a width via standard input draw a hollow square of '#' in given width and length.

Example:

5 results in

```<code>#####
#   #
#   #
#   #
#####
</code>```

I used python to solve this so i am particulary interested in other python code. But please feel free to post your solution in any language you want.

答:
Lithp, 117 bytes

Line split in two for readability:

```<code>#N::((var X (repeat "#" N))(print X)(each (seq 3 N) (scope #X::((print (+ "#"
     (repeat " " (- N 2)) "#")))))(print X))
</code>```

Sample usage:

```<code>% square.lithp
(
    (import "lists")
    (def s #N::((var X (repeat "#" N))(print X)(each (seq 3 N) (scope #X::((print (+ "#" (repeat " " (- N 2)) "#")))))(print X)))
    (s 10)
)

Output:
$ ./run square.lithp
##########
#        #
#        #
#        #
#        #
#        #
#        #
#        #
#        #
##########
</code>```

Body:
Lithp, 117 bytes

Line split in two for readability:

#N::((var X (repeat "#" N))(print X)(each (seq 3 N) (scope #X::((print (+ "#"
     (repeat " " (- N 2)) "#")))))(print X))

Sample usage:

% square.lithp
(
    (import "lists")
    (def s #N::((var X (repeat "#" N))(print X)(each (seq 3 N) (scope #X::((print (+ "#" (repeat " " (- N 2)) "#")))))(print X)))
    (s 10)
)

Output:
$ ./run square.lithp
##########
#        #
#        #
#        #
#        #
#        #
#        #
#        #
#        #
##########


Title: Build me a brick wall!

Body:
Challenge

I need help building a brick wall! Throw together some code for me
 using no input and produce the following output wall shown below:

```<code>_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
</code>```

Now, this wall is exactly 10 characters high and 70 characters
 wide.

As stated above, no inputs, only code. Least amount of bytes, we have
 to efficiently build this brick wall. Obviously, this program has to
 function to get the wall built..? or it obviously won't build itself!
 Good luck!

Winner

The winner goes to Marinus using the APL language, requiring a whole 12 bytes!
https://codegolf.stackexchange.com/a/99028/61857

Thank you everyone for participating!

Body:
Haskell, <s>56</s> 47 bytes

unlines$[1..5]>>take 70.cycle<$>["_|__","___|"]


问:
Reverse an xxd hexdump
Given an xxd hexdump such as this one:

```<code>00000000: 1f8b 0808 4920 2258 0003 7069 6c6c 6f77  ....I "X..pillow
00000010: 2e74 7874 00d3 d707 8218 10d0 2799 c545  .txt........'..E
00000020: ba96 41a1 994c 7d60 d650 d53c 44a3 8a22  ..A..L}`.P.<D.."
00000030: cd43 34aa 28d2 3c44 a38a 22cd 4334 aa28  .C4.(.<D..".C4.(
00000040: d20c 00fd 512d 46b8 0500 00              ....Q-F....
</code>```

Reverse it to produce the original input:

```<code>I "Xpillow.txt����'��E��A��L}`�P�<D��"�C4�(�<D��"�C4�(�
                                                      �Q-F�
</code>```

(This is only an approximation of the original input)

You do not need to expand to shellcodes.

Dupe alert

This is not a duplicate of the other xxd hexdump challenge because this one does not to be expanded to shellcodes.

Rules

You may not use external programs that parse hexdumps (such as xxd).

Standard loopholes apply

This is code-golf, smallest code wins.

答:
V, 27 bytes

```<code>ÎdW40|D
Í üî
Ó../<C-v><C-v>x&
éiD@"
</code>```

Try it online!

Note that <C-v> represents the unprintable character 0x16.

Explanation

This answer is pretty fun because it's about modifying the input into V code and then executing that code. I'll explain each command one at a time

```<code>Î                " On every line:
 dW              "   Delete a word
   40|           "   Move to the 40th column
      D          "   Delete everything after this

Í                " Remove all occurrences of
                 " A space
  üî             " or a newline
</code>```

Now the buffer looks like this:

```<code>1f8b080849202258000370696c6c6f772e74787400d3d707821810d02799c545ba9641a1994c7d60d650d53c44a38a22cd4334aa28d23c44a38a22cd4334aa28d20c00fd512d46b8050000
</code>```

The command to insert a character by its hex value is

```<code><C-v>x<hex-value>
</code>```

Here is where we start transforming it into actual V code.

```<code>Ó                " Replace
 ..              "   Two characters
   /             "   with
    <C-v><C-v>x  "   the text "<C-v>x"
               & "   And the two characters we just matched

<C-v>x1fi<C-v>x8bi<C-v>x08i<C-v>x08i<C-v>x49...
</code>```

But the command has to be in insert mode. So we insert an 'i' at the beginning.

```<code>éi               " Insert an 'i'
  D              " Delete this line
   @"            " And evaluate it as V code
</code>```

Title: Reverse an xxd hexdump

Body:
V, 27 bytes

ÎdW40|D
Í üî
Ó../<C-v><C-v>x&
éiD@"

<a href="http://v.tryitonline.net/#code=w45kVzQwfEQKw40gw7zDrgrDky4uLxYWeCYKw6lpREAi&input=MDAwMDAwMDA6IDFmOGIgMDgwOCA0OTIwIDIyNTggMDAwMyA3MDY5IDZjNmMgNmY3NyAgLi4uLkkgIlguLnBpbGxvdwowMDAwMDAxMDogMmU3NCA3ODc0IDAwZDMgZDcwNyA4MjE4IDEwZDAgMjc5OSBjNTQ1ICAudHh0Li4uLi4uLi4nLi5FCjAwMDAwMDIwOiBiYTk2IDQxYTEgOTk0YyA3ZDYwIGQ2NTAgZDUzYyA0NGEzIDhhMjIgIC4uQS4uTH1gLlAuPEQuLiIKMDAwMDAwMzA6IGNkNDMgMzRhYSAyOGQyIDNjNDQgYTM4YSAyMmNkIDQzMzQgYWEyOCAgLkM0LiguPEQuLiIuQzQuKAowMDAwMDA0MDogZDIwYyAwMGZkIDUxMmQgNDZiOCAwNTAwIDAwICAgICAgICAgICAgICAuLi4uUS1GLi4uLg" rel="nofollow noreferrer">Try it online!

Note that <C-v> represents the unprintable character 0x16.

Explanation

This answer is pretty fun because it's about modifying the input into V code and then executing that code. I'll explain each command one at a time

Î                " On every line:
 dW              "   Delete a word
   40|           "   Move to the 40th column
      D          "   Delete everything after this

Í                " Remove all occurrences of
                 " A space
  üî             " or a newline

Now the buffer looks like this:

1f8b080849202258000370696c6c6f772e74787400d3d707821810d02799c545ba9641a1994c7d60d650d53c44a38a22cd4334aa28d23c44a38a22cd4334aa28d20c00fd512d46b8050000

The command to insert a character by its hex value is

<C-v>x<hex-value>

Here is where we start transforming it into actual V code.

Ó                " Replace
 ..              "   Two characters
   /             "   with
    <C-v><C-v>x  "   the text "<C-v>x"
               & "   And the two characters we just matched

<C-v>x1fi<C-v>x8bi<C-v>x08i<C-v>x08i<C-v>x49...

But the command has to be in insert mode. So we insert an 'i' at the beginning.

éi               " Insert an 'i'
  D              " Delete this line
   @"            " And evaluate it as V code


答:
Xamarin.Forms C#, <s>317</s> 313 bytes

```<code>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};}}
</code>```

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

```<code>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
            s.Children.Add(new Label
                {
                    // 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 };
    }
}
</code>```

Title: GO OUT AND VOTE

Body:
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.

Please post an image of your output.

The shortest answer in bytes wins.

Body:
Xamarin.Forms C#, <s>317</s> 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
            s.Children.Add(new Label
                {
                    // 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 };
    }
}


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

```<code>Hillary Clinton   ===-----===>
Donald Trump      ===     ===>
____________      ===     ===>
</code>```

However, if the input is Donald Trump, print:

```<code>Hillary Clinton   ===     ===>
Donald Trump      ===-----===>
____________      ===     ===>
</code>```

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

```<code>Hillary Clinton   ===     ===>
Donald Trump      ===     ===>
Oliver Ni         ===-----===>
</code>```

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

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

答:
V, 104 bytes

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

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. ¯\_(ツ)_/¯

Title: Print a ballot!

Body:
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. ¯\_(ツ)_/¯


问:
Tips for golfing in Rust
While Rust is very, very rarely competitive in code golfing competitions (Java is often shorter), it can still be fun to golf in. What are some tricks for making Rust code shorter?

Please post only one tip in each answer.

答:
If you need many mutable variables, it can waste a lot of space declaring them and initializing them, since each requires the mut keyword and you can't do anything like a=b=c=0. A solution then is to declare a mutable array

```<code>let mut a=[0;5];
</code>```

You spend 3 extra bytes each time you use them vs. a normal variable:

```<code>a[0]+=1;
</code>```

but it can often still be worth it.

Using tuples for the same trick is often an even better option:

```<code>let mut t=(1,4,"this", 0.5, 'c');
</code>```

This has the advantage of saving a byte on each use vs. the array:

```<code>t.0=2
</code>```

It also lets them be of different types. On the downside, it requires more characters to initialize.

Title: Tips for golfing in Rust

Body:
If you need many mutable variables, it can waste a lot of space declaring them and initializing them, since each requires the mut keyword and you can't do anything like a=b=c=0. A solution then is to declare a mutable array

let mut a=[0;5];

You spend 3 extra bytes each time you use them vs. a normal variable:

a[0]+=1;

but it can often still be worth it.

Using tuples for the same trick is often an even better option:

let mut t=(1,4,"this", 0.5, 'c');

This has the advantage of saving a byte on each use vs. the array:

t.0=2

It also lets them be of different types. On the downside, it requires more characters to initialize.


答:
05AB1E, <s>74</s> <s>59</s> 57 bytes

Uses CP-1252 encoding.

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

Try it online!

Title: Print a ballot!

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

```<code>Hillary Clinton   ===-----===>
Donald Trump      ===     ===>
____________      ===     ===>
</code>```

However, if the input is Donald Trump, print:

```<code>Hillary Clinton   ===     ===>
Donald Trump      ===-----===>
____________      ===     ===>
</code>```

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

```<code>Hillary Clinton   ===     ===>
Donald Trump      ===     ===>
Oliver Ni         ===-----===>
</code>```

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

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

Body:
05AB1E, <s>74</s> <s>59</s> 57 bytes

Uses CP-1252 encoding.

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

Try it online!


答:
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+'===>'
```

Title: Print a ballot!


答:
R, 38 bytes

Uses the lookup table solution inspired by @ETHproductions JS answer.

```<code>c(s<-c(2,1,1,2,-1,1),-s)[scan()%%12+1]
</code>```

Edit: Forgot to mention that this is 1-indexed.

Title: Alternating Fibonacci

Body:
R, 38 bytes

Uses the lookup table solution inspired by @ETHproductions JS answer.

c(s<-c(2,1,1,2,-1,1),-s)[scan()%%12+1]

Edit: Forgot to mention that this is 1-indexed.


答:
Bash, 35 bytes

My script looks like this

```<code>echo "^[[47;31mI hope^[[34md^H^H^Ht^H^H^Hv"
</code>```

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

Title: GO OUT AND VOTE

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


问:
Compute the perimeter density matrix

Introduction

The perimeter density matrix is an infinite binary matrix M defined as follows.
Consider a (1-based) index (x, y), and denote by M[x, y] the rectangular sub-matrix spanned by the corner (1, 1) and (x, y).
Suppose that all values of M[x, y] except Mx, y, the value at index (x, y), have already been determined.
Then the value Mx, y is whichever of 0 or 1 that puts the average value of M[x, y] closer to 1 / (x + y).
In case of a tie, choose Mx, y = 1.

This is the sub-matrix M[20, 20] with zeros replaced by dots for clarity:

```<code>1 . . . . . . . . . . . . . . . . . . .
. . . . . 1 . . . . . . . . . . . . . .
. . 1 . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . 1 . . . . . . . . . . . . . . .
. 1 . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . 1 . .
. . . . . . . . . . . . . . 1 . . . . .
. . . . . . . . . . . . 1 . . . . . . .
. . . . . . . . . . 1 . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . 1 . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . 1 . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . 1 . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
</code>```

For example, we have M1, 1 = 1 at the upper left corner, since 1 / (1 + 1) = ½, and the average of the 1 × 1 sub-matrix M[1, 1] is either 0 or 1; that's a tie, so we choose 1.

Consider then the position (3, 4).
We have 1 / (3 + 4) = 1/7, and the average of the sub-matrix M[3, 4] is 1/6 if we choose 0, and 3/12 if we choose 1.
The former is closer to 1/7, so we choose M3, 4 = 0.

Here is the sub-matrix M[800, 800] as an image, showing some of its intricate structure.

The task

Given a positive integer N < 1000, output the N × N sub-matrix M[N, N], in any reasonable format.
The lowest byte count wins.

答:
R, 158 154 141  bytes

Edit: Because the only 1 in the upper 2x2 submatrix is the top left M[1,1] we can start the search for 1s when {x,y}>1 so no need for the if statement.

```<code>M=matrix(0,n<-scan(),n);M[1]=1;for(i in 2:n)for(j in 2:n){y=x=M[1:i,1:j];x[i,j]=0;y[i,j]=1;d=1/(i+j);M[i,j]=abs(d-mean(x))>=abs(d-mean(y))};M
</code>```

The solution is highly inefficient as the matrix is duplicated twice for each iteration. n=1000 took just under two and a half hours to run and produces a matrix of 7.6 Mb.

Ungolfed and explained

```<code>M=matrix(0,n<-scan(),n);                        # Read input from stdin and initialize matrix with 0s
M[1]=1;                                         # Set top left element to 1
for(i in 2:n){                                  # For each row
    for(j in 2:n){                              # For each column
        y=x=M[1:i,1:j];                         # Generate two copies of M with i rows and j columns
        x[i,j]=0;                               # Set bottom right element to 0
        y[i,j]=1;                               # Set bottom right element to 1
        d=1/(i+j);                              # Calculate inverse of sum of indices
        M[i,j]=abs(d-mean(x))>=abs(d-mean(y))   # Returns FALSE if mean(x) is closer to d and TRUE if mean(y) is
    }
};
M                                               # Print to stdout
</code>```

Output for n=20

```<code>      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     1    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[2,]     0    0    0    0    0    1    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[3,]     0    0    1    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[4,]     0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[5,]     0    0    0    0    1    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[6,]     0    1    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[7,]     0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[8,]     0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     1     0     0
[9,]     0    0    0    0    0    0    0    0    0     0     0     0     0     0     1     0     0     0     0     0
[10,]    0    0    0    0    0    0    0    0    0     0     0     0     1     0     0     0     0     0     0     0
[11,]    0    0    0    0    0    0    0    0    0     0     1     0     0     0     0     0     0     0     0     0
[12,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[13,]    0    0    0    0    0    0    0    0    0     1     0     0     0     0     0     0     0     0     0     0
[14,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[15,]    0    0    0    0    0    0    0    0    1     0     0     0     0     0     0     0     0     0     0     0
[16,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[17,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[18,]    0    0    0    0    0    0    0    1    0     0     0     0     0     0     0     0     0     0     0     0
[19,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[20,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
</code>```

Title: Compute the perimeter density matrix

Body:
R, 158 154 141  bytes

Edit: Because the only 1 in the upper 2x2 submatrix is the top left M[1,1] we can start the search for 1s when {x,y}>1 so no need for the if statement.

M=matrix(0,n<-scan(),n);M[1]=1;for(i in 2:n)for(j in 2:n){y=x=M[1:i,1:j];x[i,j]=0;y[i,j]=1;d=1/(i+j);M[i,j]=abs(d-mean(x))>=abs(d-mean(y))};M

The solution is highly inefficient as the matrix is duplicated twice for each iteration. n=1000 took just under two and a half hours to run and produces a matrix of 7.6 Mb.

Ungolfed and explained

M=matrix(0,n<-scan(),n);                        # Read input from stdin and initialize matrix with 0s
M[1]=1;                                         # Set top left element to 1
for(i in 2:n){                                  # For each row
    for(j in 2:n){                              # For each column
        y=x=M[1:i,1:j];                         # Generate two copies of M with i rows and j columns
        x[i,j]=0;                               # Set bottom right element to 0
        y[i,j]=1;                               # Set bottom right element to 1
        d=1/(i+j);                              # Calculate inverse of sum of indices
        M[i,j]=abs(d-mean(x))>=abs(d-mean(y))   # Returns FALSE if mean(x) is closer to d and TRUE if mean(y) is
    }
};
M                                               # Print to stdout

Output for n=20

      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     1    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[2,]     0    0    0    0    0    1    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[3,]     0    0    1    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[4,]     0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[5,]     0    0    0    0    1    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[6,]     0    1    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[7,]     0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[8,]     0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     1     0     0
[9,]     0    0    0    0    0    0    0    0    0     0     0     0     0     0     1     0     0     0     0     0
[10,]    0    0    0    0    0    0    0    0    0     0     0     0     1     0     0     0     0     0     0     0
[11,]    0    0    0    0    0    0    0    0    0     0     1     0     0     0     0     0     0     0     0     0
[12,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[13,]    0    0    0    0    0    0    0    0    0     1     0     0     0     0     0     0     0     0     0     0
[14,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[15,]    0    0    0    0    0    0    0    0    1     0     0     0     0     0     0     0     0     0     0     0
[16,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[17,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[18,]    0    0    0    0    0    0    0    1    0     0     0     0     0     0     0     0     0     0     0     0
[19,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0
[20,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0     0     0     0     0     0     0


答:
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`
`
```

<h3>Demo</h3>

<p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-js lang-js prettyprint-override"><code>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'))</code>```

Title: Print a ballot!

Body:
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'))


答:
Java, 32 bytes

```<code>n->"334130110314".charAt(n%12)-50
</code>```

Since this is Java, the answer is 0-indexed.

Testing and ungolfed:

```<code>class Ideone {
  public static void main (String[] args) throws Exception {
    java.util.function.IntFunction f = n->"334130110314".charAt(n%12)-50;
    for (int i = 0; i < 12; i++) {
      System.out.printf("%d -> %d%n", i, f.apply(i));
    }
  }
}
</code>```

Test on Ideone

Title: Alternating Fibonacci

Body:
In the alternating Fibonacci sequence, you first start with 1 and 1 as usual.

However, instead of always adding the last two values to get the next number, you alternate starting with adding, and every other time you subtract instead.

The sequence starts like this:

```<code>1
1
2    # 1 + 1
-1   # 1 - 2
1    # 2 + -1
-2   # -1 - 1
-1   # 1 + -2
-1   # -2 - -1
-2   # -1 + -1
1    # -1 - -2
-1   # -2 + 1
2    # 1 - -1
1    # -1 + 2
1    # 2 - 1
</code>```

etc.

Notice that after it starts over once it gets to 1 and 1 again.

Given a number N, print the Nth term of the alternating fibonacci sequence.

Remember, this is code-golf, so the code with the smallest number of bytes wins.

Body:
Java, 32 bytes

n->"334130110314".charAt(n%12)-50

Since this is Java, the answer is 0-indexed.

Testing and ungolfed:

class Ideone {
  public static void main (String[] args) throws Exception {
    java.util.function.IntFunction f = n->"334130110314".charAt(n%12)-50;
    for (int i = 0; i < 12; i++) {
      System.out.printf("%d -> %d%n", i, f.apply(i));
    }
  }
}

Test on Ideone