答:
Hot Soup Processor, 48 bytes

```<code>color 255
mes"I  o e
pos,0
color,,-1
mes"  V t d
</code>```

The ungolfed version is:

```<code>color 255,0,0
mes "I  o e"
pos 0,0
color 0,0,255
mes "  V t d"
</code>```

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

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

Title: GO OUT AND VOTE

Body:
Hot Soup Processor, 48 bytes

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

The ungolfed version is:

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

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

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


问:
Operator ASCII art

Challenge

Given an ASCII operator from the list below and a number n, draw an ASCII representation of the operator using that operator as the character with the line segments of the operator having length n.

Input

An ASCII character from the list = + - x / and an integer n where n >= 1.  (I'm using x instead of * and / instead of ÷, but you could use either one, whichever is easier). For + and x, you only have to handle odd numbers to avoid issues with alignment.

Output

An ASCII drawing of the operator composed of the character with segments of length n. Horizontal portions should have spaces between the characters to offset vertical/horizontal distance differences.

Rules

This is code-golf, so shortest code in bytes wins. Standard loopholes are forbidden.

Examples

Input: + 3

```<code>  +
+ + +
  +
</code>```

Input: = 4

```<code>= = = =
= = = =
</code>```

Input: = 10

```<code>= = = = = = = = = =
= = = = = = = = = =
</code>```

Input: - 2

```<code>- -
</code>```

Input: / 10

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

Input: x 7

```<code>x     x
 x   x
  x x
   x
  x x
 x   x
x     x
</code>```

答:
Mathematica, 191 bytes

```<code>e=#~Mod~2==1&;StringRiffle[Normal@SparseArray[{a_,b_}/;(a+b==d+1||a==b)[e@b&&a<3,,e@b&&(a==⌈d/2⌉||b==d),,e@b&&a<2,,a+b==d+1][[Last@ToCharacterCode@#~Mod~10]]:>#,{d=#2,2d-1}," "],"
"," "]&
</code>```

Anonymous function. Takes a string and a number as input, and returns a string as output. Not the shortest by far, but still fun to write.

ContentLicense: CC BY-SA 3.0

Title: Operator ASCII art

Body:
Mathematica, 191 bytes

e=#~Mod~2==1&;StringRiffle[Normal@SparseArray[{a_,b_}/;(a+b==d+1||a==b)[e@b&&a<3,,e@b&&(a==⌈d/2⌉||b==d),,e@b&&a<2,,a+b==d+1][[Last@ToCharacterCode@#~Mod~10]]:>#,{d=#2,2d-1}," "],"
"," "]&

Anonymous function. Takes a string and a number as input, and returns a string as output. Not the shortest by far, but still fun to write.


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

答:
Perl, 57 + 17 = 74 bytes

Run with -MTerm::ANSIColor

```<code>sub c{color$a++%2?blue:red}say c,"I ",c,V,c,o,c,t,c,e,c,d
</code>```

Your terminal may be blue at the end (append ,c("reset") at the end of the code to restore it to normal).

By default, terminals are usually black background, but they can be optionally changed to white, which I personally don't think is cheating.

With picture:

Title: GO OUT AND VOTE

Body:
Perl, 57 + 17 = 74 bytes

Run with -MTerm::ANSIColor

sub c{color$a++%2?blue:red}say c,"I ",c,V,c,o,c,t,c,e,c,d

Your terminal may be blue at the end (append ,c("reset") at the end of the code to restore it to normal).

By default, terminals are usually black background, but they can be optionally changed to white, which I personally don't think is cheating.

With picture:


问:
Sort a list of numbers
About Code-Bowling:

In golf, you try to get the lowest score (smallest application, most elegant, etc). In Bowling, you try to get the highest score. So if you follow, the goal of a Code-Bowling challenge is to make the biggest, most bastardized, hardest to maintain piece of code that still meets the requirements of the challenge. However, there's no point in making source longer just for the sake of it. It needs to seem like that added length was from design and not just padding.

The Challenge:

Create a program that sorts a list of numbers in ascending order.

Example:

Input: 1, 4, 7, 2, 5

Output: 1, 2, 4, 5, 7

Code: Obviously this wouldn't be a good answer, since there aren't many WTFs in there

```<code>function doSort(array $input) {
    sort($input);
    return $input;
}
</code>```

Rules:

There are no real rules.  As long as the program functions, have at it!

Remember: This is code-bowling, not golf.  The objective is to make the worst, most bastardized code that you can!  Bonus points for code that looks good, but is actually deceptively evil...

答:
Bogosort!

```<code>import random

def is_sorted(seq):
    for x, y in zip(seq[:-1], seq[1:]):
        if x > y:
            return False
    return True

def sort(seq):
    while not is_sorted(seq):
        random.shuffle(seq)
</code>```

ContentLicense: CC BY-SA 2.5

Title: Sort a list of numbers

Body:
Bogosort!

import random

def is_sorted(seq):
    for x, y in zip(seq[:-1], seq[1:]):
        if x > y:
            return False
    return True

def sort(seq):
    while not is_sorted(seq):
        random.shuffle(seq)


答:
Powershell, 77 bytes

I must say I thought this would be easier with PowerShell, but it's quite hard to create something more condense than this.

$a=@("/","\");"$(1..6|%{1..3|%{1..6|%{$a[$b]*5;$a[!$b]*5};"rn"}; $b=!$b})"

More readable:

```<code>$a=@("/","\")
"$(1..6|%{
    1..3|%{
     1..6|%{
     $a[$b]*5
     $a[!$b]*5
        }
     "`r`n"}
    $b=!$b})"
</code>```

I'm using the index numbers of the array in order to decide whether I should put \ or / and between every loop I simply toggle the variable.

Title: This is my pillow

Body:
...will you help me immortalize it?

I've had this pillow a few years now, and apparently it's time to get rid of it. Can you please write a function or program, that I can bring with me and use to recreate this pillow whenever I want to reminisce a bit.

It must work with no input arguments.

The output should look exactly like this (trailing newlines and spaces are OK).

```<code>/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
</code>```

This is code golf, so the shortest code in bytes win!

Leaderboard

var QUESTION_ID=98701,OVERRIDE_USER=31516;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

Body:
Powershell, 77 bytes

I must say I thought this would be easier with PowerShell, but it's quite hard to create something more condense than this.

$a=@("/","\");"$(1..6|%{1..3|%{1..6|%{$a[$b]*5;$a[!$b]*5};"rn"}; $b=!$b})"

More readable:

$a=@("/","\")
"$(1..6|%{
    1..3|%{
     1..6|%{
     $a[$b]*5
     $a[!$b]*5
        }
     "`r`n"}
    $b=!$b})"

I'm using the index numbers of the array in order to decide whether I should put \ or / and between every loop I simply toggle the variable.


问:
Product catalog
This problem is about separating a string representing a product identifier into three components.

The first part consists of upper and lower letters of arbitrary length which represents the warehouse.

The second part is digits which represents the product number. This part is also of arbitrary length.

The last part is qualifiers as size and colours, and this part continues to the end of the string. The qualifiers are guaranteed to start with a capital letter and consist of alphanumeric characters.

Each part should be printed clearly separated. It is guaranteed that each part is non-empty.

The winner is the one who uses least bytes to solve this problem.

Example:

Input: UK7898S14

Output:

UK

7898

S14

Here UK is United Kingdom, 7898 is the product code, and S14 is size 14.

Example 2:

Input: cphDK1234CYELLOWS14QGOOD

Output:

cphDK

1234

CYELLOWS14QGOOD

Here cphDK is Copenhagen, Denmark, 1234 is the product code, CYELLOWS14QGOOD represents yellow colour, size 14, and good quality.

答:
PHP, 48 bytes

```<code>print_r(preg_split('/(\D+|\d+)\K/',$argv[1],3));
</code>```

With its $limit parameter, and the fantastically useful \K, preg_split() is perfect for this challenge.

Title: Product catalog

Body:
PHP, 48 bytes

print_r(preg_split('/(\D+|\d+)\K/',$argv[1],3));

With its $limit parameter, and the fantastically useful \K, preg_split() is perfect for this challenge.


问:
Test a number for narcissism
A Narcissistic Number is a number which is the sum of its own digits, each raised to the power of the number of digits.

For example, take \$153\$ (3 digits):

\$1^3 + 5^3 + 3^3 = 153\$

\$1634\$:

\$1^4 + 6^4 + 3^4 + 4^4 = 1634 = 1 + 1296 + 81 + 256 = 1634\$

The Challenge:

Your code must take input from the user and output True or False depending upon whether the given number is a Narcissistic Number.

Error checking for text strings or other invalid inputs is not required. 1 or 0 for the output is acceptable. Code that simply generates a list of Narcissistic Numbers, or checks the user input against a hardcoded list, does not qualify.

OEIS A005188

答:
05AB1E (legacy), 7 bytes

```<code>DSDgmOQ
</code>```

Try it online!

-2 bytes thanks to @daHugLenny

ContentLicense: CC BY-SA 4.0

Title: Test a number for narcissism

Body:
05AB1E (legacy), 7 bytes

DSDgmOQ

Try it online!

-2 bytes thanks to @daHugLenny


答:
Python, <s>99</s> 87 bytes

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

Try it online

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, <s>99</s> 87 bytes

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

Try it online


问:
Square-unspiral the string!
Given a string, first square it as follows:

First, write the string.

```<code>abcde
</code>```

Next, write the string rotated one left.

```<code>abcde
bcdea
</code>```

Keep doing this until you have written len(string) lines.

```<code>abcde
bcdea
cdeab
deabc
eabcd
</code>```

Now, read from the string like this:

```<code>----+
+--+|
|+>||
|+-+|
+---+
</code>```

Which gives:

```<code>abcdeabcdcbaedcbcdeabaede
</code>```

Print this string.

Test cases

```<code>abcdef -> abcdefabcdedcbafedcbcdefabcbafedefaf
cena! -> cena!cenanec!anena!cec!a!
ppcg -> ppcgppcppgcpcgpg
abc -> abcabacbc
ab -> abab
a -> a
 ->
</code>```

Please comment if a test case is incorrect.

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

答:
Python 3, 59 bytes

x=input()*2
while x:x=x[:-1];print(x,end='');x=x[:-1][::-1]
```

repl.it

A direct port of my Jelly answer; only a full program taking input (rather than a function).

The print(x,end='') is a print statement which will not print the default newline.

Title: Square-unspiral the string!

Body:
Python 3, 59 bytes

x=input()*2
while x:x=x[:-1];print(x,end='');x=x[:-1][::-1]

repl.it

A direct port of my Jelly answer; only a full program taking input (rather than a function).

The print(x,end='') is a print statement which will not print the default newline.


答:
SOML, <s>104</s> 100 bytes (non-competing)

```<code>    Cd³³b»E +=?ce*d+e{t}bd*Oe{t}} ==?b*tt} -=?b*t} /=?bc*b{j:d+p}} x=?"”cb*e{jj⁴⁴d;d+++tGG;c+;}XOdoe{O
</code>```

This is kind-of competing as I'm pretty sure that everything I used here has docs on github before this questions posting date but the parser doesn't have support for some functions I used so idk.

Title: Operator ASCII art

Body:
Challenge

Given an ASCII operator from the list below and a number n, draw an ASCII representation of the operator using that operator as the character with the line segments of the operator having length n.

Input

An ASCII character from the list = + - x / and an integer n where n >= 1.  (I'm using x instead of * and / instead of ÷, but you could use either one, whichever is easier). For + and x, you only have to handle odd numbers to avoid issues with alignment.

Output

An ASCII drawing of the operator composed of the character with segments of length n. Horizontal portions should have spaces between the characters to offset vertical/horizontal distance differences.

Rules

This is code-golf, so shortest code in bytes wins. Standard loopholes are forbidden.

Examples

Input: + 3

```<code>  +
+ + +
  +
</code>```

Input: = 4

```<code>= = = =
= = = =
</code>```

Input: = 10

```<code>= = = = = = = = = =
= = = = = = = = = =
</code>```

Input: - 2

```<code>- -
</code>```

Input: / 10

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

Input: x 7

```<code>x     x
 x   x
  x x
   x
  x x
 x   x
x     x
</code>```

Body:
SOML, <s>104</s> 100 bytes (non-competing)

    Cd³³b»E +=?ce*d+e{t}bd*Oe{t}} ==?b*tt} -=?b*t} /=?bc*b{j:d+p}} x=?"”cb*e{jj⁴⁴d;d+++tGG;c+;}XOdoe{O

This is kind-of competing as I'm pretty sure that everything I used here has docs on github before this questions posting date but the parser doesn't have support for some functions I used so idk.


Title: Operator ASCII art

Body:
PHP, <s>306</s> <s>292</s> <s>281</s> <s>282</s> <s>281</s> <s>275</s> 270 bytes

$r=str_pad("",2*$n=$argv[2],($c=$argv[1])." ")."\n";if(",">$c)$r=($m=str_repeat(str_pad($c,$n," ",0)."\n",$n/2))."$r$m";if(9<$c)$r.=$r;if(w<$c)for($r=$c;$i<$n;$r[$i*(2+$n)]=$r[++$i*$n-1]=x)$r[$i*$n+$i+$n]="\n";if("/"==$c)for($r=$s="";$i++<$n;$s.=" ")$r="$s/\n$r";echo$r;

Ooh this is bulky ... needs further golfing.

I could save 4 bytes with physical linebreaks or one byte with putting "\n" into a variable.


问:
Depalindromize this string!
Given a palindrome generated according to this challenge, depalindromize it.

Test cases

```<code>abcdedcba -> abcde
johncenanecnhoj -> johncena
ppapapp -> ppap
codegolflogedoc -> codegolf
</code>```

As this is about depalindromizing, your code cannot be a palindrome.

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

答:
Python 3.5, 87 Bytes

```<code>x=list(input())
for q in range(0,int(round((len(x)/2)-0.1,0))):x.pop()
print(''.join(x))
</code>```

i'm new to this codegolfing, but it's to be fun. I probably won't win but oh well.

Title: Depalindromize this string!

Body:
Python 3.5, 87 Bytes

x=list(input())
for q in range(0,int(round((len(x)/2)-0.1,0))):x.pop()
print(''.join(x))

i'm new to this codegolfing, but it's to be fun. I probably won't win but oh well.


Title: GO OUT AND VOTE

Body:
Bash, 61 bytes

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

with white background 61 + 9 byte:

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


Title: GO OUT AND VOTE

Body:
Bubblegum, 28 bytes

0000000: 938e 3636 ccf5 0492 e6b9 0a40 d224 370c  ..66.......@.$7.
0000010: 2c92 0f66 9780 d9a9 6076 0a00            ,..f....`v..

Does not work online since it uses ANSI color codes for coloring.


答:
Python, 90 Bytes

```<code>a,z=input(),[]
for x in list(a):z.append(int(x)**len(a))
print(1 if sum(z)==int(a) else 0)
</code>```

Title: Test a number for narcissism

Body:
A Narcissistic Number is a number which is the sum of its own digits, each raised to the power of the number of digits.

For example, take \$153\$ (3 digits):

\$1^3 + 5^3 + 3^3 = 153\$

\$1634\$:

\$1^4 + 6^4 + 3^4 + 4^4 = 1634 = 1 + 1296 + 81 + 256 = 1634\$

The Challenge:

Your code must take input from the user and output True or False depending upon whether the given number is a Narcissistic Number.

Error checking for text strings or other invalid inputs is not required. 1 or 0 for the output is acceptable. Code that simply generates a list of Narcissistic Numbers, or checks the user input against a hardcoded list, does not qualify.

OEIS A005188

Body:
Python, 90 Bytes

a,z=input(),[]
for x in list(a):z.append(int(x)**len(a))
print(1 if sum(z)==int(a) else 0)


答:
Racket 115 bytes

```<code>(let*((l(number->string n))(g(string-length l))(m(for/sum((i l))(expt(string->number(string i))g))))(if(= m n)1 0))
</code>```

Ungolfed:

```<code>(define (f n)
  (let* ((l (number->string n))
         (g (string-length l))
         (m (for/sum ((i l))
              (expt (string->number(string i)) g))))
    (if (= m n) 1 0)))
</code>```

Testing:

```<code>(f 153)
(f 1634)
(f 123)
(f 654)
</code>```

Output:

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

Title: Test a number for narcissism

Body:
Racket 115 bytes

(let*((l(number->string n))(g(string-length l))(m(for/sum((i l))(expt(string->number(string i))g))))(if(= m n)1 0))

Ungolfed:

(define (f n)
  (let* ((l (number->string n))
         (g (string-length l))
         (m (for/sum ((i l))
              (expt (string->number(string i)) g))))
    (if (= m n) 1 0)))

Testing:

(f 153)
(f 1634)
(f 123)
(f 654)

Output:

1
1
0
0


Title: Operator ASCII art

Body:
C, 396 bytes

#define p(x) printf(x);
i,j,k,m;f(char s,int n){i=k=0;if(s==45)for(;i<n;++i)p("- ")m=n/2;if(s==43)for(;i<n;++i)for(j=0;j<=m;++j)if(i-m)p(j-m?"  ":"+\n")else{for(;k<n;++k)p("+ ")p("\n")j+=m;}if(s==61)for(;i<2;++i){for(k=0;k<n;++k)p("= ")p("\n")}j=n;if(s==47)for(;i<n;++i){--j;for(k=0;k<j;++k)p(" ")p("/\n")}if(s==120)for(;i<n;++i){k=m-abs(m-i);for(j=0;j<n-k;++j)p(j-k?" ":"x")p(i-m?"\bx\n":"\n")}}

Call with:

int main()
{
   f('x', 5);
   return 0;
}


答:
Ruby, 28 bytes

```<code>->s{puts s.sub(/\d+/,"\n\\&\n")}
</code>```

This surrounds the first cluster of digits with newlines.

Title: Product catalog

Body:
This problem is about separating a string representing a product identifier into three components.

The first part consists of upper and lower letters of arbitrary length which represents the warehouse.

The second part is digits which represents the product number. This part is also of arbitrary length.

The last part is qualifiers as size and colours, and this part continues to the end of the string. The qualifiers are guaranteed to start with a capital letter and consist of alphanumeric characters.

Each part should be printed clearly separated. It is guaranteed that each part is non-empty.

The winner is the one who uses least bytes to solve this problem.

Example:

Input: UK7898S14

Output:

UK

7898

S14

Here UK is United Kingdom, 7898 is the product code, and S14 is size 14.

Example 2:

Input: cphDK1234CYELLOWS14QGOOD

Output:

cphDK

1234

CYELLOWS14QGOOD

Here cphDK is Copenhagen, Denmark, 1234 is the product code, CYELLOWS14QGOOD represents yellow colour, size 14, and good quality.

Body:
Ruby, 28 bytes

->s{puts s.sub(/\d+/,"\n\\&\n")}

This surrounds the first cluster of digits with newlines.


问:
Fizz Buzz for Turtles

Problem Description

Imagine you're a turtle on a grid.  You're given two numbers f and b, and you're facing east. You perform a march across the grid, counting each of the cells you encounter, according to the following rules:

By default, you write the count to the cell you're in, then walk forward.

If the count is divisible by f, you write F to the cell you're in, then turn right, then walk forward.

If the count is divisible by b, you write B to the cell you're in, then turn left, then walk forward.

If the count is divisible by both f and b, you write FB to the cell you're in, then walk forward.

If you reach a square you've already been to, you stop.

For example, following these rules using f = 3 and b = 5 will generate a pattern like this:

```<code>    F 28 29 FB  1  2  F
   26                 4
 F  B                 B  F
23                       7
22                       8
 F  B                 B  F
   19                11
    F 17 16 FB 14 13  F
</code>```

The challenge

Write a program or function that accepts two numbers as input, corresponding to f and b, and produces as output the pattern for these numbers given by the rules above.

Formatting requirements:

Each cell is two characters wide

Cell contents are right aligned within these two characters

Cells on the same row are delimited by a space

The first column of cells must contain a non-empty cell

All rows must contain non-empty cells

Trailing whitespace is not required, but allowed

However, the total width of each row must not exceed 3 times the number of non-empty columns

Your code must work for provided test cases.

Standard loopholes are disallowed.

This is code golf; shortest answer in bytes wins.

Test cases

(f=3, b=5 case repeated here as a courtesy convenience).

```<code>f=3, b=5 ->
    F 28 29 FB  1  2  F
   26                 4
 F  B                 B  F
23                       7
22                       8
 F  B                 B  F
   19                11
    F 17 16 FB 14 13  F

f=4, b=10 ->
 F 25 26 27  F
23          29
22        1  2  3  F
21                 5
FB                 6
19                 7
18           B  9  F
17          11
 F 15 14 13  F

f=3, b=11 ->
 F 16 17  F
14       19
13     1  2  F
 F  B        4
   10        5
    F  8  7  F

f=5, b=9 ->
    F 41 42 43 44  1  2  3  4  F
   39                          6
   38                          7
   37                          8
 F  B                          B  F
34                               11
33                               12
32                               13
31                               14
 F 29 28  B              B 17 16  F
         26             19
          F 24 23 22 21  F

f=5, b=13 ->
    F 31 32 33 34  F
   29             36
   28        1  2  3  4  F
   27                    6
 F  B                    7
24                       8
23                       9
22              B 12 11  F
21             14
 F 19 18 17 16  F
</code>```

答:
Perl, 275 bytes

Indentation is provided for readability and is not part of the code.

```<code>($f,$e)=@ARGV;
for($i=$x=1,$y=0;!$m{"$x,$y"};$i++){
    ($g,$m{"$x,$y"})=$i%$e&&$i%$f?($g,$i):$i%$f?($g+1,B):$i%$e?($g-1,F):($g,FB);
    ($g%=4)%2?($y+=$g-2):($x+=1-$g);
    ($a>$x?$a:$b<$x?$b:$x)=$x;
    ($c>$y?$c:$d<$y?$d:$y)=$y
}
for$k($c..$d){
    printf("%*s",1+length$i,$m{"$_,$k"})for$a..$b;
    say
}
</code>```

Explanation:

The code works by keeping track of a hash of all places the turtle has been, and the appropriate value, stored in %m.  For example: in 3 5, $m{0,2} contains 2, and $m{1,-3} = 26.  It continues in this fashion until it reaches a place that has already been defined.  Additionally, it keeps track of the current boundaries of the turtle's path, using $a,$b,$c,$d as maximums and minimums.

Once it reaches a place it has already been, it prints the path using the boundaries, everything padded with spaces.

There is no limit to the size of the path, nor the size of the numbers.

Title: Fizz Buzz for Turtles

Body:
Perl, 275 bytes

Indentation is provided for readability and is not part of the code.

($f,$e)=@ARGV;
for($i=$x=1,$y=0;!$m{"$x,$y"};$i++){
    ($g,$m{"$x,$y"})=$i%$e&&$i%$f?($g,$i):$i%$f?($g+1,B):$i%$e?($g-1,F):($g,FB);
    ($g%=4)%2?($y+=$g-2):($x+=1-$g);
    ($a>$x?$a:$b<$x?$b:$x)=$x;
    ($c>$y?$c:$d<$y?$d:$y)=$y
}
for$k($c..$d){
    printf("%*s",1+length$i,$m{"$_,$k"})for$a..$b;
    say
}

Explanation:

The code works by keeping track of a hash of all places the turtle has been, and the appropriate value, stored in %m.  For example: in 3 5, $m{0,2} contains 2, and $m{1,-3} = 26.  It continues in this fashion until it reaches a place that has already been defined.  Additionally, it keeps track of the current boundaries of the turtle's path, using $a,$b,$c,$d as maximums and minimums.

Once it reaches a place it has already been, it prints the path using the boundaries, everything padded with spaces.

There is no limit to the size of the path, nor the size of the numbers.


答:
Jelly, 14 bytes

```<code>O<65ITḣ2‘ṬœṗµY
</code>```

TryItOnline!

How?

```<code>O<65ITḣ2‘ṬœṗµY - Main link: productIdentifier   e.g. "UK7898S14"
O              - cast to ordinals               e.g. [85,75,55,56,57,56,83,49,52]
 <65           - less than 65?                  e.g. [ 0, 0, 1, 1, 1, 1, 0, 1, 1]
    I          - incremental difference         e.g. [ 0, 1, 0, 0, 0,-1, 1, 0]
     T         - truthy indexes                 e.g. [2, 6, 7]
      ḣ2       - head to 2                      e.g. [2, 6]
        ‘      - increment                      e.g. [3, 7]
         Ṭ     - set truthy indexes             e.g. [0, 0, 1, 0, 0, 0, 1]
          œṗ   - split y at truthy indexes of x e.g. ["UK", "7898", "S14"]
            µ  - monadic chain separation
             Y - join with line feeds
</code>```

Title: Product catalog

Body:
Jelly, 14 bytes

O<65ITḣ2‘ṬœṗµY

TryItOnline!

How?

O<65ITḣ2‘ṬœṗµY - Main link: productIdentifier   e.g. "UK7898S14"
O              - cast to ordinals               e.g. [85,75,55,56,57,56,83,49,52]
 <65           - less than 65?                  e.g. [ 0, 0, 1, 1, 1, 1, 0, 1, 1]
    I          - incremental difference         e.g. [ 0, 1, 0, 0, 0,-1, 1, 0]
     T         - truthy indexes                 e.g. [2, 6, 7]
      ḣ2       - head to 2                      e.g. [2, 6]
        ‘      - increment                      e.g. [3, 7]
         Ṭ     - set truthy indexes             e.g. [0, 0, 1, 0, 0, 0, 1]
          œṗ   - split y at truthy indexes of x e.g. ["UK", "7898", "S14"]
            µ  - monadic chain separation
             Y - join with line feeds


问:
Print a 10 by 10 grid of asterisks

Background

This is a standard textbook example to demonstrate for loops.

This is one of the first programs I learnt when I started learning programming ~10 years ago.

Task

You are to print this exact text:

```<code>**********
**********
**********
**********
**********
**********
**********
**********
**********
**********
</code>```

Specs

You may have extra trailing newlines.

You may have extra trailing spaces (U+0020) at the end of each line, including the extra trailing newlines.

Scoring

This is code-golf. Shortest answer in bytes wins.

Title: Print a 10 by 10 grid of asterisks

Body:
BrainFuck, 68 Bytes

++[>+++++<-]++[>>>+++++<<<-]++++++[>>+++++++<<-]>[>..........>.<<-]

BrainFuck is fun, this is me practicing my skills.


答:
Retina, 118 bytes

Byte count assumes ISO 8859-1 encoding.

```<code>.*
$0 $0¶$0
(?<=^\d*)\d
x
(?=.*$)
¶
0¶

\d+
$*
¶(1+)
¶$1 $1
{`^x ?

}s`(?<=x.*)1(?=1* (1+))
$1
 1*

1¶1
11
^(1*)¶+\1\b
</code>```

Try it online

Explanation

```<code>.*                          # Copy number 3 times. For Length, Unary, and Digits
$0 $0¶$0
(?<=^\d*)\d                 # Convert first copy to x's (Length)
x
(?=.*$)                     # Split up digits of last copy, each on their own line
¶
0¶                          # Remove zeros, because they leave blank lines

\d+                         # Convert to unary
$*
¶(1+)                       # Duplicate each separated digit
¶$1 $1
{`^x ?                      # While x's exist, remove an x ...

}s`(?<=x.*)1(?=1* (1+))     #     and multiply each value by the digit (nth power)
$1
 1*                         # Remove original digits

1¶1                         # Remove lines between digits
11
^(1*)¶+\1\b                 # Match if values are equal
</code>```

Title: Test a number for narcissism

Body:
Retina, 118 bytes

Byte count assumes ISO 8859-1 encoding.

.*
$0 $0¶$0
(?<=^\d*)\d
x
(?=.*$)
¶
0¶

\d+
$*
¶(1+)
¶$1 $1
{`^x ?

}s`(?<=x.*)1(?=1* (1+))
$1
 1*

1¶1
11
^(1*)¶+\1\b

Try it online

Explanation

.*                          # Copy number 3 times. For Length, Unary, and Digits
$0 $0¶$0
(?<=^\d*)\d                 # Convert first copy to x's (Length)
x
(?=.*$)                     # Split up digits of last copy, each on their own line
¶
0¶                          # Remove zeros, because they leave blank lines

\d+                         # Convert to unary
$*
¶(1+)                       # Duplicate each separated digit
¶$1 $1
{`^x ?                      # While x's exist, remove an x ...

}s`(?<=x.*)1(?=1* (1+))     #     and multiply each value by the digit (nth power)
$1
 1*                         # Remove original digits

1¶1                         # Remove lines between digits
11
^(1*)¶+\1\b                 # Match if values are equal


答:
Haskell, <s>68</s> 66 bytes

```<code>d 0=[]
d n=mod n 10:d(div n 10)
sum.(\a->map(^length a)a).d>>=(==)
</code>```

Usage:

```<code>*Main> sum.(\a->map(^length a)a).d>>=(==) $ 1634
True
</code>```

Title: Test a number for narcissism

Body:
Haskell, <s>68</s> 66 bytes

d 0=[]
d n=mod n 10:d(div n 10)
sum.(\a->map(^length a)a).d>>=(==)

Usage:

*Main> sum.(\a->map(^length a)a).d>>=(==) $ 1634
True


答:
Stuck, 10 Bytes

Very simple implementation here, no tricks ;)

```<code>'*10*N+10*
</code>```

Explanation:

```<code>'*           # Enter char mode, puts '*' on the stack
  10*        # Multiply string by 10, puts '**********' on the stack
     N+      # Push a newline to the stack and append to the asterisks
       10*   # Multiply that string by 10 and implicitly print.
</code>```

Title: Print a 10 by 10 grid of asterisks

Body:
Background

This is a standard textbook example to demonstrate for loops.

This is one of the first programs I learnt when I started learning programming ~10 years ago.

Task

You are to print this exact text:

```<code>**********
**********
**********
**********
**********
**********
**********
**********
**********
**********
</code>```

Specs

You may have extra trailing newlines.

You may have extra trailing spaces (U+0020) at the end of each line, including the extra trailing newlines.

Scoring

This is code-golf. Shortest answer in bytes wins.

Body:
Stuck, 10 Bytes

Very simple implementation here, no tricks ;)

'*10*N+10*

Explanation:

'*           # Enter char mode, puts '*' on the stack
  10*        # Multiply string by 10, puts '**********' on the stack
     N+      # Push a newline to the stack and append to the asterisks
       10*   # Multiply that string by 10 and implicitly print.


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

答:
Stuck, <s>29</s> 27 Bytes

Pretty darn long for a "golfing" language, but I have forgotten how a lot of it works :P

```<code>i_2-_u'#*N+_'#' u*'#N+++u*u
</code>```

Explanation:

```<code>i_2-_u                           # take input and triplicate, subtracting 2 (5 -> [3,3,5])
      '#*N+_                     # create the top and bottom rows
            '#' u*'#N+++u*       # create input - 2 copies of middle rows
                          u      # rotate left 1 to get correct order, implicit output
</code>```

Body:
Stuck, <s>29</s> 27 Bytes

Pretty darn long for a "golfing" language, but I have forgotten how a lot of it works :P

i_2-_u'#*N+_'#' u*'#N+++u*u

Explanation:

i_2-_u                           # take input and triplicate, subtracting 2 (5 -> [3,3,5])
      '#*N+_                     # create the top and bottom rows
            '#' u*'#N+++u*       # create input - 2 copies of middle rows
                          u      # rotate left 1 to get correct order, implicit output


问:
Divide a number by 3 without using *, /, +, -, % operators
Quoting this question on SO (Spoiler alert!):

This question has been asked in an Oracle interview.

How would you divide a number by 3 without using *, /, +, -, %,
  operators?

The number may be signed or unsigned.

The task is solvable, but see if you can write the shortest code.

Rules:

Perform the required integer division (/3)

Do not use the non-text-based operators *, /, +, -, or % (or their equivalents, such as __div__ or add()). This also applies to incrementing and decrementing operators, like i++ or i--. Use of operators for string concatenation and formatting are OK. Using these characters for different operators, such as unary - operator for negative numbers, or * to represent a pointer in C is OK as well.

Input value can be arbitrarily large (whatever your system can handle), both positive and negative

Input can be on STDIN or ARGV or entered any other way

Create the shortest code you can to do the above

答:
Python 3, 61 bytes

```<code>from numpy import*;f=lambda x:int(base_repr(x,base=3)[:-1],3)
</code>```

This doesn't win, but I think it's a clever method that hasn't been used in the other Python entries, so I'm posting it here.

Body:
Python 3, 61 bytes

from numpy import*;f=lambda x:int(base_repr(x,base=3)[:-1],3)

This doesn't win, but I think it's a clever method that hasn't been used in the other Python entries, so I'm posting it here.


答:
C, <s>252</s> <s>220</s> <s>225</s> 111 bytes

int f(char *a){for(int i=0;i<strlen(a);i++){r+=((int)a[i]);for(int j=0;j<strlen(a);j++)r*=r;}return r==(int)a;}
```

Returns 0 if false and 1 if true. Thanks to @DrMcMoylex for saving many bytes and explaining stuff.

Title: Test a number for narcissism

Body:
C, <s>252</s> <s>220</s> <s>225</s> 111 bytes

int f(char *a){for(int i=0;i<strlen(a);i++){r+=((int)a[i]);for(int j=0;j<strlen(a);j++)r*=r;}return r==(int)a;}

Returns 0 if false and 1 if true. Thanks to @DrMcMoylex for saving many bytes and explaining stuff.


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

```<code>&4I &1V&4o&1t&4e&1d
</code>```

or from the clientside:

```<code>§4I §1V§4o§1t§4e§1d
</code>```

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

Mind the rules:

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

All of these are true, as:

the red and blue ARE approximations (though still very similar).

The background in Minecraft chat is transparent, meaning that it's possible to put this on a white background (such as an empty world or a world which is still generating).

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:
 Minecraft Chat (vanilla 1.10 client, spigot 1.10 server): 19 bytes

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

or from the clientside:

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

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

Mind the rules:

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

All of these are true, as:

the red and blue ARE approximations (though still very similar).

The background in Minecraft chat is transparent, meaning that it's possible to put this on a white background (such as an empty world or a world which is still generating).


答:
Jelly, 7 bytes (non-competing)

```<code>D*DL$S⁼
</code>```

Try it online!

Or alternatively (uses 2 chains):

```<code>Dµ*LS⁼Ḍ
</code>```

Explanation of the first code:

```<code> D* DL$S⁼  Main link (monadic). Arguments: z
⁸          (implicit) z
 D         List of digits of z
   ⁸       (implicit) z
    D      List of digits of z
     L     Length of z
      $    Last two links as a monad
  *        Exponentiation with base x and exponent y
       S   Sum of z
         ⁸ (implicit) z
        ⁼  Check if x equals y
</code>```

Title: Test a number for narcissism

Body:
A Narcissistic Number is a number which is the sum of its own digits, each raised to the power of the number of digits.

For example, take \$153\$ (3 digits):

\$1^3 + 5^3 + 3^3 = 153\$

\$1634\$:

\$1^4 + 6^4 + 3^4 + 4^4 = 1634 = 1 + 1296 + 81 + 256 = 1634\$

The Challenge:

Your code must take input from the user and output True or False depending upon whether the given number is a Narcissistic Number.

Error checking for text strings or other invalid inputs is not required. 1 or 0 for the output is acceptable. Code that simply generates a list of Narcissistic Numbers, or checks the user input against a hardcoded list, does not qualify.

OEIS A005188

Body:
Jelly, 7 bytes (non-competing)

D*DL$S⁼

Try it online!

Or alternatively (uses 2 chains):

Dµ*LS⁼Ḍ

Explanation of the first code:

 D* DL$S⁼  Main link (monadic). Arguments: z
⁸          (implicit) z
 D         List of digits of z
   ⁸       (implicit) z
    D      List of digits of z
     L     Length of z
      $    Last two links as a monad
  *        Exponentiation with base x and exponent y
       S   Sum of z
         ⁸ (implicit) z
        ⁼  Check if x equals y


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, <s>47</s> <s>34</s> 29 bytes

$_="_|__"x175;say for/.{70}/g


Title: Build me a brick wall!

Body:
APL, 12 bytes

10 70⍴'_|__'

Output:

      10 70⍴'_|__'
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__


答:
V, <s>24</s>, 16 bytes

```<code>175i_|__ò70|lé
</code>```

Try it online!
This contains <esc> characters (0x1B) so here is a hexdump:

```<code>0000000: 3137 3569 5f7c 5f5f 1bf2 3730 7c6c e90a  175i_|__..70|l..
</code>```

8 bytes indirectly saved thanks to Jordan!

Title: Build me a brick wall!

Body:
V, <s>24</s>, 16 bytes

175i_|__ò70|lé

Try it online!
This contains <esc> characters (0x1B) so here is a hexdump:

0000000: 3137 3569 5f7c 5f5f 1bf2 3730 7c6c e90a  175i_|__..70|l..

8 bytes indirectly saved thanks to Jordan!


Title: Build me a brick wall!

Body:
PHP, <s>44</s> <s>42</s> 41 characters

<?=chunk_split(str_pad(_,700,"|___"),70);

(Just because had no chance to use chunk_split() ever before.)

Thanks to:

user59178 for suggesting to use str_pad() (-1 character)

Sample run:

bash-4.3$ php <<< '<?=chunk_split(str_pad(_,700,"|___"),70);'
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__


答:
Jelly, 14 bytes

```<code>“_|__”ṁ700s70Y
</code>```

TryItOnline!

How?

```<code>“_|__”ṁ700s70Y - Main link: no arguments
“_|__”         - literal ['_','|','_','_']
      ṁ700     - mould like something 700 long
          s70  - split into chunks of length 70
             Y - join with line feeds
</code>```

Title: Build me a brick wall!

Body:
Jelly, 14 bytes

“_|__”ṁ700s70Y

TryItOnline!

How?

“_|__”ṁ700s70Y - Main link: no arguments
“_|__”         - literal ['_','|','_','_']
      ṁ700     - mould like something 700 long
          s70  - split into chunks of length 70
             Y - join with line feeds


答:
05AB1E, 13 bytes

Code:

```<code>"_|__"175×Tä»
</code>```

Explanation:

```<code>"_|__"         # For the string "_|__"
      175×     # Repeat that 175 times
          Tä   # Split into 10 even pieces
            »  # And join them by newlines
</code>```

Uses the CP-1252 encoding. Try it online!

Title: Build me a brick wall!

Body:
05AB1E, 13 bytes

Code:

"_|__"175×Tä»

Explanation:

"_|__"         # For the string "_|__"
      175×     # Repeat that 175 times
          Tä   # Split into 10 even pieces
            »  # And join them by newlines

Uses the CP-1252 encoding. Try it online!


答:
BBC BASIC, 28 bytes

Tokenised filesize 23 bytes.

```<code>WIDTH70P.STRING$(175,"_|__")
</code>```

WIDTH70 would normally be followed by a newline. It sets the field width to 70. Then we just print 175 copies of the string, which wrap around.

Title: Build me a brick wall!

Body:
BBC BASIC, 28 bytes

Tokenised filesize 23 bytes.

WIDTH70P.STRING$(175,"_|__")

WIDTH70 would normally be followed by a newline. It sets the field width to 70. Then we just print 175 copies of the string, which wrap around.


答:
PHP, <s>199</s> <s>201</s> 151 bytes

This script outputs image to standard output. Updated thanks to manatwork

```<code>imagefill($i=imagecreatetruecolor(99,99),0,0,2**24-1);foreach([I,' ',V,o,t,e,d]as$k=>$e)imagestring($i,2,$k*9,0,$e,!$k|$k&1?0xFF0000:255);imagepng($i);
</code>```

Run it in the command line like this:

```<code>php -d error_reporting=0 -r "imagefill($i=imagecreatetruecolor(99,99),0,0,2**24-1);foreach([I,' ',V,o,t,e,d]as$k=>$e)imagestring($i,2,$k*9,0,$e,!$k|$k&1?0xFF0000:255);imagepng($i);" > output.png
</code>```

Output:

Title: GO OUT AND VOTE

Body:
PHP, <s>199</s> <s>201</s> 151 bytes

This script outputs image to standard output. Updated thanks to manatwork

imagefill($i=imagecreatetruecolor(99,99),0,0,2**24-1);foreach([I,' ',V,o,t,e,d]as$k=>$e)imagestring($i,2,$k*9,0,$e,!$k|$k&1?0xFF0000:255);imagepng($i);

Run it in the command line like this:

php -d error_reporting=0 -r "imagefill($i=imagecreatetruecolor(99,99),0,0,2**24-1);foreach([I,' ',V,o,t,e,d]as$k=>$e)imagestring($i,2,$k*9,0,$e,!$k|$k&1?0xFF0000:255);imagepng($i);" > output.png

Output:


Title: Build me a brick wall!

Body:
Perl, 31 bytes

say+($@="_|__"x17,"_|
__$@
")x5

You'll need -E flag to run it :

perl -E 'say+($@="_|__"x17,"_|
__$@
")x5'


答:
Pyth, 12 bytes

Code:

```<code>jcT*175"_|__
</code>```

Explanation:

```<code>       "_|__    # For the string "_|__"
   *175         # Repeat it 175 times
 cT             # Chop into 10 equal pieces
j               # Join them by newlines
</code>```

Try it here.

Title: Build me a brick wall!

Body:
Pyth, 12 bytes

Code:

jcT*175"_|__

Explanation:

       "_|__    # For the string "_|__"
   *175         # Repeat it 175 times
 cT             # Chop into 10 equal pieces
j               # Join them by newlines

Try it here.


答:
J, 12 bytes

```<code>10 70$'_|__'
</code>```

Shapes the string on the right into a 10 by 70 shape. Simple!

Title: Build me a brick wall!

Body:
J, 12 bytes

10 70$'_|__'

Shapes the string on the right into a 10 by 70 shape. Simple!


答:
Python 2, <s>46</s> 44 Bytes

Just using string multiplication to build the string, and slicing to get the right bits :)

```<code>k='_|__'*18
print'\n'.join([k[:70],k[2:]]*5)
</code>```

thanks to Antony Hatchkins for saving two bytes :)

Title: Build me a brick wall!

Body:
Python 2, <s>46</s> 44 Bytes

Just using string multiplication to build the string, and slicing to get the right bits :)

k='_|__'*18
print'\n'.join([k[:70],k[2:]]*5)

thanks to Antony Hatchkins for saving two bytes :)


Title: Build me a brick wall!

Body:
Python 2, 37 bytes

s="_|__"*17;print(s+"_|\n__%s\n"%s)*5

Decomposes two rows as 17 copies of _|__, plus another copy interrupted by a newline, plus 17 more copies, plus another newline.

Longer alternatives:

print"%s_|\n__%s\n"%(2*("_|__"*17,))*5

s="_|__"*17;print"%s_|\n__%%s\n"%s%s*5

for i in[0,2]*5:print("_|__"*18)[i:i+70]

print("_|__"*17+"_|\n"+"___|"*17+"__\n")*5

for s in["_|__","___|"]*5:print(s*18)[:70]

s="_|__"*99;exec"print s[:70];s=s[2:];"*10

print("%s"*70+"\n")*10%(175*tuple("_|__"))


Title: Build me a brick wall!

Body:
Befunge-98, 63 bytes

'_\:3+4%0`!> #0 #\ #|' $ #\_\,1+:7a*%0`!> #0 #, #a_:7aa**\`!#@_

TryItOnline!


答:
Python 2, <s>50</s> 48 bytes

```<code>for b in range(10):print('_|__'*175)[b*70:][:70]
</code>```

2 saved with thanks to @xnor but also thanks to @Shebang for the suggestion :)

Title: Build me a brick wall!

Body:
Python 2, <s>50</s> 48 bytes

for b in range(10):print('_|__'*175)[b*70:][:70]

2 saved with thanks to @xnor but also thanks to @Shebang for the suggestion :)


Title: Build me a brick wall!

Body:
Brainfuck, 171 bytes

+++++[>+++++++++++++++++++<-]+++++++[>>++++++++++++++++++<<-]>>--<<++[>>>+++++<<<-]+++++[>.>.>>+++++++++++++++++[<<<...>.>>-]<.>+++++++++++++++++[<<<...>.>>-]<<<..>>.<<<-]

Brainfuck is fun, here is my submission.

Here is the output:

_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__

Here is a link to try it

https://repl.it/EW2Z/0


答:
C#, 106 102 101 118 107 106 100 96 bytes

Thanks shebang for saving 2 bytes and pointing out a mistake, Yodle for saving 6 bytes and Link Ng for saving 4 bytes.

```<code>var a="";int i;for(;i++<175;)a+="_|__";for(i=0;i<10;)Console.Write(a.Substring(i++*10,70)+"\n");
</code>```

You can test it directly on http://csharppad.com/.

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:
C#, 106 102 101 118 107 106 100 96 bytes

Thanks shebang for saving 2 bytes and pointing out a mistake, Yodle for saving 6 bytes and Link Ng for saving 4 bytes.

var a="";int i;for(;i++<175;)a+="_|__";for(i=0;i<10;)Console.Write(a.Substring(i++*10,70)+"\n");

You can test it directly on http://csharppad.com/.


答:
Ruby, 30 bytes

Thanks to manatwork for this solution

```<code>puts ("_|__"*175).scan /.{70}/
</code>```

Ruby, 39 bytes

```<code>10.times{|i|puts ("_|__"*18)[i%2*2,70]}
</code>```

Title: Build me a brick wall!

Body:
Ruby, 30 bytes

Thanks to manatwork for this solution

puts ("_|__"*175).scan /.{70}/

Ruby, 39 bytes

10.times{|i|puts ("_|__"*18)[i%2*2,70]}


答:
MATL, 16 bytes

```<code>'___|'10:E!70:+)
</code>```

Try it online!

```<code>'___|'   % Push this string
10:E!    % Push [2; 4; 6; ...; 20] (10×1 column vector)
70:      % Push [1, 2, 3, ..., 70] (1×70 row vector)
+        % Add. Gives a 10×70 matrix of all pairwise additions
)        % Index (modular, 1-based) into the string
</code>```

Title: Build me a brick wall!

Body:
MATL, 16 bytes

'___|'10:E!70:+)

Try it online!

'___|'   % Push this string
10:E!    % Push [2; 4; 6; ...; 20] (10×1 column vector)
70:      % Push [1, 2, 3, ..., 70] (1×70 row vector)
+        % Add. Gives a 10×70 matrix of all pairwise additions
)        % Index (modular, 1-based) into the string


答:
CJam, 15 bytes

```<code>"_|__"175*70/N*
</code>```

Try it online!

Port of Adnan's 05AB1E answer.

```<code>"_|__"             e# Push this string
      175*         e# Repeat 175 times
          70/      e# Split in pieces of size 70
             N*    e# Join by newlines
</code>```

Title: Build me a brick wall!

Body:
CJam, 15 bytes

"_|__"175*70/N*

Try it online!

Port of Adnan's 05AB1E answer.

"_|__"             e# Push this string
      175*         e# Repeat 175 times
          70/      e# Split in pieces of size 70
             N*    e# Join by newlines


答:
Jolf, 17 bytes

```<code>RZc*"_|__"Τ755@FS
</code>```

Try it here!

Explanation

```<code>RZc*"_|__"Τ755@FS
   *"_|__"         repeat this string:
          Τ755      7*5*5 = 175 times
 Zc           @F   chop into groups of 70 (F's charcode)
R               S  join by newlines
</code>```

Title: Build me a brick wall!

Body:
Jolf, 17 bytes

RZc*"_|__"Τ755@FS

Try it here!

Explanation

RZc*"_|__"Τ755@FS
   *"_|__"         repeat this string:
          Τ755      7*5*5 = 175 times
 Zc           @F   chop into groups of 70 (F's charcode)
R               S  join by newlines


答:
PowerShell v2+, <s>34</s> 30 bytes

```<code>'_|__'*175-split"(.{70})"-ne''
</code>```

Stupid regex matching algorithm requiring the -ne'' ... wastes five bytes!

```<code>'_|__'*175-split"(.{70})"-ne''
'_|__'*175                     # Repeat this string 175 times
          -split"       "      # Split on this regex pattern:
                  .{70}        # Match any character 70 times
                 (     )       # Encapsulated in parens so we keep the regex results
                         -ne'' # But don't select the empty strings
                               # Output with newlines via Write-Output is implicit
</code>```

Saved 4 bytes thanks to Conor!

Title: Build me a brick wall!

Body:
PowerShell v2+, <s>34</s> 30 bytes

'_|__'*175-split"(.{70})"-ne''

Stupid regex matching algorithm requiring the -ne'' ... wastes five bytes!

'_|__'*175-split"(.{70})"-ne''
'_|__'*175                     # Repeat this string 175 times
          -split"       "      # Split on this regex pattern:
                  .{70}        # Match any character 70 times
                 (     )       # Encapsulated in parens so we keep the regex results
                         -ne'' # But don't select the empty strings
                               # Output with newlines via Write-Output is implicit

Saved 4 bytes thanks to Conor!


答:
SOML, 16 bytes

```<code>_|__”’ø*L{:jjp»»
</code>```

explanation:

```<code>_|__”             push "_|__"
     ’ø           push 18
       *          repeat the "_|__" 18 times
        L{        repeat 10 times:
          :       duplicate the sting
           jj     pop the last 2 letters off
             p    output it
              »»  put the last 2 characters at the start
</code>```

Title: Build me a brick wall!

Body:
SOML, 16 bytes

_|__”’ø*L{:jjp»»

explanation:

_|__”             push "_|__"
     ’ø           push 18
       *          repeat the "_|__" 18 times
        L{        repeat 10 times:
          :       duplicate the sting
           jj     pop the last 2 letters off
             p    output it
              »»  put the last 2 characters at the start


问:
Count without 3

Background

When I was in elementary school, we used to play a game in math class that goes as follows.

All kids sit in a big circle and take turns counting, starting from 1.

However, the following numbers must be skipped while counting:

Numbers that are multiples of 3.

Numbers that have a 3 in its decimal representation.

The first 15 numbers the kids should say are

```<code>1 2 4 5 7 8 10 11 14 16 17 19 20 22 25
</code>```

Whenever somebody gets a number wrong – says a number that isn't in the sequence or skips a number that is – he's removed from the circle. This goes on until there's only one kid left.

Task

You're bad at this game, so you decide to cheat. Write a program or a function that, given a number of the sequence, calculates the next number of the sequence.

You don't have to handle numbers that cannot be represented using your language's native numeric type, provided that your program works correctly up to input 251 and that your algorithm works for arbitrarily large inputs.

Input and output can use any convenient base.

Since you have to conceal your code, it must be as short as possible. In fact, this is code-golf, so the shortest code in bytes wins.

Test cases

```<code>  1 ->   2
  2 ->   4
 11 ->  14
 22 ->  25
 29 ->  40
251 -> 254
</code>```

答:
Pyth, 11 bytes

```<code>f&-I`T3%T3h
</code>```

Try it online: Demonstration or Test Suite

Explanation:

```<code>f&-I`T3%T3hQ   implicit Q at the end
f         hQ   find the smallest integer T >= input + 1 which fulfills:
  -I`T3           T is invariant under removing the digit 3
 &                and
       %T3        T mod 3 leaves a positive remainder
</code>```

Title: Count without 3

Body:
Pyth, 11 bytes

f&-I`T3%T3h

Try it online: Demonstration or Test Suite

Explanation:

f&-I`T3%T3hQ   implicit Q at the end
f         hQ   find the smallest integer T >= input + 1 which fulfills:
  -I`T3           T is invariant under removing the digit 3
 &                and
       %T3        T mod 3 leaves a positive remainder


答:
Ruby, 83 + 14 = 97 bytes

```<code>puts Zlib.inflate Base64.decode64"eNrTB4EYECCdxTVENSP4pLOGqubhE8+j8Twaz6PxDAA3Pofw"
</code>```

Add 14 bytes for -rzlib and -rbase64 flags.

Title: This is my pillow

Body:
...will you help me immortalize it?

I've had this pillow a few years now, and apparently it's time to get rid of it. Can you please write a function or program, that I can bring with me and use to recreate this pillow whenever I want to reminisce a bit.

It must work with no input arguments.

The output should look exactly like this (trailing newlines and spaces are OK).

```<code>/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
</code>```

This is code golf, so the shortest code in bytes win!

Leaderboard

var QUESTION_ID=98701,OVERRIDE_USER=31516;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

Body:
Ruby, 83 + 14 = 97 bytes

puts Zlib.inflate Base64.decode64"eNrTB4EYECCdxTVENSP4pLOGqubhE8+j8Twaz6PxDAA3Pofw"

Add 14 bytes for -rzlib and -rbase64 flags.


答:
Pyth, <s>24</s> <s>23</s> 22 bytes

```<code>VT:*175"_|__"J*70N+70J
</code>```

OK, I'm still learning. Any hints gratefully received :)

Edit

Saved a byte by moving the assignment of J to first use

Title: Build me a brick wall!

Body:
Pyth, <s>24</s> <s>23</s> 22 bytes

VT:*175"_|__"J*70N+70J

OK, I'm still learning. Any hints gratefully received :)

Edit

Saved a byte by moving the assignment of J to first use


答:
Java - 84 bytes

```<code>(a,l)->{int s=0;for(byte c:a.getBytes())s+=Math.pow(c-48,l);return a.equals(""+s);};
</code>```

Non-lambda version: 101 bytes:

```<code>boolean n(String a,int l){int s=0;for(byte c:a.getBytes())s+=Math.pow(c-48,l);return a.equals(""+s);}
</code>```

Called like this:

```<code>interface X {
    boolean n(String a, int l);
}

static X x = (a,l)->{int s=0;for(byte c:a.getBytes())s+=Math.pow(c-48,l);return a.equals(""+s);};

public static void main(String[] args) {
    System.out.println(n("153",3));
    System.out.println(n("1634",4));
    System.out.println(n("123",3));
    System.out.println(n("654",3));
}
</code>```

Returns:

```<code>true
true
false
false
</code>```

Title: Test a number for narcissism

Body:
A Narcissistic Number is a number which is the sum of its own digits, each raised to the power of the number of digits.

For example, take \$153\$ (3 digits):

\$1^3 + 5^3 + 3^3 = 153\$

\$1634\$:

\$1^4 + 6^4 + 3^4 + 4^4 = 1634 = 1 + 1296 + 81 + 256 = 1634\$

The Challenge:

Your code must take input from the user and output True or False depending upon whether the given number is a Narcissistic Number.

Error checking for text strings or other invalid inputs is not required. 1 or 0 for the output is acceptable. Code that simply generates a list of Narcissistic Numbers, or checks the user input against a hardcoded list, does not qualify.

OEIS A005188

Body:
Java - 84 bytes

(a,l)->{int s=0;for(byte c:a.getBytes())s+=Math.pow(c-48,l);return a.equals(""+s);};

Non-lambda version: 101 bytes:

boolean n(String a,int l){int s=0;for(byte c:a.getBytes())s+=Math.pow(c-48,l);return a.equals(""+s);}

Called like this:

interface X {
    boolean n(String a, int l);
}

static X x = (a,l)->{int s=0;for(byte c:a.getBytes())s+=Math.pow(c-48,l);return a.equals(""+s);};

public static void main(String[] args) {
    System.out.println(n("153",3));
    System.out.println(n("1634",4));
    System.out.println(n("123",3));
    System.out.println(n("654",3));
}

Returns:

true
true
false
false


答:
Java 8 + Guava, <s>81</s> 106 bytes

25 bytes for import: com.google.common.base.*;

Lambda that takes no input and returns the required wall.

```<code>()->String.join("\n",Splitter.fixedLength(70).split(Strings.repeat("_|__",175)));
</code>```

Same as many other solutions. Takes a repeating string of "_|__" 175 times, splits it into lengths of 70, then joins them on newline.

Title: Build me a brick wall!

Body:
Java 8 + Guava, <s>81</s> 106 bytes

25 bytes for import: com.google.common.base.*;

Lambda that takes no input and returns the required wall.

()->String.join("\n",Splitter.fixedLength(70).split(Strings.repeat("_|__",175)));

Same as many other solutions. Takes a repeating string of "_|__" 175 times, splits it into lengths of 70, then joins them on newline.


答:
Javascript REPL, 45 bytes

```<code>"_|__".repeat(175).match(/.{70}/g).join("\n")
</code>```

Title: Build me a brick wall!

Body:
Javascript REPL, 45 bytes

"_|__".repeat(175).match(/.{70}/g).join("\n")


Title: Build me a brick wall!

Body:
WinDbg, 45 bytes

f2000000 L2bc 5f 7c 5f 5f;da/c46 2000000 L2bc

How it works:

f 2000000 L2bc 5f 7c 5f 5f; *Repeat the pattern _|__ (5F 7C 5F 5F) to fill 2BC (700) bytes
                            *starting at 2000000
da /c46 2000000 L2bc        *Show 2BC (700) ASCII chars starting from 2000000 in lines
                            *of length 0x46 (70)

Output:

0:000> f2000000 L2bc 5f 7c 5f 5f;da/c46 2000000 L2bc
Filled 0x2bc bytes
02000000  "_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|"
02000046  "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"
0200008c  "_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|"
020000d2  "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"
02000118  "_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|"
0200015e  "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"
020001a4  "_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|"
020001ea  "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"
02000230  "_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|"
02000276  "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"


答:
///, 51 bytes

If a trailing newline is allowed:

```<code>/e/aaaa//a/_|__//b/eeeea_|//c/__eeeea//d/b
c
/ddddd
</code>```

Try it online!

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:
///, 51 bytes

If a trailing newline is allowed:

/e/aaaa//a/_|__//b/eeeea_|//c/__eeeea//d/b
c
/ddddd

Try it online!


Title: Build me a brick wall!

Body:
C, <s>131</s> <s>115</s> <s>113</s> <s>103</s> <s>97</s> 95 Bytes

i,j;main(){for(;i<10;puts(i++&1?"|__":"|"))for(j=0;j<18-(i&1);printf(&"|___"[j++?0:i&1?1:3]));}

Time to start golfing this...

_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__


Title: Product catalog

Body:
This problem is about separating a string representing a product identifier into three components.

The first part consists of upper and lower letters of arbitrary length which represents the warehouse.

The second part is digits which represents the product number. This part is also of arbitrary length.

The last part is qualifiers as size and colours, and this part continues to the end of the string. The qualifiers are guaranteed to start with a capital letter and consist of alphanumeric characters.

Each part should be printed clearly separated. It is guaranteed that each part is non-empty.

The winner is the one who uses least bytes to solve this problem.

Example:

Input: UK7898S14

Output:

UK

7898

S14

Here UK is United Kingdom, 7898 is the product code, and S14 is size 14.

Example 2:

Input: cphDK1234CYELLOWS14QGOOD

Output:

cphDK

1234

CYELLOWS14QGOOD

Here cphDK is Copenhagen, Denmark, 1234 is the product code, CYELLOWS14QGOOD represents yellow colour, size 14, and good quality.

Body:
C, 107 bytes

#define p(x) printf("%c",x);
f(char*s){for(;*s>64;s++)p(*s)p(10)for(;*s<58;s++)p(*s)p(10)for(;*s;s++)p(*s)}

Call with:

int main()
{
   f("UK7898S14");
   return 0;
}


问:
The meta-polyglot quine
In my time on PPCG, I've noticed that quine problems and polyglot problems are quite popular. Also, meta-solutions to problems, that is, scripts which generate a program which is the solution to a problem, tend to get a lot of positive feedback from the community. Therefore, I have created this challenge, which implements these three ideas.

Your task then, reader and code-golf enthusiast, is to create as short as possible a script which can run in two languages A and B to generate quines for A and B. When your program is run in language A, it should generate a program that is a quine in language B but not in language A and vice versa. The languages A and B can be different version of the same language, provided you keep in mind that the generated quines should only work in one of the versions.

Keep in mind that the standard loopholes should be considered closed and only proper quines are allowed.

Good luck, fewest characters wins!

答:
CJam 0.6.6 dev / GolfScript, <s>15</s> <s>14</s> 12 bytes

```<code>"0$p"0$~a:n;
</code>```

Thanks to @jimmy23013 for golfing off 2 bytes!

Rest to be updated.

Verification

Since the submission involves significant whitespace, it's best to compare hexdumps.

```<code>$ xxd -g 1 mpquine
0000000: 22 60 30 24 7e 22 30 24 7e 4e 4d 3a 6e 3b        "`0$~"0$~NM:n;
$
$ cjam mpquine | tee quine.gs | xxd -g 1
0000000: 22 60 30 24 7e 22 60 30 24 7e 0a                 "`0$~"`0$~.
$ golfscript quine.gs | xxd -g 1
0000000: 22 60 30 24 7e 22 60 30 24 7e 0a                 "`0$~"`0$~.
$ cjam quine.gs | xxd -g 1
0000000: 22 60 30 24 7e 22 60 30 24 7e                    "`0$~"`0$~
$
$ golfscript mpquine | tee quine.cjam | xxd -g 1
0000000: 22 60 30 24 7e 22 60 30 24 7e                    "`0$~"`0$~
$ cjam quine.cjam | xxd -g 1
0000000: 22 60 30 24 7e 22 60 30 24 7e                    "`0$~"`0$~
$ golfscript quine.cjam | xxd -g 1
0000000: 22 60 30 24 7e 22 60 30 24 7e 0a                 "`0$~"`0$~.
</code>```

CJam

CJam prints "`0$~"0$~ and a trailing linefeed. Try it online!

The generated program prints "`0$~"0$~ with the trailing linefeed in GolfScript (Try it online!), but without the linefeed in CJam (Try it online!).

How the metaquine works

```<code>"`0$~"         e# Push that string on the stack.
      0$~      e# Push a copy and evaluate it:
               e#   `     Inspect the string, pushing "\"`0$~\"".
               e#    0$   Push a copy.
               e#      ~  Evaluate, pushing "`0$~".
               e# Both "\"`0$~\"" and "`0$~" are now on the stack.
         NM    e# Push "\n" and "".
           :n; e# Map print over the elements of "" (none) and pop the result.
               e# "\"`0$~\"", "`0$~", and "\n" are now on the stack, and the
               e# characters they represent will be printed implicitly.
</code>```

How the quine works

```<code>"`0$~"          # Push that string on the stack.
      0$~       # As in CJam.
         <LF>   # Does nothing.
                # "\"`0$~\"" and "`0$~" are now on the stack, and the characters
                # they represent will be printed implicitly, plus a linefeed.
</code>```

Unlike GolfScript, CJam doesn't print a trailing linefeed by default, so this is not a quine in CJam.

GolfScript

GolfScript prints "`0$~"0$~, without trailing whitespace. Try it online!

The generated program prints "`0$~"0$~ without trailing whitespace in CJam (Try it online!), but GolfScript appends a linefeed (Try it online!).

How the metaquine works

```<code>"`0$~"0$~       # As in CJam.
         NM     # Unrecognized token. Does nothing.
           :n   # Store the top of the stack – "`0$~" – in the variable n. n holds
                # "\n" by default. When the program finishes, the interpreter
                # prints n implicitly, usually resulting in a trailing linefeed.
                # By redefining n, it will print "0$~" instead.
             ;  # Pop the string from the stack so it won't be printed twice.
</code>```

How the quine works

```<code>"`0$~"0$~      e# Works as in GolfScript.
</code>```

Unlike CJam, GolfScript will append a linefeed to the contents of the stack, so this is not a quine in GolfScript.

Title: The meta-polyglot quine

Body:
CJam 0.6.6 dev / GolfScript, <s>15</s> <s>14</s> 12 bytes

"0$p"0$~a:n;

Thanks to @jimmy23013 for golfing off 2 bytes!

Rest to be updated.

Verification

Since the submission involves significant whitespace, it's best to compare hexdumps.

$ xxd -g 1 mpquine
0000000: 22 60 30 24 7e 22 30 24 7e 4e 4d 3a 6e 3b        "`0$~"0$~NM:n;
$
$ cjam mpquine | tee quine.gs | xxd -g 1
0000000: 22 60 30 24 7e 22 60 30 24 7e 0a                 "`0$~"`0$~.
$ golfscript quine.gs | xxd -g 1
0000000: 22 60 30 24 7e 22 60 30 24 7e 0a                 "`0$~"`0$~.
$ cjam quine.gs | xxd -g 1
0000000: 22 60 30 24 7e 22 60 30 24 7e                    "`0$~"`0$~
$
$ golfscript mpquine | tee quine.cjam | xxd -g 1
0000000: 22 60 30 24 7e 22 60 30 24 7e                    "`0$~"`0$~
$ cjam quine.cjam | xxd -g 1
0000000: 22 60 30 24 7e 22 60 30 24 7e                    "`0$~"`0$~
$ golfscript quine.cjam | xxd -g 1
0000000: 22 60 30 24 7e 22 60 30 24 7e 0a                 "`0$~"`0$~.

CJam

CJam prints "`0$~"0$~ and a trailing linefeed. Try it online!

The generated program prints "`0$~"0$~ with the trailing linefeed in GolfScript (Try it online!), but without the linefeed in CJam (Try it online!).

How the metaquine works

"`0$~"         e# Push that string on the stack.
      0$~      e# Push a copy and evaluate it:
               e#   `     Inspect the string, pushing "\"`0$~\"".
               e#    0$   Push a copy.
               e#      ~  Evaluate, pushing "`0$~".
               e# Both "\"`0$~\"" and "`0$~" are now on the stack.
         NM    e# Push "\n" and "".
           :n; e# Map print over the elements of "" (none) and pop the result.
               e# "\"`0$~\"", "`0$~", and "\n" are now on the stack, and the
               e# characters they represent will be printed implicitly.

How the quine works

"`0$~"          # Push that string on the stack.
      0$~       # As in CJam.
         <LF>   # Does nothing.
                # "\"`0$~\"" and "`0$~" are now on the stack, and the characters
                # they represent will be printed implicitly, plus a linefeed.

Unlike GolfScript, CJam doesn't print a trailing linefeed by default, so this is not a quine in CJam.

GolfScript

GolfScript prints "`0$~"0$~, without trailing whitespace. Try it online!

The generated program prints "`0$~"0$~ without trailing whitespace in CJam (Try it online!), but GolfScript appends a linefeed (Try it online!).

How the metaquine works

"`0$~"0$~       # As in CJam.
         NM     # Unrecognized token. Does nothing.
           :n   # Store the top of the stack – "`0$~" – in the variable n. n holds
                # "\n" by default. When the program finishes, the interpreter
                # prints n implicitly, usually resulting in a trailing linefeed.
                # By redefining n, it will print "0$~" instead.
             ;  # Pop the string from the stack so it won't be printed twice.

How the quine works

"`0$~"0$~      e# Works as in GolfScript.

Unlike CJam, GolfScript will append a linefeed to the contents of the stack, so this is not a quine in GolfScript.


问:
Character by Character
Your program must take in a string like:

```<code>test string
</code>```

And must output each character adding one at a time like this:

```<code>t
te
tes
test
test
test s
test st
test str
test stri
test strin
test string
</code>```

notice how spaces count!

Good luck!
Least Bytes win.
~N

答:
MATL, 6 bytes

```<code>"GX@:)
</code>```

Try it online!

```<code>         % Implicit input
"        % For each
  G      %   Push input again
  X@:    %   Push [1 2 ... k] where k is iteration index
  )      %   Use as index into the string
         % End for each
         % Implicit display
</code>```

Title: Character by Character

Body:
MATL, 6 bytes

"GX@:)

Try it online!

         % Implicit input
"        % For each
  G      %   Push input again
  X@:    %   Push [1 2 ... k] where k is iteration index
  )      %   Use as index into the string
         % End for each
         % Implicit display


答:
05AB1E, 3 bytes

Uses CP-1252 encoding.

```<code>.p»
</code>```

Try it online!

Explanation

```<code>     # implicit input
.p   # list of prefixes
  »  # join by newlines
</code>```

Title: Character by Character

Body:
Your program must take in a string like:

```<code>test string
</code>```

And must output each character adding one at a time like this:

```<code>t
te
tes
test
test
test s
test st
test str
test stri
test strin
test string
</code>```

notice how spaces count!

Good luck!
Least Bytes win.
~N

Body:
05AB1E, 3 bytes

Uses CP-1252 encoding.

.p»

Try it online!

Explanation

     # implicit input
.p   # list of prefixes
  »  # join by newlines


答:
REBOL, <s>100</s> <s>90</s> 95 bytes (-7 bytes with REPL for 88)

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

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

The ungolfed version is:

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

  ; by default, vertical stack panel
  across
  r "I"
  r
  b "V"
  r "o"
  b "t"
  r "e"
  b "d"
]
</code>```

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

(source: canardpc.com)

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:
REBOL, <s>100</s> <s>90</s> 95 bytes (-7 bytes with REPL for 88)

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

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

The ungolfed version is:

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

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

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

(source: canardpc.com)


问:
Given a Diagram, Find X

Find X

I was inspired by math questions in which one is asked to "Find X" for a given shape. Originally, I was just going to have the challenge be to print the x and y location of the character 'x' in a String. But I supposed that would be too simple. So I considered the context they were normally in, and decided finding the length of a Line next to the x just seemed appropriate.

Given a string input containing a Diagram of ascii 'lines' as well as a single 'x' and potentially junk characters, print the length of the only line that has an 'x' directly adjecent to it.

Examples

Input:

```<code>|
|
|x
|
|
</code>```

Ouput:

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

Input:

```<code>|\
| \x
|  \
|___\
</code>```

Output:

```<code>4
</code>```

Input:

```<code>Diagram of a Wobbly Line:
IRRELEVANTTEXT____
____     ____/
    \___/ X ;)
      x
</code>```

Output:

```<code>3
</code>```

Input:

```<code>  ______________
 / ____________ \
 |/ __________ \|
 ||/ ________ \||
 |||/ ______ \|||
 ||||/      \||||
 |||||/  x  |||||
 |||||\_____/||||
 ||||\_______/|||
 |||\_________/||
 ||\___________/|
  \_____________/
</code>```

Output:

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

Notes

The Valid line characters are \/_|

\ connects the top left and bottom right of itself.

/ connects the top right and bottom left of itself.

_ connects the left and right of itself

| connects the top and bottom of itself

A line will always be straight, and only consist of one of the line characters repeated n times.

The x will always be lowercase, and it will always be the only one in the diagram.

Adjecent refers to the x being exactly one character above, below, or besides.

The x will always be next to exactly one Line.

Tabs will never appear in the input.

Input and Output may be any acceptable format.

This is Code Golf, so Shortest Code Wins!

HAVE FUN. DO IT. ENJOY YOURSELF.

Reference Implementation

Title: Given a Diagram, Find X

Body:
JavaScript (ES6), 175

Assuming input is padded with spaces to make a rectangle.

s=>(o=>{s.replace(/[_|\\/]/g,(c,p)=>[o,-o,1,-1].map(d=>s[p+d]=='x'?[q,k]=[p,c]:c));for(n=z=k>'_'?o:k>'\\'?-1:k>'/'?o-1:o+1;s[q+=z]==k||z<0&&(n=-1,z=-z);)n++})(~s.search`
`)||n

Less golfed

s=>{
  o = ~s.search`\n`; // offset between rows (negated)
  // look for a line character near an 'x'
  s.replace(/[_|\\/]/g,
     (c,p)=> // for each line char 'c' in position 'p'
     [o,-o,1,-1].map(d=>s[p+d]=='x' // found a near 'x' ?
                        ?[q,k]=[p,c] // remember char and position
                        :c)
  );
  n=0;
  z=k>'_'?o:k>'\\'?-1:k>'/'?o-1:o+1; // offset to prev char of line
  while (s[q+=z]==k // move to left/top first
         || z<0 && (n=0,z=-z) // at left/top, go back and start counting
        )
    n++;
  return n-1;
}

Test Dots instead of spaces for clarity

f=
s=>(o=>{s.replace(/[_|\\/]/g,(c,p)=>[o,-o,1,-1].map(d=>s[p+d]=='x'?[q,k]=[p,c]:c));for(n=z=k>'_'?o:k>'\\'?-1:k>'/'?o-1:o+1;s[q+=z]==k||z<0&&(n=-1,z=-z);)n++})(~s.search`
`)||n

out=x=>O.textContent+=x

;["|.\n|.\n|x\n|.\n|.\n", "|\\...\n|.\\x.\n|..\\.\n|___\\\n"
,"Diagram of a Wobbly Line:\nIRRELEVANTTEXT...........\n____.....____/...........\n....\\___/.X.;)...........\n......x..................\n"
,"./ ____________ \\\n.|/ __________ \|\n.||/ ________ \\||\n.|||/ ______ \\|||\n.||||/      \\||||\n.|||||/  x  |||||\n.|||||\\_____/||||\n.||||\\_______/|||\n.|||\\_________/||\n.||\\___________/|\n. \\_____________/\n"].forEach(s=>out(s+f(s)+'\n\n'))

<pre id=O></pre>


答:
Pyth, 3 bytes

```<code>j._
</code>```

Try it here.

```<code>j       Join by newlines
 ._     all prefixes of implicit input
</code>```

Title: Character by Character

Body:
Pyth, 3 bytes

j._

Try it here.

j       Join by newlines
 ._     all prefixes of implicit input


答:
Brachylog, 5 bytes

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

Try it online!

Assuming that a trailing new line is acceptable

Explanation

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

Title: Character by Character

Body:
Brachylog, 5 bytes

@[@w\

Try it online!

Assuming that a trailing new line is acceptable

Explanation

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


答:
V, 18 bytes

-1 byte thanks to DJMcMayhem.

175i_|__<Esc>Ó.û70}/°ò
```

<p>Here it is with unprintable characters in xxd format:</p>

<pre class="lang-none prettyprint-override"><code>0000000: 3137 3569 5f7c 5f5f 1bd3 2efb 3730 7d2f  175i_|__....70}/
0000010: b0f2                                     ..
</code>```

Try it online!

Title: Build me a brick wall!

Body:
V, 18 bytes

-1 byte thanks to DJMcMayhem.

175i_|__<Esc>Ó.û70}/°ò

Here it is with unprintable characters in xxd format:

0000000: 3137 3569 5f7c 5f5f 1bd3 2efb 3730 7d2f  175i_|__....70}/
0000010: b0f2                                     ..

Try it online!


答:
Trumpscript, <s>303</s> <s>285</s> <s>244</s> <s>231</s> 226 bytes

```<code>make i 1000005-1000000
as long as,i;:
make i,i - fact;
say "_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|"
say "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"!
America is great
</code>```

I would like to say this is one of the most verbose languages where almost everything fails to compile into a working program.

Apparently whether - works instead of minus is completely up to the interpreter and sometimes works. This time it did so I'm putting it in as golfed.

Abuses the fact Trumpscript is written in Python and therefore fact when used as an integer is one.

Golfing tips welcome.

Title: Build me a brick wall!

Body:
Trumpscript, <s>303</s> <s>285</s> <s>244</s> <s>231</s> 226 bytes

make i 1000005-1000000
as long as,i;:
make i,i - fact;
say "_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|"
say "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"!
America is great

I would like to say this is one of the most verbose languages where almost everything fails to compile into a working program.

Apparently whether - works instead of minus is completely up to the interpreter and sometimes works. This time it did so I'm putting it in as golfed.

Abuses the fact Trumpscript is written in Python and therefore fact when used as an integer is one.

Golfing tips welcome.


答:
Pyke, 12 bytes

```<code>w�"_|__"*TfX
</code>```

where � is the literal byte 163.

Try it here! (w� replaced with literal)

Title: Build me a brick wall!

Body:
Pyke, 12 bytes

w�"_|__"*TfX

where � is the literal byte 163.

Try it here! (w� replaced with literal)