答:
Jelly, 14 bytes

```<code>ÆfVṢṚḌ
ÇÇ€=ÇTḟ
</code>```

Execution time could be halved with DF instead of V, but it still completes the combined test cases in under thirty seconds.

Try it online! or verify all test cases.

How it works

```<code>ÆfVṢṚḌ   Helper link. Argument: k (integer)

Æf       Decompose k into an array of primes with product k.
  V      Eval. Eval casts a 1D array to string first, so this computes the integer
         that results of concatenating all primes in the factorization.
   Ṣ     Sort. Sort casts a number to the array of its decimal digits.
    Ṛ    Reverse. This yields the decimal digits in descending order.
     Ḍ   Undecimal; convert the digit array from base 10 to integer.

ÇÇ€=ÇTḟ  Main link. Argument: n (integer)

Ç        Call the helper link with argument n.
         This yields an upper bound (u) for all prime factorization buddies since
         the product of a list of integers cannot exceed the concatenated integers.
 Ç€      Apply the helper link to each k in [1, ..., u].
    Ç    Call the helper link (again) with argument n.
   =     Compare each result to the left with the result to the right.
     T   Truth; yield all 1-based indices of elements of [1, ..., u] (which match
         the corresponding integers) for which = returned 1.
      ḟ  Filter; remove n from the indices.
</code>```

Title: Prime factors buddies

Body:
Given an integer N > 1, output all other numbers which prime decompositions have the same digits as the prime decomposition of N.

For example, if N = 117, then the output must be [279, 939, 993, 3313, 3331], because

```<code>117 = 3 × 3 × 13
</code>```

therefore, the available digits are 1, 3, 3 and 3 and we have

```<code>279  = 3 × 3 × 31
939  = 3 × 313
993  = 3 × 331
3313 = 3313
3331 = 3331
</code>```

Those are the only other possible numbers, because other combination of these digits yield non-prime integers, which can't be the result of prime factorization.

If N is any of 117, 279, 939, 993, 3313 or 3331, then the output will contain the five other numbers: they are prime factors buddies.

You cannot use leading zeroes to get primes, e.g. for N = 107, its only buddy is 701 (017 is not considered).

Input and Outputs

The input and output buddies must be taken and returned in the decimal base.

N will always be strictly greater than 1.

The output can be formatted rather freely, as long as it only contains the buddies and separators/list syntactic elements.

The ordering of the output is unimportant.

You may take the input through STDIN, as a function argument or anything similar.

You may print the output to STDOUT, return it from a function, or anything similar.

Test cases

Your program should solve any of the test cases below in less than a minute.

```<code>N        Buddies
2        []
4        []
8        []
15       [53]
16       []
23       [6]
42       [74, 146, 161]
126      [222, 438, 483, 674, 746, 851, 1466, 1631, 1679]
204      [364,548,692,762,782,852,868,1268,1626,2474,2654,2921,2951,3266,3446,3791,4274,4742,5426,5462,6233,6434,6542,7037,8561,14426,14642,15491,15833,22547]
</code>```

Scoring

This is code-golf, so the shortest answer in bytes wins.

Body:
Jelly, 14 bytes

ÆfVṢṚḌ
ÇÇ€=ÇTḟ

Execution time could be halved with DF instead of V, but it still completes the combined test cases in under thirty seconds.

Try it online! or verify all test cases.

How it works

ÆfVṢṚḌ   Helper link. Argument: k (integer)

Æf       Decompose k into an array of primes with product k.
  V      Eval. Eval casts a 1D array to string first, so this computes the integer
         that results of concatenating all primes in the factorization.
   Ṣ     Sort. Sort casts a number to the array of its decimal digits.
    Ṛ    Reverse. This yields the decimal digits in descending order.
     Ḍ   Undecimal; convert the digit array from base 10 to integer.

ÇÇ€=ÇTḟ  Main link. Argument: n (integer)

Ç        Call the helper link with argument n.
         This yields an upper bound (u) for all prime factorization buddies since
         the product of a list of integers cannot exceed the concatenated integers.
 Ç€      Apply the helper link to each k in [1, ..., u].
    Ç    Call the helper link (again) with argument n.
   =     Compare each result to the left with the result to the right.
     T   Truth; yield all 1-based indices of elements of [1, ..., u] (which match
         the corresponding integers) for which = returned 1.
      ḟ  Filter; remove n from the indices.


问:
Generate a Universal-binary-function Lookup Table
This is tangentially related to my quest to invent an esoteric programming language.

A table of the binary numbers 0 .. 15 can be used to implement a Universal Binary Function using indexing operations. Given two 1-bit inputs X and Y, all 16 possible functions can be encoded in a 4-bit opcode.

```<code>X Y  F|0 1 2 3 4 5 6 7 8 9 A B C D E F
- -    - - - - - - - - - - - - - - - -
0 0    0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1    0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
1 0    0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
1 1    0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
       -     -   - -   -   -   -   - -
       0    ~X  ~Y ^   &   Y   X   | 1
      ZERO    NOT-Y   AND         OR
          NOT-X   XOR              ONE
</code>```

So this set of 16 functions can be applied to binary inputs as the function

U(f,x,y): (f >> ((x<<1) | y)) & 1,

or

U(f,x,y): (f / 2^(x×2 + y)) % 2,

or with indexing or matrix partitioning.

It will be useful to know the most compact way to represent or generate such a table of values for any possible languages to be built upon this type of binary operation.

The goal:

Generate this exact text output:

```<code>0101010101010101
0011001100110011
0000111100001111
0000000011111111
</code>```

That's it! Shortest-code wins.

答:
PHP, <s>76</s> <s>70</s> <s>68</s> <s>67</s> <s>61</s> <s>57</s> 45 bytes

Now it´s worth it: code shorter than its output. :)

```<code>for(;$x<64;$x++)echo$x%16?"":"
",$x>>$x/16&1;
</code>```

run with -r.

runs through rows and columns in one loop:

$x/16 rounded is the row number,
$x%16 the column and decimal value of the binary value we want to display:

In columns 0,16,32,48 ($x%%16 falsy) print a linebreak.

If bit $x/16 is set ($x>>$x/16&1), print 1, else 0.

add 2 bytes for trailing instead of leading linebreak:

```<code>for(;$x<64;$x++)echo$x>>$x/16&1,$x+1&15?"":"
";
</code>```

ContentLicense: CC BY-SA 3.0

Body:
PHP, <s>76</s> <s>70</s> <s>68</s> <s>67</s> <s>61</s> <s>57</s> 45 bytes

Now it´s worth it: code shorter than its output. :)

for(;$x<64;$x++)echo$x%16?"":"
",$x>>$x/16&1;

run with -r.

runs through rows and columns in one loop:

$x/16 rounded is the row number,
$x%16 the column and decimal value of the binary value we want to display:

In columns 0,16,32,48 ($x%%16 falsy) print a linebreak.

If bit $x/16 is set ($x>>$x/16&1), print 1, else 0.

add 2 bytes for trailing instead of leading linebreak:

for(;$x<64;$x++)echo$x>>$x/16&1,$x+1&15?"":"
";


问:
Print all integers
Write a program or function which will provably print all integers exactly once given infinite time and memory.

Possible outputs could be:

```<code>0, 1, -1, 2, -2, 3, -3, 4, -4, …

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -2, -3, -4, -5, -6, -7, -8, -9, 10, 11, …
</code>```

This is not a valid output, as this would never enumerate negative numbers:

<s>```0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, …```</s>

The output must be in decimal, unless your language does not support decimal integer (in that case use the natural representation of integers your language uses).

Your program has to work up to the numbers with the biggest magnitude of the standard integer type of your language.

Each integer must be separated from the next using any separator (a space, a comma, a linebreak, etc.) that is not a digit nor the negative sign of your language.

The separator must not change at any point.

The separator can consist of multiple characters, as long as none of them is a digit nor the negative sign (e.g. ,  is as valid as just ,).

Any supported integer must eventually be printed after a finite amount of time.

Scoring

This is code-golf, so the shortest answer in bytes wins

Leaderboard

var QUESTION_ID=93441,OVERRIDE_USER=41723;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

```

答:
C# function 53 bytes

```<code>int j;void X(){for(;;)Console.Write($"{j++},-{j},");}
</code>```

Explanation:

Create a variable "j" in class scope.  This will default to have a value of zero.
Write and increment value and then write the negative of that value.  This will output "0,-1," on the first loop and "1,-2," on the 2nd loop.

Title: Print all integers

Body:
C# function 53 bytes

int j;void X(){for(;;)Console.Write($"{j++},-{j},");}

Explanation:

Create a variable "j" in class scope.  This will default to have a value of zero.
Write and increment value and then write the negative of that value.  This will output "0,-1," on the first loop and "1,-2," on the 2nd loop.


问:
Is it an Odd Word?

Challenge

Given a single word as input, determine if the word is odd or even.

Odd and Even words

Assume the general rules:

```<code>odd + odd = even
even + odd = odd
odd + even = odd
even + even = even
</code>```

In the alphabet, the odd letters are:

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

And the even letters are:

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

The same applies to capital letters (AEIOU are odd and BCDFGHJKLMNPQRSTVWXYZ are even).

You then 'add' each of the letters in the word together. For example, the word cats is equivalent to:

```<code>even + odd + even + even
</code>```

Which simplifies to:

```<code>odd + even
</code>```

Which simplifies further to:

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

So the word cats is odd.

Examples

```<code>Input:  trees
Output: even
</code>```

```<code>Input:  brush
Output: odd
</code>```

```<code>Input:  CAts
Output: odd
</code>```

```<code>Input:  Savoie
Output: even
</code>```

```<code>Input:  rhythm
Output: even
</code>```

Rules

All input will be a single word which will only contain alphabetical characters.

If the word is odd, output a truthy value. If the word is even, output a falsey value.

Winning

The shortest code in bytes wins.

答:
05AB1E, 6 bytes

```<code>lžMÃgÉ
</code>```

Explanation

```<code>l       # convert to lower case
 žMÃg   # count odd letters
     É  # true if odd else false
</code>```

Try it online!

Title: Is it an Odd Word?

Body:
05AB1E, 6 bytes

lžMÃgÉ

Explanation

l       # convert to lower case
 žMÃg   # count odd letters
     É  # true if odd else false

Try it online!


答:
Retina, 19 bytes

```<code>Mi`[aeiou]
[13579]$
</code>```

Try it online! (The first line enables a linefeed-separated test suite.)

The first line counts the vowels in the input. The second line checks that the result is odd.

Title: Is it an Odd Word?

Body:
Challenge

Given a single word as input, determine if the word is odd or even.

Odd and Even words

Assume the general rules:

```<code>odd + odd = even
even + odd = odd
odd + even = odd
even + even = even
</code>```

In the alphabet, the odd letters are:

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

And the even letters are:

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

The same applies to capital letters (AEIOU are odd and BCDFGHJKLMNPQRSTVWXYZ are even).

You then 'add' each of the letters in the word together. For example, the word cats is equivalent to:

```<code>even + odd + even + even
</code>```

Which simplifies to:

```<code>odd + even
</code>```

Which simplifies further to:

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

So the word cats is odd.

Examples

```<code>Input:  trees
Output: even
</code>```

```<code>Input:  brush
Output: odd
</code>```

```<code>Input:  CAts
Output: odd
</code>```

```<code>Input:  Savoie
Output: even
</code>```

```<code>Input:  rhythm
Output: even
</code>```

Rules

All input will be a single word which will only contain alphabetical characters.

If the word is odd, output a truthy value. If the word is even, output a falsey value.

Winning

The shortest code in bytes wins.

Body:
Retina, 19 bytes

Mi`[aeiou]
[13579]$

Try it online! (The first line enables a linefeed-separated test suite.)

The first line counts the vowels in the input. The second line checks that the result is odd.


答:
PowerShell v2+, <s>45</s> 42 bytes

```<code>($args[0]-replace'[^aeiouAEIOU]').Length%2
</code>```

Takes input $args[0], sends it through -replace to remove all non-vowel characters, takes the resulting .length, and %2 to check whether it's odd/even.

Examples

```<code>PS C:\Tools\Scripts\golfing> 'trees','brush','CAts','Savoie','rhythm'|%{"$_ --> "+(.\is-it-an-odd-word.ps1 $_)}
trees --> 0
brush --> 1
CAts --> 1
Savoie --> 0
rhythm --> 0
</code>```

Title: Is it an Odd Word?

Body:
PowerShell v2+, <s>45</s> 42 bytes

($args[0]-replace'[^aeiouAEIOU]').Length%2

Takes input $args[0], sends it through -replace to remove all non-vowel characters, takes the resulting .length, and %2 to check whether it's odd/even.

Examples

PS C:\Tools\Scripts\golfing> 'trees','brush','CAts','Savoie','rhythm'|%{"$_ --> "+(.\is-it-an-odd-word.ps1 $_)}
trees --> 0
brush --> 1
CAts --> 1
Savoie --> 0
rhythm --> 0


问:
Determine which of two ImageMagick .TXT images is more saturated
You have two images (64x64 pixels each):

Your program must take the file names of each of them as command line arguments and determine which has more average saturation among their pixels.

The images are in ImageMagick .txt format.  You can download and convert these images using convert pic.png pic.txt or download the raw text (saturated, desaturated)

Ignore the first line of the file (required).

Solutions in Assembly get 50% of their characters for free.  Brainfuck, whitespace, and close variants, get 25% of their characters for free.  (e.g. if it takes 200 characters in Brainfuck; mark it as 200-50=150.)

Describe your output.  It could be the name of the more saturated image; the index of it (0 for first, 1 for second); true for the first, false for the second, etc.  Just let us know.

It should be able to take either the saturated or desaturated image first, and accurately report the more saturated (test both ways).  The filenames shouldn't be considered when evaluating saturation (e.g. no if filename contains 'desaturated'...)

Shortest answer wins.  Happy coding :-)

答:
Mathematica  92 215

Edit

To work directly with the Magick files I had to make substantial revisions to my first try.

Filenames

Stored as variables, x, y.

```<code>x = "http://pastebin.com/raw.php?i=5f3B4uxP";
y = "http://pastebin.com/raw.php?i=VdjDm9HK";
</code>```

The following routine sorts image files by average saturation (least to greatest). (Spaces added for readability.)

```<code>i = Image; d = DigitCharacter;
f[t_] := {Mean[Flatten[ImageData[ColorConvert[i[i[Partition[(StringCases[URLFetch[t],
   "rgb(" ~~ a : d .. ~~ "," ~~ b : d .. ~~ "," ~~c : d .. ~~ ")" :> ToExpression
   /@ {a, b, c}])/255., 64]]], "RGB" -> "HSB"]], 1][[All, 2]]], t}
</code>```

Usage

```<code>Sort@{f[x], f[y]}
</code>```

Output (saturation value, followed by filename).

{{0.229977, "http://pastebin.com/raw.php?i=VdjDm9HK"},

  {0.958346, "http://pastebin.com/raw.php?i=5f3B4uxP"}}

Explanation

URLFetch[x] fetches the Magick textfile, the name of which is stored in x

StringCases[URLFetch[t],
       "rgb(" ~~ a : d .. ~~ "," ~~ b : d .. ~~ "," ~~c : d .. ~~ ")" :> ToExpression
       /@ {a, b, c}])/255., 64]]], "RGB" -> "HSB"] finds the RGB values and, along with Partition converts them to the format Mathematica expects to find RGB files in.

ColorConvert converts to Hue-Saturation-Brightness values.
Mean and [[All,2]] find the mean saturation values for the file.

Body:
Mathematica  92 215

Edit

To work directly with the Magick files I had to make substantial revisions to my first try.

Filenames

Stored as variables, x, y.

x = "http://pastebin.com/raw.php?i=5f3B4uxP";
y = "http://pastebin.com/raw.php?i=VdjDm9HK";

The following routine sorts image files by average saturation (least to greatest). (Spaces added for readability.)

i = Image; d = DigitCharacter;
f[t_] := {Mean[Flatten[ImageData[ColorConvert[i[i[Partition[(StringCases[URLFetch[t],
   "rgb(" ~~ a : d .. ~~ "," ~~ b : d .. ~~ "," ~~c : d .. ~~ ")" :> ToExpression
   /@ {a, b, c}])/255., 64]]], "RGB" -> "HSB"]], 1][[All, 2]]], t}

Usage

Sort@{f[x], f[y]}

Output (saturation value, followed by filename).

{{0.229977, "http://pastebin.com/raw.php?i=VdjDm9HK"},

  {0.958346, "http://pastebin.com/raw.php?i=5f3B4uxP"}}

Explanation

URLFetch[x] fetches the Magick textfile, the name of which is stored in x

StringCases[URLFetch[t],
       "rgb(" ~~ a : d .. ~~ "," ~~ b : d .. ~~ "," ~~c : d .. ~~ ")" :> ToExpression
       /@ {a, b, c}])/255., 64]]], "RGB" -> "HSB"] finds the RGB values and, along with Partition converts them to the format Mathematica expects to find RGB files in.

ColorConvert converts to Hue-Saturation-Brightness values.
Mean and [[All,2]] find the mean saturation values for the file.


答:
MATL, <s>8</s>, 7 bytes

```<code>13Y2mso
</code>```

Try it online!

Explanation:

```<code>13Y2    % Push the string 'aeiouAEIOU', a predefined literal.
    m   % For each char of the input that is in that string, push a one. For every other element, push a zero.
     s  % Sum this array
      o % Mod 2
</code>```

Title: Is it an Odd Word?

Body:
MATL, <s>8</s>, 7 bytes

13Y2mso

Try it online!

Explanation:

13Y2    % Push the string 'aeiouAEIOU', a predefined literal.
    m   % For each char of the input that is in that string, push a one. For every other element, push a zero.
     s  % Sum this array
      o % Mod 2


答:
Pyth, 14 bytes

```<code>%l@"aeiou"rQ02
</code>```

Try it Online!

Explanation:

```<code>  @"aeiou"       Grab only the vowels
          rQ0      From lowercased input
 l                 Get the length of this
%            2     And mod 2 to check for oddness
</code>```

Title: Is it an Odd Word?

Body:
Pyth, 14 bytes

%l@"aeiou"rQ02

Try it Online!

Explanation:

  @"aeiou"       Grab only the vowels
          rQ0      From lowercased input
 l                 Get the length of this
%            2     And mod 2 to check for oddness


答:
Octave, 34 bytes

```<code>@(s)mod(nnz(~(s'-'aeiouAEIOU')),2)

s'-'aeiouAEIOU'    % Creates a 2D-matrix where each of the odd letters are
                   % subtracted from the string s
~(s'-'aeiouAEIOU') % Negates that array, so the all zero elements become 1
nnz( .... )        % Counts all the non-zero elements (the odd letters)
mod(nnz( ....),2   % Takes this sum modulus 2
</code>```

This is 6 bytes shorter than the traditional approach using ismember, @(s)mod(sum(ismember(s,'aeiouAEIOU')),2), and two bytes shorter than the regex approach: @(s)mod(nnz(regexpi(s,'[aeiou]')),2).

Test it here.

Title: Is it an Odd Word?

Body:
Octave, 34 bytes

@(s)mod(nnz(~(s'-'aeiouAEIOU')),2)

s'-'aeiouAEIOU'    % Creates a 2D-matrix where each of the odd letters are
                   % subtracted from the string s
~(s'-'aeiouAEIOU') % Negates that array, so the all zero elements become 1
nnz( .... )        % Counts all the non-zero elements (the odd letters)
mod(nnz( ....),2   % Takes this sum modulus 2

This is 6 bytes shorter than the traditional approach using ismember, @(s)mod(sum(ismember(s,'aeiouAEIOU')),2), and two bytes shorter than the regex approach: @(s)mod(nnz(regexpi(s,'[aeiou]')),2).

Test it here.


答:
EXCEL, 79 bytes:

```<code>=MOD(SUMPRODUCT(LEN(A1)-LEN(SUBSTITUTE(LOWER(A1),{"a","e","i","o","u"},""))),2)
</code>```

input:

This function can be placed anywhere EXCEPT A1

Put your word in question into A1.

Output: 0 if even, 1 if odd.

Title: Is it an Odd Word?

Body:
EXCEL, 79 bytes:

=MOD(SUMPRODUCT(LEN(A1)-LEN(SUBSTITUTE(LOWER(A1),{"a","e","i","o","u"},""))),2)

input:

This function can be placed anywhere EXCEPT A1

Put your word in question into A1.

Output: 0 if even, 1 if odd.


答:
sed 44 (42 + 1 for -n) 43

-1 thanks to Neil

```<code>s/[aeiou][^aeiou]*[aeiou]//gi
/[aeiou]/Ico
</code>```

Prints o for odd and nothing for even

Title: Is it an Odd Word?

Body:
sed 44 (42 + 1 for -n) 43

-1 thanks to Neil

s/[aeiou][^aeiou]*[aeiou]//gi
/[aeiou]/Ico

Prints o for odd and nothing for even


答:
JavaScript (ES6), <s>34</s> <s>41</s> <s>33</s> 32 bytes

Saved 1 bytes thanks to Arnauld:

s=>~s.split(/[aeiou]/i).length&1
```

<ul>
<li>Odd word : returns <code>1</code></li>
<li>Even words : returns <code>0</code></li>
</ul>

<p><hr>
Previous solutions:</p>

<p>33 bytes thanks to Arnauld:</p>

<pre class="lang-js prettyprint-override"><code>s=>s.split(/[aeiou]/i).length&1^1
</code>```

Odd word : returns 1

Even words : returns 0

Another way without bitwise operators:

s=>++s.split(/[aeiou]/i).length%2
```

<p>41 bytes:</p>

<pre class="lang-js prettyprint-override"><code>(s,a=s.match(/[aeiou]/ig))=>a&&a.length%2
</code>```

Odd word : returns 1

Even words with odd letters : returns 0

Even words with no odd letters : returns null

42 bytes to return 0 instead of null:

(s,a=s.match(/[aeiou]/ig))=>a?a.length%2:0
```

<p>34 bytes, breaks on words with no odd letters:</p>

<pre class="lang-js prettyprint-override"><code>f=s=>s.match(/[aeiou]/ig).length%2
</code>```

Saved 2 bytes thanks to Shaun H

s=>s.match(/[aeiou]/ig).length%2
```

Title: Is it an Odd Word?

Body:
JavaScript (ES6), <s>34</s> <s>41</s> <s>33</s> 32 bytes

Saved 1 bytes thanks to Arnauld:

s=>~s.split(/[aeiou]/i).length&1

Odd word : returns 1

Even words : returns 0

Previous solutions:

33 bytes thanks to Arnauld:

s=>s.split(/[aeiou]/i).length&1^1

Odd word : returns 1

Even words : returns 0

Another way without bitwise operators:

s=>++s.split(/[aeiou]/i).length%2

41 bytes:

(s,a=s.match(/[aeiou]/ig))=>a&&a.length%2

Odd word : returns 1

Even words with odd letters : returns 0

Even words with no odd letters : returns null

42 bytes to return 0 instead of null:

(s,a=s.match(/[aeiou]/ig))=>a?a.length%2:0

34 bytes, breaks on words with no odd letters:

f=s=>s.match(/[aeiou]/ig).length%2

Saved 2 bytes thanks to Shaun H

s=>s.match(/[aeiou]/ig).length%2


答:
Ruby, 30 bytes

```<code>->w{w.scan(/[aeiou]/i).size%2}
</code>```

Title: Is it an Odd Word?

Body:
Ruby, 30 bytes

->w{w.scan(/[aeiou]/i).size%2}


答:
Vim, <s>32, 31</s>, 29 keystrokes

```<code>:s/[^aeiou]//gi
C<C-r>=len(@")%2<cr>
</code>```

Since the V interpreter is backwards compatible, you can try it online! right here.

<s>One</s> Three bytes saved thanks to m-chrzan!

Title: Is it an Odd Word?

Body:
Vim, <s>32, 31</s>, 29 keystrokes

:s/[^aeiou]//gi
C<C-r>=len(@")%2<cr>

Since the V interpreter is backwards compatible, you can try it online! right here.

<s>One</s> Three bytes saved thanks to m-chrzan!


问:
Calculate the sum of ILD

Input:

An integer

Output:

Sum of the input itself + the length of the input + each individual digit of the input.

```<code>nr + nr-length + {sum of digits} = output
</code>```

Examples:

Input: 99

Output: 99 (nr) + 2 (nr-length) + (9 + 9) (digits) → 119

Input: 123

Output: 123 + 3 + (1 + 2 + 3) → 132

Challenge rules:

The input can also contain negative input, which are resolved special. The -/minus-sign is also +1 for the length, and is part of the first digit.

For example:

Input: -123

Output: -123 + 4 + (-1 + 2 + 3) → -115

You can assume that the input nor output will ever be outside the range of an (32-bit) integer.

General rules:

This is code-golf, so shortest answer in bytes wins.

Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.

Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.

Default Loopholes are forbidden.

If possible, please add a link with a test for your code.

Also, please add an explanation if necessary.

Test cases:

```<code>87901 → 87931
123 → 132
99 → 119
5 → 11
1 → 3
0 → 1
-3 → -4
-123 → -115
-900 → -905
-87901 → -87886
</code>```

Semi-related: Count Sum of all Digits

答:
dc, 56 bytes

```<code>?dZrdd1sa[1+r0r-_1sa]sb0>b[A~rd0<x]dsxxrla*[+z1<y]dsyxp
</code>```

No shorter than Joe's above, but a somewhat different implementation (and one that takes negative numbers as input vs. a subtraction command). Can probably be golfed more, but lunch only lasts so long.

```<code>?                #input
dZrdd            #find no. of digits, rotate to bottom of stack, dup input twice
1sa              #coefficient for first digit stored in register 'a'
[1+r0r-_1sa]sb   #macro 'b' executes on negative numbers. add one (for the neg. sign)
                 #rotate this value out of the way, leave a positive copy on top
0>b              #run the above macro if negative
[A~rd0<x]dsxx    #create and run macro 'x'; mod 10 to grab least significant digit
                 #keep doing it if quotient is greater than zero
rla*             #a zero remains in the way of our most significant digit, rotate it down
                 #and multiply said digit by our coefficient 'a' from earlier
[+z1<y]dsyx      #add two top stack values (we left that zero there to ensure this always
                 #works), check stack depth and keep doing it while there's stack
p                #print!
</code>```

Title: Calculate the sum of ILD

Body:
dc, 56 bytes

?dZrdd1sa[1+r0r-_1sa]sb0>b[A~rd0<x]dsxxrla*[+z1<y]dsyxp

No shorter than Joe's above, but a somewhat different implementation (and one that takes negative numbers as input vs. a subtraction command). Can probably be golfed more, but lunch only lasts so long.

?                #input
dZrdd            #find no. of digits, rotate to bottom of stack, dup input twice
1sa              #coefficient for first digit stored in register 'a'
[1+r0r-_1sa]sb   #macro 'b' executes on negative numbers. add one (for the neg. sign)
                 #rotate this value out of the way, leave a positive copy on top
0>b              #run the above macro if negative
[A~rd0<x]dsxx    #create and run macro 'x'; mod 10 to grab least significant digit
                 #keep doing it if quotient is greater than zero
rla*             #a zero remains in the way of our most significant digit, rotate it down
                 #and multiply said digit by our coefficient 'a' from earlier
[+z1<y]dsyx      #add two top stack values (we left that zero there to ensure this always
                 #works), check stack depth and keep doing it while there's stack
p                #print!


答:
Pyke, 10 bytes

```<code>l1~Vm/s 2%
</code>```

Try it here!

Title: Is it an Odd Word?

Body:
Pyke, 10 bytes

l1~Vm/s 2%

Try it here!


答:
Haskell, <s>38</s> 37 bytes

```<code>odd.length.filter(`elem`"aeiouAEIOU")
</code>```

Thanks to Angs for one byte!

Title: Is it an Odd Word?

Body:
Haskell, <s>38</s> 37 bytes

odd.length.filter(`elem`"aeiouAEIOU")

Thanks to Angs for one byte!


问:
Tips for golfing in Excel?
It's strange that I haven't seen this, as Excel seems to be a valid language for code golfing (despite its 'compiler' not being free).

Excel is somewhat of a wildcard in golfing, being good at golfing challenges of medium complexity, and sometimes simpler challenges as well. More often than not, Excel is good at challenges with string manipulation and mixed string-number manipulation.

What general tips do you have for golfing in Excel? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Excel (NOT VBA). Please, one tip per answer.

答:
Concatenate shorthand:

The CONCATENATE function can be replaced with the & symbol 100% of the time, so long as the first argument is a string, or cell.

example:

```<code>CONCATENATE(A1,B1)
</code>```

could be shortened to

```<code>A1&B1
</code>```

In newer version of Excel (2016 or newer) the CONCAT function can be used for arrays and longer series of variables.

```<code>CONCAT(1:1)
</code>```

Title: Tips for golfing in Excel?

Body:
Concatenate shorthand:

The CONCATENATE function can be replaced with the & symbol 100% of the time, so long as the first argument is a string, or cell.

example:

CONCATENATE(A1,B1)

could be shortened to

A1&B1

In newer version of Excel (2016 or newer) the CONCAT function can be used for arrays and longer series of variables.

CONCAT(1:1)

ContentLicense: CC BY-SA 4.0


答:
Vectorization with Arrays

Whenever a function takes an array as an argument instead of a singleton, That function will also output an array with the result value to the corresponding indecies.

Example:

=LEN(A1)+LEN(B2)+LEN(C3)

could be replaced with

=SUM(LEN({A1,B2,C3}))

Title: Tips for golfing in Excel?

Body:
It's strange that I haven't seen this, as Excel seems to be a valid language for code golfing (despite its 'compiler' not being free).

Excel is somewhat of a wildcard in golfing, being good at golfing challenges of medium complexity, and sometimes simpler challenges as well. More often than not, Excel is good at challenges with string manipulation and mixed string-number manipulation.

What general tips do you have for golfing in Excel? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Excel (NOT VBA). Please, one tip per answer.


问:
Draw some ASCII-boxes
Take two lists of non-negative integers, and output an ASCII-box as it's defined below.

Corners and intersections are pluses: + (ASCII-code 43)

Vertical lines are bars | (ASCII-code 124)

Horizontal lines are minuses - (ASCII-code 45)

The first input list specifies the number of minuses between each plus sign, in the horizontal direction.

The second input list specifies the number of bars between each plus sign, in the vertical direction.

It's easier to explain with a few examples:

```<code>0    // No minuses between each + sign
0    // No bars between + signs

++
++

------------------
1 2   // First a single minus, then two minuses
1 2   // First  one bar, then two bars

+-+--+
| |  |
+-+--+
| |  |
| |  |
+-+--+

------------------
1 0 3 0 2 0
2 1 0 0

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

Clarifications:

Input order and format are optional

Only the boxes should be printed/displayed, but a trailing space or newlines are accepted.

You may optionally add 1 to all input values if that's more convenient. The second example would then be: 2 3; 2 3.

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

答:
Haskell, 55 bytes

f[a,b]x=a:do n<-x;(b<$[1..n])++[a]
g x=f[f"+-"x,f"| "x]
```

Defines a function g which takes the two input lists and returns a list containing the lines of the output

Title: Draw some ASCII-boxes

Body:
Haskell, 55 bytes

f[a,b]x=a:do n<-x;(b<$[1..n])++[a]
g x=f[f"+-"x,f"| "x]

Defines a function g which takes the two input lists and returns a list containing the lines of the output


答:
Actually, 17 bytes

Golfing suggestions welcome. Try it online!

```<code>ù╝"aeiou"`╛c`MΣ1&
</code>```

Ungolfing

```<code>                    Implicit input s.
ù╝                  Add s.lower() to register 1.
  "aeiou"`  `M      Push the string "aeiou" and map the following function over it.
          ╛         Push register 1 to stack.
           c        Count the occurrences of "a", then "e", etc.
              Σ     Sum the counts of these occurrences.
               1&   x&1 == x%2.
                    Implicit return.
</code>```

Title: Is it an Odd Word?

Body:
Challenge

Given a single word as input, determine if the word is odd or even.

Odd and Even words

Assume the general rules:

```<code>odd + odd = even
even + odd = odd
odd + even = odd
even + even = even
</code>```

In the alphabet, the odd letters are:

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

And the even letters are:

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

The same applies to capital letters (AEIOU are odd and BCDFGHJKLMNPQRSTVWXYZ are even).

You then 'add' each of the letters in the word together. For example, the word cats is equivalent to:

```<code>even + odd + even + even
</code>```

Which simplifies to:

```<code>odd + even
</code>```

Which simplifies further to:

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

So the word cats is odd.

Examples

```<code>Input:  trees
Output: even
</code>```

```<code>Input:  brush
Output: odd
</code>```

```<code>Input:  CAts
Output: odd
</code>```

```<code>Input:  Savoie
Output: even
</code>```

```<code>Input:  rhythm
Output: even
</code>```

Rules

All input will be a single word which will only contain alphabetical characters.

If the word is odd, output a truthy value. If the word is even, output a falsey value.

Winning

The shortest code in bytes wins.

Body:
Actually, 17 bytes

Golfing suggestions welcome. Try it online!

ù╝"aeiou"`╛c`MΣ1&

Ungolfing

                    Implicit input s.
ù╝                  Add s.lower() to register 1.
  "aeiou"`  `M      Push the string "aeiou" and map the following function over it.
          ╛         Push register 1 to stack.
           c        Count the occurrences of "a", then "e", etc.
              Σ     Sum the counts of these occurrences.
               1&   x&1 == x%2.
                    Implicit return.


答:
Perl, 18/19 bytes

Includes +1 for -p

Give input on STDIN, prints 0 for even, 1 for odd

```<code>#!/usr/bin/perl -p
$_=1&lc=~y;aeiou;
</code>```

Must be put in a file, but the file must not have a final newline giving 18 bytes. This is admittedly abusing the perl counting rules a bit since this actually doesn't work when run in a -e commandline which implicitely adds a final \n which makes the program not work. So more honest but 19 bytes is:

```<code>#!/usr/bin/perl -p
$_=1&lc=~y;aeiou;;
</code>```

Title: Is it an Odd Word?

Body:
Perl, 18/19 bytes

Includes +1 for -p

Give input on STDIN, prints 0 for even, 1 for odd

#!/usr/bin/perl -p
$_=1&lc=~y;aeiou;

Must be put in a file, but the file must not have a final newline giving 18 bytes. This is admittedly abusing the perl counting rules a bit since this actually doesn't work when run in a -e commandline which implicitely adds a final \n which makes the program not work. So more honest but 19 bytes is:

#!/usr/bin/perl -p
$_=1&lc=~y;aeiou;;


答:
Reference shorthand:

If your program is required to take multiple inputs, you may want to be able to scoop them all up at once. to read multiple cells as an array, one could do such as the example:

Example:

=len(A1)+Len(B1)+LEN(C1)

could be

=SUM(LEN(A1:C1))

=SUM(LEN(A1:C1 A2:C2 A3:C3))

could be

=SUM(LEN(A1:C3))

=SUM(LEN(A1:A1024))

could be

=SUM(LEN(A:A))

=SUM(LEN(A:A B:B C:C))

could be

=SUM(LEN(A:C))

Title: Tips for golfing in Excel?


答:
Java 143 bytes

Output is a boolean which is true if the word is odd.

```<code>public static boolean isOdd(char c){
return c=='a'||c=='e'||c=='i'||c=='o'||c=='u';
}

public static boolean isOdd(String k){
  boolean y=false;
  for(char x:k.toLowerCase().toCharArray())
    if(isOdd(x))
      y=(y?false:true);
  return y;
}
</code>```

Golfed:

```<code>boolean i(String k){boolean y=false;for(char c:k.toLowerCase().toCharArray())if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u')y=!y;return y;}
</code>```

Edit:

Fixed Case-sensitivity

Title: Is it an Odd Word?

Body:
Java 143 bytes

Output is a boolean which is true if the word is odd.

public static boolean isOdd(char c){
return c=='a'||c=='e'||c=='i'||c=='o'||c=='u';
}

public static boolean isOdd(String k){
  boolean y=false;
  for(char x:k.toLowerCase().toCharArray())
    if(isOdd(x))
      y=(y?false:true);
  return y;
}

Golfed:

boolean i(String k){boolean y=false;for(char c:k.toLowerCase().toCharArray())if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u')y=!y;return y;}

Edit:

Fixed Case-sensitivity


问:
Print all Country Codes
ISO 3166-1 is the standard that defines all the country codes. The well-known two-letter codes (US, GB, JP, etc.) are called Alpha-2 codes.

With two letters, there are only 262 = 676 possible codes, which can be nicely arranged in a grid. This table can be useful as an overview, to see which codes are actually in use, reserved, etc.

This challenge is simple: you're to print all assigned codes of this grid to STDOUT, using plain ASCII, exactly as shown below:

```<code>AA    AC AD AE AF AG    AI       AL AM AN AO AP AQ AR AS AT AU    AW AX    AZ
BA BB    BD BE BF BG BH BI BJ    BL BM BN BO    BQ BR BS BT BU BV BW BX BY BZ
CA    CC CD    CF CG CH CI    CK CL CM CN CO CP    CR CS    CU CV CW CX CY CZ
            DE    DG       DJ DK    DM    DO                            DY DZ
EA    EC    EE EF EG EH             EM       EP    ER ES ET EU EV EW
                        FI FJ FK FL FM    FO       FR                FX
GA GB GC GD GE GF GG GH GI       GL GM GN    GP GQ GR GS GT GU    GW    GY
                              HK    HM HN          HR    HT HU
   IB IC ID IE                   IL IM IN IO    IQ IR IS IT IU IV IW IX IY IZ
JA          JE                      JM    JO JP
            KE    KG KH KI          KM KN    KP    KR             KW    KY KZ
LA LB LC       LF       LI    LK                   LR LS LT LU LV       LY
MA    MC MD ME MF MG MH       MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ
NA    NC    NE NF NG    NI       NL       NO NP    NR    NT NU             NZ
OA                                  OM
PA          PE PF PG PH PI    PK PL PM PN          PR PS PT       PW    PY
QA                                  QM QN QO QP QQ QR QS QT QU QV QW QX QY QZ
RA RB RC    RE       RH RI       RL RM RN RO RP       RS    RU    RW
SA SB SC SD SE SF SG SH SI SJ SK SL SM SN SO       SR SS ST SU SV    SX SY SZ
TA    TC TD    TF TG TH    TJ TK TL TM TN TO TP    TR    TT    TV TW       TZ
UA                UG          UK    UM                US                UY UZ
VA    VC    VE    VG    VI             VN                   VU
               WF                WL       WO          WS       WV
XA XB XC XD XE XF XG XH XI XJ XK XL XM XN XO XP XQ XR XS XT XU XV XW XX XY XZ
            YE                                           YT YU YV
ZA                                  ZM             ZR             ZW       ZZ
</code>```

(If I made any mistakes copying it down, the table here in this post is normative for the challenge, not the one on Wikipedia.)

You may or may not use trailing whitespace in each line which doesn't contain the *Z code, but not beyond the 77th character in that line (i.e., at most, you can make it a rectangular block, ending in Zs and spaces). Also, you may or may not use a single trailing new line at the end.

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

答:
Haskell, 357

Damn, this is kinda hard.

```<code>import Data.List.Split
az=['A'..'Z']
k=0x9084004380010ffffffc24482004085570414419abfbb7be7fff153e65ffff001538f7c400100186b25d7fffcfd4f8149f42b1d00034047ff781e068d0015fb9ff2097c007e90f5c015943f6fdedffdefeedff97d
l i (a:b)|i`mod`2>0=a:l(i`div`2)b|1>0="  ":l(i`div`2)b
l _ _=[]
main=putStr$unlines$chunksOf 78$unwords$l k[a:[b]|a<-az,b<-az]
</code>```

Prints to STDOUT when compiled (thus the main). Using proper compression would make this a lot shorter... ideas welcome

Title: Print all Country Codes

Body:
Haskell, 357

Damn, this is kinda hard.

import Data.List.Split
az=['A'..'Z']
k=0x9084004380010ffffffc24482004085570414419abfbb7be7fff153e65ffff001538f7c400100186b25d7fffcfd4f8149f42b1d00034047ff781e068d0015fb9ff2097c007e90f5c015943f6fdedffdefeedff97d
l i (a:b)|i`mod`2>0=a:l(i`div`2)b|1>0="  ":l(i`div`2)b
l _ _=[]
main=putStr$unlines$chunksOf 78$unwords$l k[a:[b]|a<-az,b<-az]

Prints to STDOUT when compiled (thus the main). Using proper compression would make this a lot shorter... ideas welcome


答:
Java 7, 88

boolean f(char[]s){int x=0;for(char c:s)if("aeiouAEIOU".indexOf(c)>=0)++x;return x%2>0;}
```

<p>Ungolfed:</p>

<pre class="lang-java prettyprint-override"><code>  boolean f(char[] s) {
    int x = 0;
    for (char c : s) {
      if ("aeiouAEIOU".indexOf(c) >= 0) {
        ++x;
      }
    }
    return x % 2 > 0;
  }
</code>```

Title: Is it an Odd Word?

Body:
Java 7, 88

boolean f(char[]s){int x=0;for(char c:s)if("aeiouAEIOU".indexOf(c)>=0)++x;return x%2>0;}

Ungolfed:

  boolean f(char[] s) {
    int x = 0;
    for (char c : s) {
      if ("aeiouAEIOU".indexOf(c) >= 0) {
        ++x;
      }
    }
    return x % 2 > 0;
  }


问:
StringgnirtSStringgnirtSStringgnirtS
Here is a relatively simple challenge for you.

Given a string of length N, output the string forwards, then backwards, then forwards, then backwards... etc. N times. For example, if your input was

```<code>Hello!
</code>```

You should output:

```<code>Hello!!olleHHello!!olleHHello!!olleH
</code>```

You may also optionally output one trailing newline.

Your submission may be either a full program or a function, and you may take input and output in any reasonable format. For example, you may take IO from STDIN/STDOUT, function arguments and return value, from a file, etc. You can safely assume that the input string will not be empty, and will only contain printable ASCII. You must output the new string on a single line. So, for example, if the output to the last example was

```<code>Hello!
!olleH
Hello!
!olleH
Hello!
!olleH
</code>```

This would not be a valid solution!

Here are some more test cases:

```<code>Input:
a
Output:
a

Input:
abcd
Output:
abcddcbaabcddcba

Input:
OK!
Output:
OK!!KOOK!

Input:
4815162342
Output:
4815162342243261518448151623422432615184481516234224326151844815162342243261518448151623422432615184

Input:
PPCG
Output:
PPCGGCPPPPCGGCPP

Input:
42
Output:
4224
</code>```

Leaderboards

Since this is a code-golf challenge, standard loopholes are banned, and the shortest answer in bytes wins! However, this is also a competition to have the shortest answer in any particular langauge. While it's unlikely that a Java answer will beat an answer in perl, or some golfing language, it's still very impressive to have the shortest Java answer. So, you can use this leaderboard to see both

The shortest answer out of all languages, and

The shortest answer in each individual language.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```<code># Language Name, N bytes
</code>```

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

```<code># Ruby, <s>104</s> <s>101</s> 96 bytes
</code>```

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

```<code># Perl, 43 + 2 (-p flag) = 45 bytes
</code>```

You can also make the language name a link which will then show up in the leaderboard snippet:

```<code># [><>](http://esolangs.org/wiki/Fish), 121 bytes
</code>```

var QUESTION_ID=93261,OVERRIDE_USER=31716;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

```

答:
Vimscript - 109 bytes

@DJMcMayhem already beat me to it, but because I did it anyway, here's my losing answer.  I thought reversing a string would be easier though!

```<code>fu A(s)
let i=0
wh(i<len(a:s))
exe "norm A". [a:s,join(reverse(split(a:s,'\zs')),'')][i%2]
let i+=1
endw
endf
</code>```

Ungolfed

```<code>function! A(s)
  let reversed=join(reverse(split(a:s,'\zs    ')),'')
  let both=[a:s,reversed]
  let i=0
  while(i<len(a:s))
    exe "norm a".both[i%2]
    let i+=1
  endwhile
endfunction
</code>```

Title: StringgnirtSStringgnirtSStringgnirtS

Body:
Vimscript - 109 bytes

@DJMcMayhem already beat me to it, but because I did it anyway, here's my losing answer.  I thought reversing a string would be easier though!

fu A(s)
let i=0
wh(i<len(a:s))
exe "norm A". [a:s,join(reverse(split(a:s,'\zs')),'')][i%2]
let i+=1
endw
endf

Ungolfed

function! A(s)
  let reversed=join(reverse(split(a:s,'\zs    ')),'')
  let both=[a:s,reversed]
  let i=0
  while(i<len(a:s))
    exe "norm a".both[i%2]
    let i+=1
  endwhile
endfunction


问:
Words -> City Skyline

The challenge

Your program or function will accept a single string input from STDIN or a function parameter. You can assume the input will contain only alphabetic characters (a-zA-Z), spaces, and full stops. Input is case insensitive, so you should treat 'a' exactly the same as you would treat 'A'.

For each character in the string, you will output a representation of a building as per the following specification.

Each building must have a roof, designated by an underscore on the top line then a slash, space, backslash on the second line.

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

You will then have a number of floors, matching the letter number (a=1, b=2, c=3 etc.) which are represented by a wall (|) on each side and a space in the middle. The bottom floor (and only the bottom floor) should have a foundation, which is an underscore between the walls. Like this...

```<code>|_|
</code>```

So for example, 'b' would look like this

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

Now, we know that very tall, narrow buildings cannot stand and must get wider at the base, so no building can stand more than three storeys high without some additional support. So every three levels (no less) you should add a 'widening layer'. The widening layer consists of a slash and backslash directly above the walls of the section below it, and the section below should be two spaces wider than the section above. The extra layer does not count towards the height of the building.

Buildings should not overlap but should not have any unnecessary spaces between them, and the ground is always flat so all buildings should have their base on the same level.

For example, 'abcdefga' will look like this.

```<code>                           _
                          / \
                     _    | |
                _   / \   | |
           _   / \  | |   | |
          / \  | |  | |  /   \
       _  | |  | |  | |  |   |
    _ / \ | |  | | /   \ |   |
 _ / \| | | | /   \|   | |   |  _
/ \| || |/   \|   ||   |/     \/ \
|_||_||_||___||___||___||_____||_|
</code>```

Spaces in the string input should be represented by a double space.

Full stops in the string input should be represented by rubble like this.

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

Further examples

Input = Hello world.

Output =

```<code>                                                   _
                                                  / \
                                                  | |
                                                  | |
                                                  | |
                                                 /   \
                                                 |   |
                                                 |   |                       _
                                                 |   |                      / \
                                                /     \                     | |
                                                |     |                     | |
                                   _            |     |          _          | |
                                  / \           |     |         / \        /   \
                                  | |          /       \        | |        |   |
                                  | |          |       |        | |        |   |
                _        _        | |          |       |        | |        |   |        _
               / \      / \      /   \         |       |       /   \      /     \      / \
               | |      | |      |   |        /         \      |   |      |     |      | |
               | |      | |      |   |        |         |      |   |      |     |      | |
               | |      | |      |   |        |         |      |   |      |     |      | |
   _          /   \    /   \    /     \       |         |     /     \    /       \    /   \
  / \         |   |    |   |    |     |      /           \    |     |    |       |    |   |
  | |         |   |    |   |    |     |      |           |    |     |    |       |    |   |
  | |         |   |    |   |    |     |      |           |    |     |    |       |    |   |
  | |    _   /     \  /     \  /       \     |           |   /       \  /         \  /     \
 /   \  / \  |     |  |     |  |       |    /             \  |       |  |         |  |     |   _
 |   |  | |  |     |  |     |  |       |    |             |  |       |  |         |  |     |  / \
 |   |  | |  |     |  |     |  |       |    |             |  |       |  |         |  |     |  | |
 |   |  | | /       \/       \/         \   |             | /         \/           \/       \ | |
/     \/   \|       ||       ||         |  /               \|         ||           ||       | | |
|     ||   ||       ||       ||         |  |               ||         ||           ||       |/   \
|_____||___||_______||_______||_________|  |_______________||_________||___________||_______||___|/\/\
</code>```

Input = lorem ipsum

```<code>                                                                                _
                                                                                / \
                                                                              _             | |
                                                                             / \            | |
                          _                                                  | |            | |
                         / \                                                 | |           /   \
                         | |                                    _            | |           |   |
                         | |                                   / \          /   \          |   |
              _          | |                                   | |          |   |          |   |
             / \        /   \                                  | |          |   |         /     \
             | |        |   |              _                   | |          |   |         |     |         _
             | |        |   |             / \                 /   \        /     \        |     |        / \
    _        | |        |   |             | |                 |   |        |     |        |     |        | |
   / \      /   \      /     \            | |                 |   |        |     |       /       \       | |
   | |      |   |      |     |            | |                 |   |        |     |       |       |       | |
   | |      |   |      |     |           /   \               /     \      /       \      |       |      /   \
   | |      |   |      |     |           |   |        _      |     |      |       |      |       |      |   |
  /   \    /     \    /       \          |   |       / \     |     |      |       |     /         \     |   |
  |   |    |     |    |       |          |   |       | |     |     |      |       |     |         |     |   |
  |   |    |     |    |       |         /     \      | |    /       \    /         \    |         |    /     \
  |   |    |     |    |       |         |     |      | |    |       |    |         |    |         |    |     |
 /     \  /       \  /         \   _    |     |     /   \   |       |    |         |   /           \   |     |
 |     |  |       |  |         |  / \   |     |     |   |   |       |    |         |   |           |   |     |
 |     |  |       |  |         |  | |  /       \    |   |  /         \  /           \  |           |  /       \
 |     |  |       |  |         |  | |  |       |    |   |  |         |  |           |  |           |  |       |
/       \/         \/           \ | |  |       |   /     \ |         |  |           | /             \ |       |
|       ||         ||           |/   \ |       |   |     | |         |  |           | |             | |       |
|       ||         ||           ||   |/         \  |     |/           \/             \|             |/         \
|_______||_________||___________||___||_________|  |_____||___________||_____________||_____________||_________|
</code>```

Input = a.a.a.x.x.x.a.a.a

```<code>                             _                    _                    _
                            / \                  / \                  / \
                            | |                  | |                  | |
                            | |                  | |                  | |
                            | |                  | |                  | |
                           /   \                /   \                /   \
                           |   |                |   |                |   |
                           |   |                |   |                |   |
                           |   |                |   |                |   |
                          /     \              /     \              /     \
                          |     |              |     |              |     |
                          |     |              |     |              |     |
                          |     |              |     |              |     |
                         /       \            /       \            /       \
                         |       |            |       |            |       |
                         |       |            |       |            |       |
                         |       |            |       |            |       |
                        /         \          /         \          /         \
                        |         |          |         |          |         |
                        |         |          |         |          |         |
                        |         |          |         |          |         |
                       /           \        /           \        /           \
                       |           |        |           |        |           |
                       |           |        |           |        |           |
                       |           |        |           |        |           |
                      /             \      /             \      /             \
                      |             |      |             |      |             |
                      |             |      |             |      |             |
                      |             |      |             |      |             |
                     /               \    /               \    /               \
 _      _      _     |               |    |               |    |               |     _      _      _
/ \    / \    / \    |               |    |               |    |               |    / \    / \    / \
|_|/\/\|_|/\/\|_|/\/\|_______________|/\/\|_______________|/\/\|_______________|/\/\|_|/\/\|_|/\/\|_|
</code>```

Rules

Of course this is code golf, lowest score in bytes wins

Standard loophole rules apply

Any number of additional blank lines before or after the output are allowed

You can choose to output the entire result in one string or offer the output as an array where each element represents one line of output, or send to STDOUT

Note

This is my first post to PPCG, so please go easy on me. It's been through the sandbox. Any negative points or possible improvements please post as a comment and I'll do what I can

答:
Ruby, 245

```<code>->s{a=['']*36
w=' '
s.chars{|c|a[u=0]+=c<?!?w*2:c<?/?"/\\"*2:(h=c.upcase.ord-64
1.upto(1+h+=(h-1)/3){|t|u=[u,l=1+2*((f=h-t)/4)].max
a[t]+=w*(a[0].size-a[t].size)+(f<-1?w:f<0??_:(f%4<1?[?/,?\\]:[?|]*2)*(w*l)).center(u+2)}
"|#{?_*u}|")}
a.reverse}
</code>```

You allow as many extra newlines as you want, so I'm taking liberty with that.  Aside from that, the process is as follows:

Initialize an output array a.

For each char:

if it's ' ', add   to a[0]

if it's '.', add /\/\ to a[0]

otherwise:

calculate the height (c.upcase.ord + (c.upcase.ord-1)/3)

for each row in a:

pad the row with whitespace. a[t]+=w*(a[0].size-a[t].size)

if we're one above h, center a _

else if we're above height, center a

else if we're below height, center |  | or /  \ of the proper width (1+2*((h-t)/4), depending on if h-t%4==0

add "|___|" of the right width to a[0]

return a.reverse

I bet I can get it smaller if I work out the math to avoid reverse

Title: Words -> City Skyline

Body:
Ruby, 245

->s{a=['']*36
w=' '
s.chars{|c|a[u=0]+=c<?!?w*2:c<?/?"/\\"*2:(h=c.upcase.ord-64
1.upto(1+h+=(h-1)/3){|t|u=[u,l=1+2*((f=h-t)/4)].max
a[t]+=w*(a[0].size-a[t].size)+(f<-1?w:f<0??_:(f%4<1?[?/,?\\]:[?|]*2)*(w*l)).center(u+2)}
"|#{?_*u}|")}
a.reverse}

You allow as many extra newlines as you want, so I'm taking liberty with that.  Aside from that, the process is as follows:

Initialize an output array a.

For each char:

if it's ' ', add   to a[0]

if it's '.', add /\/\ to a[0]

otherwise:

calculate the height (c.upcase.ord + (c.upcase.ord-1)/3)

for each row in a:

pad the row with whitespace. a[t]+=w*(a[0].size-a[t].size)

if we're one above h, center a _

else if we're above height, center a

else if we're below height, center |  | or /  \ of the proper width (1+2*((h-t)/4), depending on if h-t%4==0

add "|___|" of the right width to a[0]

return a.reverse

I bet I can get it smaller if I work out the math to avoid reverse


答:
Python 3, 53 Bytes

This can probably be golfed further:

```<code>lambda n:[x in 'aeiou' for x in n.lower()].count(1)&1
</code>```

Title: Is it an Odd Word?

Body:
Python 3, 53 Bytes

This can probably be golfed further:

lambda n:[x in 'aeiou' for x in n.lower()].count(1)&1


答:
CJam, <s>18</s> 17 bytes

```<code>0lel"aeiou"f{&,^}
</code>```

Try it online!

Explanation

```<code>0                 e# Push 0
 l                e# Read line from input
  el              e# Convert to lowercase
   "aeiou"        e# Push this string
          f{   }  e# Map code block to each char of the input and the string "aeiou"
            &     e# Set intersection of each input char with the "aeiou". The result
                  e# is either that char or the empty string
             ,    e# Length. Gives 0 or 1
              ^   e# Binary XOR. Uses the initial 0 the first time
                  e# Implicitly display
</code>```

Title: Is it an Odd Word?

Body:
CJam, <s>18</s> 17 bytes

0lel"aeiou"f{&,^}

Try it online!

Explanation

0                 e# Push 0
 l                e# Read line from input
  el              e# Convert to lowercase
   "aeiou"        e# Push this string
          f{   }  e# Map code block to each char of the input and the string "aeiou"
            &     e# Set intersection of each input char with the "aeiou". The result
                  e# is either that char or the empty string
             ,    e# Length. Gives 0 or 1
              ^   e# Binary XOR. Uses the initial 0 the first time
                  e# Implicitly display


问:
Substring Chainification

Introduction

For this example, let's take the string Hello, World! and the array [3, 2, 3]. To find the substring chain, we go through the following process:

The first number of the array is 3, so we get the substring [0 - 3], which is Hel. After that, we remove the first 3 characters from the initial string, which leaves us with lo, World!.

The second number of the array is 2, so we get the substring [0 - 2] from our new string, which gives us lo. The leftover string becomes , World!.

The last number is a 3, which gives us , W. The substring chain is all of the substrings combined, which gives us:

```<code>['Hel', 'lo', ', W']
</code>```

For a more visual example:

```<code>[3, 2, 3], 'Hello, World!'
3 -> Hel
2 ->    lo
3 ->      , W
</code>```

The task

Given a non-empty string and a non-empty array only consisting of positive integers (> 0), output the substring chain. You may assume that the sum of all integers in the array does not exceed the length of the string.

You can also assume that the strings will never contain any newlines.

Test cases

```<code>Input: abcdefghijk, [2, 1, 3]
Output: ['ab', 'c', 'def']

Input: Code Golf, [4, 1]
Output: ['Code', ' ']

Input: Ayyy, [3]
Output: ['Ayy']

Input: lexicographically, [2, 2, 2, 7, 4]
Output: ['le', 'xi', 'co', 'graphic', 'ally']
</code>```

This is code-golf, so the submission with the smallest number of bytes wins!

答:
05AB1E, 1 byte

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

This is the substring(0,N) command.

Applied on a list this works repeatedly on the remainder on the string.

Try it online!

Title: Substring Chainification

Body:
05AB1E, 1 byte

£

This is the substring(0,N) command.

Applied on a list this works repeatedly on the remainder on the string.

Try it online!


答:
Jelly, <s>13 12</s> 11 bytes

-1 byte thanks to @Luis Mendo (use Ḃ to replace %2)

-1 byte thanks to @Dennis (use a string compression)

```<code>Œlf“¡ẎṢɱ»LḂ
</code>```

All test cases are at TryItOnline

How?

```<code>Œlf“¡ẎṢɱ»LḂ - Main link takes an argument - s
Œl          - lowercase(s)
   “¡ẎṢɱ»   - string of lowercase vowels (compression using the words a and eoui)
  f         - filter - keep only the vowels
         L  - length - the number of vowels
          Ḃ - Bit (modulo 2)
</code>```

Non-competing, 5 bytes (since I just added the function Øc)

```<code>fØcLḂ
</code>```

Test cases also at TryItOnline

Same as above, but Øc yields the Latin alphabet's vowels, 'AEIOUaeiou'

Title: Is it an Odd Word?

Body:
Jelly, <s>13 12</s> 11 bytes

-1 byte thanks to @Luis Mendo (use Ḃ to replace %2)

-1 byte thanks to @Dennis (use a string compression)

Œlf“¡ẎṢɱ»LḂ

All test cases are at TryItOnline

How?

Œlf“¡ẎṢɱ»LḂ - Main link takes an argument - s
Œl          - lowercase(s)
   “¡ẎṢɱ»   - string of lowercase vowels (compression using the words a and eoui)
  f         - filter - keep only the vowels
         L  - length - the number of vowels
          Ḃ - Bit (modulo 2)

Non-competing, 5 bytes (since I just added the function Øc)

fØcLḂ

Test cases also at TryItOnline

Same as above, but Øc yields the Latin alphabet's vowels, 'AEIOUaeiou'


答:
Python, 42 bytes

```<code>lambda s:sum(c in"aeiouAEIOU"for c in s)%2
</code>```

Not a whole lot to explain here. An unnamed function that returns 0 or 1.

Title: Is it an Odd Word?

Body:
Python, 42 bytes

lambda s:sum(c in"aeiouAEIOU"for c in s)%2

Not a whole lot to explain here. An unnamed function that returns 0 or 1.


答:
Brachylog, <s>20</s> 13 bytes

```<code>h@[~c.:la~t?,
</code>```

Try it online!

This is extremely inefficient and times out on TIO for the last test case.

Explanation

```<code>Input = [String, List of integers]

h@[            Take a prefix of the string
   ~c.         Take a possible list of strings which when concatenated results in that prefix
      :la      Take the lengths of each element of that list
         ~t?,  This list of lengths is equal to the list of integers of the Input
</code>```

A slightly more efficient version, 15 bytes

```t:{~l}a.,?h@[~c```

Title: Substring Chainification

Body:
Introduction

For this example, let's take the string Hello, World! and the array [3, 2, 3]. To find the substring chain, we go through the following process:

The first number of the array is 3, so we get the substring [0 - 3], which is Hel. After that, we remove the first 3 characters from the initial string, which leaves us with lo, World!.

The second number of the array is 2, so we get the substring [0 - 2] from our new string, which gives us lo. The leftover string becomes , World!.

The last number is a 3, which gives us , W. The substring chain is all of the substrings combined, which gives us:

```<code>['Hel', 'lo', ', W']
</code>```

For a more visual example:

```<code>[3, 2, 3], 'Hello, World!'
3 -> Hel
2 ->    lo
3 ->      , W
</code>```

The task

Given a non-empty string and a non-empty array only consisting of positive integers (> 0), output the substring chain. You may assume that the sum of all integers in the array does not exceed the length of the string.

You can also assume that the strings will never contain any newlines.

Test cases

```<code>Input: abcdefghijk, [2, 1, 3]
Output: ['ab', 'c', 'def']

Input: Code Golf, [4, 1]
Output: ['Code', ' ']

Input: Ayyy, [3]
Output: ['Ayy']

Input: lexicographically, [2, 2, 2, 7, 4]
Output: ['le', 'xi', 'co', 'graphic', 'ally']
</code>```

This is code-golf, so the submission with the smallest number of bytes wins!

Body:
Brachylog, <s>20</s> 13 bytes

h@[~c.:la~t?,

Try it online!

This is extremely inefficient and times out on TIO for the last test case.

Explanation

Input = [String, List of integers]

h@[            Take a prefix of the string
   ~c.         Take a possible list of strings which when concatenated results in that prefix
      :la      Take the lengths of each element of that list
         ~t?,  This list of lengths is equal to the list of integers of the Input

A slightly more efficient version, 15 bytes

t:{~l}a.,?h@[~c


答:
J (<s>96</s> <s>94</s> 92)

```<code>echo/:(+/@:(m%(m=.>./)-<./)"1@:>@:(".&.>)@:((': (\(.*?\))';,1)&rxall)@:(1!:1)@:<)&.>2}.ARGV
</code>```

Takes input from the command line as .txt files. It can take any number of files, and outputs a list of indices from saturated to unsaturated, i.e.:

```<code>$ jconsole saturated.j saturated.txt desaturated.txt
0 1
$ jconsole saturated.j desaturated.txt saturated.txt
1 0
</code>```

I've simplified the normal formula a bit: it does not bother to normalize the RGB values to [0..1], it uses the sum of the saturation per pixel rather than the average, and it actually calculates the inverse of the saturation and then sorts up. As long as the images are the same size (which they are), this does not affect the sort order which is what it's about.

Explanation:

2}.ARGV: the command line minus its first two elements

&.>: for each of these, do:

(1!:1)@:<: read file

((': (\(.*?\))';,1)&rxall): use a regex to match the pixel values

(".&.>): execute each match as J code. (1,2,3) becomes the list 1 2 3 so now we have the pixel values.

>: make a matrix from the list of lists

"1: operate on the rows of the matrix

(m%(m=.>./)-<./): MAX / (MAX - MIN), the inverse of the saturation

+/: sum

/:: sort up, so that the images are sorted in S^(-1) ascending, which gives the same order as S descending.

echo: output the list

Title: Determine which of two ImageMagick .TXT images is more saturated

Body:
You have two images (64x64 pixels each):

Your program must take the file names of each of them as command line arguments and determine which has more average saturation among their pixels.

The images are in ImageMagick .txt format.  You can download and convert these images using convert pic.png pic.txt or download the raw text (saturated, desaturated)

Ignore the first line of the file (required).

Solutions in Assembly get 50% of their characters for free.  Brainfuck, whitespace, and close variants, get 25% of their characters for free.  (e.g. if it takes 200 characters in Brainfuck; mark it as 200-50=150.)

Describe your output.  It could be the name of the more saturated image; the index of it (0 for first, 1 for second); true for the first, false for the second, etc.  Just let us know.

It should be able to take either the saturated or desaturated image first, and accurately report the more saturated (test both ways).  The filenames shouldn't be considered when evaluating saturation (e.g. no if filename contains 'desaturated'...)

Shortest answer wins.  Happy coding :-)

Body:
J (<s>96</s> <s>94</s> 92)

echo/:(+/@:(m%(m=.>./)-<./)"1@:>@:(".&.>)@:((': (\(.*?\))';,1)&rxall)@:(1!:1)@:<)&.>2}.ARGV

Takes input from the command line as .txt files. It can take any number of files, and outputs a list of indices from saturated to unsaturated, i.e.:

$ jconsole saturated.j saturated.txt desaturated.txt
0 1
$ jconsole saturated.j desaturated.txt saturated.txt
1 0

I've simplified the normal formula a bit: it does not bother to normalize the RGB values to [0..1], it uses the sum of the saturation per pixel rather than the average, and it actually calculates the inverse of the saturation and then sorts up. As long as the images are the same size (which they are), this does not affect the sort order which is what it's about.

Explanation:

2}.ARGV: the command line minus its first two elements

&.>: for each of these, do:

(1!:1)@:<: read file

((': (\(.*?\))';,1)&rxall): use a regex to match the pixel values

(".&.>): execute each match as J code. (1,2,3) becomes the list 1 2 3 so now we have the pixel values.

>: make a matrix from the list of lists

"1: operate on the rows of the matrix

(m%(m=.>./)-<./): MAX / (MAX - MIN), the inverse of the saturation

+/: sum

/:: sort up, so that the images are sorted in S^(-1) ascending, which gives the same order as S descending.

echo: output the list


答:
Python, <s>52</s>, 46 bytes

```<code>f=lambda a,s:a and[s[:a[0]]]+f(a[1:],s[a[0]:])
</code>```

A recursive lambda function.

Thanks to Dennis for shaving off 6 bytes!

Title: Substring Chainification

Body:
Python, <s>52</s>, 46 bytes

f=lambda a,s:a and[s[:a[0]]]+f(a[1:],s[a[0]:])

A recursive lambda function.

Thanks to Dennis for shaving off 6 bytes!


答:
Pyke, 10 bytes

```<code>FQR<
Ki?>Q
</code>```

Try it here!

Title: Substring Chainification

Body:
Pyke, 10 bytes

FQR<
Ki?>Q

Try it here!


答:
R, 164 bytes

I'm sure this can be done better, but it's still good practice.

```<code>f<-function(w){
l<-"aeiouAEIOU"
c<-0
for(i in 1:10){
for(j in 1:nchar(w)){
if(substr(l,i,i)==substr(w,j,j)){c<-c+1}}}
if(c%%2==0){print("F")}else{print("T")}}
</code>```

input/output

```<code>> f("trees")
[1] "F"
> f("brush")
[1] "T"
> f("CAts")
[1] "T"
> f("Savoie")
[1] "F"
> f("rhythm")
[1] "F"
</code>```

"F" for false and "T" for true.

Title: Is it an Odd Word?

Body:
Challenge

Given a single word as input, determine if the word is odd or even.

Odd and Even words

Assume the general rules:

```<code>odd + odd = even
even + odd = odd
odd + even = odd
even + even = even
</code>```

In the alphabet, the odd letters are:

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

And the even letters are:

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

The same applies to capital letters (AEIOU are odd and BCDFGHJKLMNPQRSTVWXYZ are even).

You then 'add' each of the letters in the word together. For example, the word cats is equivalent to:

```<code>even + odd + even + even
</code>```

Which simplifies to:

```<code>odd + even
</code>```

Which simplifies further to:

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

So the word cats is odd.

Examples

```<code>Input:  trees
Output: even
</code>```

```<code>Input:  brush
Output: odd
</code>```

```<code>Input:  CAts
Output: odd
</code>```

```<code>Input:  Savoie
Output: even
</code>```

```<code>Input:  rhythm
Output: even
</code>```

Rules

All input will be a single word which will only contain alphabetical characters.

If the word is odd, output a truthy value. If the word is even, output a falsey value.

Winning

The shortest code in bytes wins.

Body:
R, 164 bytes

I'm sure this can be done better, but it's still good practice.

f<-function(w){
l<-"aeiouAEIOU"
c<-0
for(i in 1:10){
for(j in 1:nchar(w)){
if(substr(l,i,i)==substr(w,j,j)){c<-c+1}}}
if(c%%2==0){print("F")}else{print("T")}}

input/output

> f("trees")
[1] "F"
> f("brush")
[1] "T"
> f("CAts")
[1] "T"
> f("Savoie")
[1] "F"
> f("rhythm")
[1] "F"

"F" for false and "T" for true.


答:
Haskell, 34 bytes

```<code>s#(a:b)=take a s:drop a s#b
_#_=[]
</code>```

Usage example: "lexicographically" # [2,2,2,7,4] -> ["le","xi","co","graphic","ally"]

Simple recursion.

Or the boring 29 bytes solution via built-in:

```<code>import Data.Lists
splitPlaces
</code>```

Title: Substring Chainification

Body:
Haskell, 34 bytes

s#(a:b)=take a s:drop a s#b
_#_=[]

Usage example: "lexicographically" # [2,2,2,7,4] -> ["le","xi","co","graphic","ally"]

Simple recursion.

Or the boring 29 bytes solution via built-in:

import Data.Lists
splitPlaces


答:
JavaScript (ES6), <s>39</s> <s>38</s> 35 bytes

Saved 3 bytes thanks to ETHproductions:

s=>a=>a.map(v=>s.slice(t,t+=v),t=0)
```

<p>Example: </p>

<pre class="lang-js prettyprint-override"><code>//Definition
f=
s=>a=>a.map(v=>s.slice(t,t+=v),t=0)

//Call
f('lexicographically')([2, 2, 2, 7, 4]);

//Output
Array [ "le", "xi", "co", "graphic", "ally" ]
</code>```

Previous solution:

38 bytes thanks to Huntro:

s=>a=>a.map(v=>s.substr(t,v,t+=v),t=0)
```

<p>39 bytes:</p>

<pre class="lang-js prettyprint-override"><code>(s,a)=>a.map(v=>s.substr(t,v,t+=v),t=0)
</code>```

Title: Substring Chainification

Body:
JavaScript (ES6), <s>39</s> <s>38</s> 35 bytes

Saved 3 bytes thanks to ETHproductions:

s=>a=>a.map(v=>s.slice(t,t+=v),t=0)

Example:

//Definition
f=
s=>a=>a.map(v=>s.slice(t,t+=v),t=0)

//Call
f('lexicographically')([2, 2, 2, 7, 4]);

//Output
Array [ "le", "xi", "co", "graphic", "ally" ]

Previous solution:

38 bytes thanks to Huntro:

s=>a=>a.map(v=>s.substr(t,v,t+=v),t=0)

39 bytes:

(s,a)=>a.map(v=>s.substr(t,v,t+=v),t=0)


答:
PowerShell v2+, 46 bytes

```<code>param($a,$b)$b|%{-join$a[$i..($i+=$_-1)];$i++}
</code>```

Takes input string $a and array $b, loops over $b. Each iteration, does an array slice of $a based on $i (defaults to $null, or 0) and the current number. Needs to do the -1 and $i++ because strings in PowerShell are zero-indexed.

Examples

(The output here is space-separated, because that's the default stringification method for arrays)

```<code>PS C:\Tools\Scripts\golfing> @('abcdefghijk',@(2,1,3)),@('Code Golf',@(4,1)),@('Ayyy',@(3)),@('lexicographically',@(2,2,2,7,4))|%{""+$_[0]+" -> "+(.\substring-chainification.ps1 $_[0] $_[1])}
abcdefghijk -> ab c def
Code Golf -> Code
Ayyy -> Ayy
lexicographically -> le xi co graphic ally
</code>```

Title: Substring Chainification

Body:
PowerShell v2+, 46 bytes

param($a,$b)$b|%{-join$a[$i..($i+=$_-1)];$i++}

Takes input string $a and array $b, loops over $b. Each iteration, does an array slice of $a based on $i (defaults to $null, or 0) and the current number. Needs to do the -1 and $i++ because strings in PowerShell are zero-indexed.

Examples

(The output here is space-separated, because that's the default stringification method for arrays)

PS C:\Tools\Scripts\golfing> @('abcdefghijk',@(2,1,3)),@('Code Golf',@(4,1)),@('Ayyy',@(3)),@('lexicographically',@(2,2,2,7,4))|%{""+$_[0]+" -> "+(.\substring-chainification.ps1 $_[0] $_[1])}
abcdefghijk -> ab c def
Code Golf -> Code
Ayyy -> Ayy
lexicographically -> le xi co graphic ally


答:
MATL, 8 bytes

```<code>ys:)1bY{
</code>```

Try it online!

Explanation

```<code>y    % Implicitly take the two inputs: numerical array, string. Duplicate the array
s    % Sum of the array, say n
:    % Range from 1 to n
)    % Take first n characters of the string
1    % Push 1
b    % Bubble up the original copy of the string to the top
Y{   % Split into pieces of lengths given by the numerical array. The pieces are
     % stored in a cell array, which is implicitly displayed, one cell per line

</code>```

Title: Substring Chainification

Body:
MATL, 8 bytes

ys:)1bY{

Try it online!

Explanation

y    % Implicitly take the two inputs: numerical array, string. Duplicate the array
s    % Sum of the array, say n
:    % Range from 1 to n
)    % Take first n characters of the string
1    % Push 1
b    % Bubble up the original copy of the string to the top
Y{   % Split into pieces of lengths given by the numerical array. The pieces are
     % stored in a cell array, which is implicitly displayed, one cell per line


答:
sed (82 + 2 for -rn) 84

```<code>s,^,\n,;:l;N;s,\n\n,\n,;:
s,^([^\n]*)\n(.)([^\n]*\n)1,\1\2\n\3,
t;P;s,^[^\n]*,,;tl
</code>```

The first line of input is the string. Then each line after that is the size of a substring in unary.

Example:

```<code>$ cat test.txt:
lexicographically
11
11
11
1111111
1111

$ cat hold | sed -rnf sed.txt
le
xi
co
graphic
ally
</code>```

Title: Substring Chainification

Body:
sed (82 + 2 for -rn) 84

s,^,\n,;:l;N;s,\n\n,\n,;:
s,^([^\n]*)\n(.)([^\n]*\n)1,\1\2\n\3,
t;P;s,^[^\n]*,,;tl

The first line of input is the string. Then each line after that is the size of a substring in unary.

Example:

$ cat test.txt:
lexicographically
11
11
11
1111111
1111

$ cat hold | sed -rnf sed.txt
le
xi
co
graphic
ally


答:
Octave / MATLAB, 31 bytes

```<code>@(s,a)mat2cell(s(1:sum(a)),1,a)
</code>```

This is an anonymous function with inputs s: string; a: numerical array.

Try it at Ideone.

Explanation

This is a port of my MATL answer.

```<code>s(1:sum(a))        % Take first n characters of string s, where n is the sum of array a
mat2cell(...,1,a)  % Split into pieces of lengths given by a and store in a cell array
</code>```

Title: Substring Chainification

Body:
Octave / MATLAB, 31 bytes

@(s,a)mat2cell(s(1:sum(a)),1,a)

This is an anonymous function with inputs s: string; a: numerical array.

Try it at Ideone.

Explanation

This is a port of my MATL answer.

s(1:sum(a))        % Take first n characters of string s, where n is the sum of array a
mat2cell(...,1,a)  % Split into pieces of lengths given by a and store in a cell array


答:
Bash + coreutils, 37 bytes

bc<<<!`sed s:[^aeiou]::ig\;q|wc -m`%2
```

<p>The input word is taken from STDIN. Output is 1 if the word is odd, or 0 if it is even.</p>

<p><strong>Explanation:</strong></p>

<pre class="lang-sh prettyprint-override"><code>       sed s:[^aeiou]::ig\;q     # remove even letters from input and exit sed
       |wc -m                    # count remaining chars (odd letters + 1 for \n)
bc<<<!`                     `%2  # apply mod 2 and invert the boolean result
</code>```

Run example:

me@LCARS:/PPCG$ ./odd_word.sh
trees
0
```

Title: Is it an Odd Word?

Body:
Bash + coreutils, 37 bytes

bc<<<!`sed s:[^aeiou]::ig\;q|wc -m`%2

The input word is taken from STDIN. Output is 1 if the word is odd, or 0 if it is even.

Explanation:

       sed s:[^aeiou]::ig\;q     # remove even letters from input and exit sed
       |wc -m                    # count remaining chars (odd letters + 1 for \n)
bc<<<!`                     `%2  # apply mod 2 and invert the boolean result

Run example:

me@LCARS:/PPCG$ ./odd_word.sh
trees
0


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

答:
Python

My solution.  Includes error handling, and a feature that preserves whitespace when sorting numbers, i.e., whitespace stays in place; numbers move.

e.g.,

```<code>Please tell me your favorite list of numbers.
I'll sort them for you.
7, 8, 6, 7, 1, 3, 5
1, 3, 5, 6, 7, 7, 8

9,  6  ,8, 43, 90, 13   , 54, 3223, 4
4,  6  ,8, 9, 13, 43   , 54, 90, 3223
</code>```

Code:

```<code>#!/usr/bin/env python
import sys
import re

class SillyUserException(ValueError):
    def __init__(self, reason, input):
        self.reason = reason
        self.input = input

    def __str__(self):
        return '''
"No man is exempt from saying silly things; the mischief is to say them deliberately."
 - Michel de Montaigne, The Complete Essays
 Your offense was {}.  You should know that it's {}.
         '''.format(self.input, self.reason)

class Item(object):
    def __init__(self, number, prespace, postspace):
        self.number = number
        self.prespace = prespace
        self.postspace = postspace

    def __str__(self):
        return self.prespace + str(self.number) + self.postspace

class ListOfNumbers(object):
    def __init__(self, string):
        self.array = self.parse(string)

    def __str__(self):
        outs = ''
        for i in self.array:
            outs += '{}{}{},'.format(i.prespace, i.number, i.postspace)
        return outs[:-1]

    def parse(self, string):
        array = []

        for item in string.split(','):
            try:
                x = int(item)
            except ValueError:
                raise SillyUserException("not a number", item)

            whitespace = re.findall("\s+", item)
            pre = ''
            post = ''
            if len(whitespace) > 0:
                pre = whitespace[0]
            if len(whitespace) > 1:
                post = whitespace[-1]

            array.append(Item(x, pre, post))

        def swap(i, j):
            tmp = array[i].number
            array[i].number = array[j].number
            array[j].number = tmp

        def min(arr, offset):
            m = arr[0]
            index = 0
            for i, e in enumerate(arr):
                if e.number < m.number:
                    m = e
                    index = i
            return index + offset

        for i, x in enumerate(array):
            m = min(array[i:], i)
            if m != i:
                swap(m, i)

        return array

if __name__ == "__main__":
    sys.stdout.writelines('\n'.join([
        "Please tell me your favorite list of numbers.",
        "I'll sort them for you.  ",
        ""
    ]))

    sys.stdout.flush()

    def read_lines():
        while True:
            line = raw_input()
            yield line

    try:
        for line in read_lines():
            if not line:
                raise SillyUserException('polite to speak when asked a question.', "<nothing>")
            if line.strip() == '42':
                raise SillyUserException('the answer to life, the universe, and everything',
                    'using and overly powerful value')
            if ',' not in line:
                raise SillyUserException("not a list", line)

            print ListOfNumbers(line)

    except SillyUserException as sillyness:
        print sillyness
</code>```

ContentLicense: CC BY-SA 2.5

Title: Sort a list of numbers

Body:
Python

My solution.  Includes error handling, and a feature that preserves whitespace when sorting numbers, i.e., whitespace stays in place; numbers move.

e.g.,

Please tell me your favorite list of numbers.
I'll sort them for you.
7, 8, 6, 7, 1, 3, 5
1, 3, 5, 6, 7, 7, 8

9,  6  ,8, 43, 90, 13   , 54, 3223, 4
4,  6  ,8, 9, 13, 43   , 54, 90, 3223

Code:

#!/usr/bin/env python
import sys
import re

class SillyUserException(ValueError):
    def __init__(self, reason, input):
        self.reason = reason
        self.input = input

    def __str__(self):
        return '''
"No man is exempt from saying silly things; the mischief is to say them deliberately."
 - Michel de Montaigne, The Complete Essays
 Your offense was {}.  You should know that it's {}.
         '''.format(self.input, self.reason)

class Item(object):
    def __init__(self, number, prespace, postspace):
        self.number = number
        self.prespace = prespace
        self.postspace = postspace

    def __str__(self):
        return self.prespace + str(self.number) + self.postspace

class ListOfNumbers(object):
    def __init__(self, string):
        self.array = self.parse(string)

    def __str__(self):
        outs = ''
        for i in self.array:
            outs += '{}{}{},'.format(i.prespace, i.number, i.postspace)
        return outs[:-1]

    def parse(self, string):
        array = []

        for item in string.split(','):
            try:
                x = int(item)
            except ValueError:
                raise SillyUserException("not a number", item)

            whitespace = re.findall("\s+", item)
            pre = ''
            post = ''
            if len(whitespace) > 0:
                pre = whitespace[0]
            if len(whitespace) > 1:
                post = whitespace[-1]

            array.append(Item(x, pre, post))

        def swap(i, j):
            tmp = array[i].number
            array[i].number = array[j].number
            array[j].number = tmp

        def min(arr, offset):
            m = arr[0]
            index = 0
            for i, e in enumerate(arr):
                if e.number < m.number:
                    m = e
                    index = i
            return index + offset

        for i, x in enumerate(array):
            m = min(array[i:], i)
            if m != i:
                swap(m, i)

        return array

if __name__ == "__main__":
    sys.stdout.writelines('\n'.join([
        "Please tell me your favorite list of numbers.",
        "I'll sort them for you.  ",
        ""
    ]))

    sys.stdout.flush()

    def read_lines():
        while True:
            line = raw_input()
            yield line

    try:
        for line in read_lines():
            if not line:
                raise SillyUserException('polite to speak when asked a question.', "<nothing>")
            if line.strip() == '42':
                raise SillyUserException('the answer to life, the universe, and everything',
                    'using and overly powerful value')
            if ',' not in line:
                raise SillyUserException("not a list", line)

            print ListOfNumbers(line)

    except SillyUserException as sillyness:
        print sillyness


答:
Pyth, 7 bytes

```<code>PcwsM._
</code>```

Takes input separated by newline, with the string unescaped and coming after the array.
Try it Online!

Explanation:

```<code>     ._  Get all prefixes of Q
   sM    Map sum across each of these prefixes (to get the total indices)
 cw      Split the string at these locations
P        Remove the last "remainder" of the string
</code>```

Title: Substring Chainification

Body:
Pyth, 7 bytes

PcwsM._

Takes input separated by newline, with the string unescaped and coming after the array.
Try it Online!

Explanation:

     ._  Get all prefixes of Q
   sM    Map sum across each of these prefixes (to get the total indices)
 cw      Split the string at these locations
P        Remove the last "remainder" of the string


答:
C 52 bytes

```<code>h(o){o=strpbrk(o,"aeiouAEIOU");return o?1^h(o+1):0;}
</code>```

the main and the result:

```<code>main()
{int   k;
 char *a[]={"trees","brush","CAts","Savoie","rhythm", 0};

 for(k=0;a[k];++k)
     printf("[%s]=%s\n", a[k], h(a[k])?"odd":"even");
}

/*
91
[trees]=even
[brush]=odd
[CAts]=odd
[Savoie]=even
[rhythm]=even

*/
</code>```

Title: Is it an Odd Word?

Body:
C 52 bytes

h(o){o=strpbrk(o,"aeiouAEIOU");return o?1^h(o+1):0;}

the main and the result:

main()
{int   k;
 char *a[]={"trees","brush","CAts","Savoie","rhythm", 0};

 for(k=0;a[k];++k)
     printf("[%s]=%s\n", a[k], h(a[k])?"odd":"even");
}

/*
91
[trees]=even
[brush]=odd
[CAts]=odd
[Savoie]=even
[rhythm]=even

*/


答:
Python 3, 45 bytes

f=lambda s,a:f(s[a[0]:print(s[:a.pop(0)])],a)
```

This prints one substring per line and terminates with an error when a is exhausted.

Test it on repl.it.

Title: Substring Chainification

Body:
Introduction

For this example, let's take the string Hello, World! and the array [3, 2, 3]. To find the substring chain, we go through the following process:

The first number of the array is 3, so we get the substring [0 - 3], which is Hel. After that, we remove the first 3 characters from the initial string, which leaves us with lo, World!.

The second number of the array is 2, so we get the substring [0 - 2] from our new string, which gives us lo. The leftover string becomes , World!.

The last number is a 3, which gives us , W. The substring chain is all of the substrings combined, which gives us:

```<code>['Hel', 'lo', ', W']
</code>```

For a more visual example:

```<code>[3, 2, 3], 'Hello, World!'
3 -> Hel
2 ->    lo
3 ->      , W
</code>```

The task

Given a non-empty string and a non-empty array only consisting of positive integers (> 0), output the substring chain. You may assume that the sum of all integers in the array does not exceed the length of the string.

You can also assume that the strings will never contain any newlines.

Test cases

```<code>Input: abcdefghijk, [2, 1, 3]
Output: ['ab', 'c', 'def']

Input: Code Golf, [4, 1]
Output: ['Code', ' ']

Input: Ayyy, [3]
Output: ['Ayy']

Input: lexicographically, [2, 2, 2, 7, 4]
Output: ['le', 'xi', 'co', 'graphic', 'ally']
</code>```

This is code-golf, so the submission with the smallest number of bytes wins!

Body:
Python 3, 45 bytes

f=lambda s,a:f(s[a[0]:print(s[:a.pop(0)])],a)

This prints one substring per line and terminates with an error when a is exhausted.

Test it on repl.it.


答:
PHP, 43 Bytes

```<code><?=preg_match_all("#[aeiou]#i",$argv[1])%2;
</code>```

Title: Is it an Odd Word?

Body:
PHP, 43 Bytes

<?=preg_match_all("#[aeiou]#i",$argv[1])%2;


答:
CJam, 11 bytes

```<code>lq~{/(ns}/;
</code>```

Try it online!

Explanation

```<code>l    e# Read input string.
q~   e# Read array of lengths and eval.
{    e# For each length...
  /  e#   Split the string into chunks of the given size.
  (  e#   Pull off the first chunk.
  n  e#   Print with linefeed.
  s  e#   Flatten the remaining chunks into a single string again.
}/
;    e# Discard any remainder of the input string.
</code>```

Title: Substring Chainification

Body:
CJam, 11 bytes

lq~{/(ns}/;

Try it online!

Explanation

l    e# Read input string.
q~   e# Read array of lengths and eval.
{    e# For each length...
  /  e#   Split the string into chunks of the given size.
  (  e#   Pull off the first chunk.
  n  e#   Print with linefeed.
  s  e#   Flatten the remaining chunks into a single string again.
}/
;    e# Discard any remainder of the input string.


答:
C, 81 bytes

i,j;f(s,l,k)char*s;int*l;{for(i=j=0;i<k;){write(1,s+j,l[i]);puts("");j+=l[i++];}}
```
<p>Because <code>write()</code> output is not buffered any online compiler will have a hard time outputting this.</p>
<p><strong>test.c</strong>:</p>
<pre class="lang-c prettyprint-override"><code>i,j;f(s,l,k)char*s;int*l;{for(i=j=0;i<k;){write(1,s+j,l[i]);puts("");j+=l[i++];}}
main(){
    int l[]={3,2,3};
    f("Hello, World!",l,3);
    int ll[]={2,1,3};
    f("abcdefghijk",ll,3);
    int lll[]={4,1};
    f("Code Golf",lll,2);
    int llll[]={3};
    f("Ayyy",llll,1);
    int lllll[]={2,2,2,7,4};
    f("lexicographically",lllll,5);
}
</code>```

Output without piping:

```<code>Hel
lo
, W
ab
c
def
Code

Ayy
le
xi
co
graphic
ally
</code>```

Title: Substring Chainification

Body:
C, 81 bytes

i,j;f(s,l,k)char*s;int*l;{for(i=j=0;i<k;){write(1,s+j,l[i]);puts("");j+=l[i++];}}

Because write() output is not buffered any online compiler will have a hard time outputting this.

test.c:

i,j;f(s,l,k)char*s;int*l;{for(i=j=0;i<k;){write(1,s+j,l[i]);puts("");j+=l[i++];}}
main(){
    int l[]={3,2,3};
    f("Hello, World!",l,3);
    int ll[]={2,1,3};
    f("abcdefghijk",ll,3);
    int lll[]={4,1};
    f("Code Golf",lll,2);
    int llll[]={3};
    f("Ayyy",llll,1);
    int lllll[]={2,2,2,7,4};
    f("lexicographically",lllll,5);
}

Output without piping:

Hel
lo
, W
ab
c
def
Code

Ayy
le
xi
co
graphic
ally


答:
J, 20 bytes

```<code>2|+/@e.&'aeiouAEOIU'
</code>```

Straight-forward approach

Explanation

```<code>2|+/@e.&'aeiouAEOIU'  Input: string S
     e.&'aeiouAEOIU'  Test each char in S for membership in 'aeiouAEOIU'
  +/@                 Sum those values
2|                    Take it modulo 2 and return
</code>```

Title: Is it an Odd Word?

Body:
Challenge

Given a single word as input, determine if the word is odd or even.

Odd and Even words

Assume the general rules:

```<code>odd + odd = even
even + odd = odd
odd + even = odd
even + even = even
</code>```

In the alphabet, the odd letters are:

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

And the even letters are:

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

The same applies to capital letters (AEIOU are odd and BCDFGHJKLMNPQRSTVWXYZ are even).

You then 'add' each of the letters in the word together. For example, the word cats is equivalent to:

```<code>even + odd + even + even
</code>```

Which simplifies to:

```<code>odd + even
</code>```

Which simplifies further to:

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

So the word cats is odd.

Examples

```<code>Input:  trees
Output: even
</code>```

```<code>Input:  brush
Output: odd
</code>```

```<code>Input:  CAts
Output: odd
</code>```

```<code>Input:  Savoie
Output: even
</code>```

```<code>Input:  rhythm
Output: even
</code>```

Rules

All input will be a single word which will only contain alphabetical characters.

If the word is odd, output a truthy value. If the word is even, output a falsey value.

Winning

The shortest code in bytes wins.

Body:
J, 20 bytes

2|+/@e.&'aeiouAEOIU'

Straight-forward approach

Explanation

2|+/@e.&'aeiouAEOIU'  Input: string S
     e.&'aeiouAEOIU'  Test each char in S for membership in 'aeiouAEOIU'
  +/@                 Sum those values
2|                    Take it modulo 2 and return


答:
Ruby, 26 bytes

```<code>->w,a{a.map{|n|w.shift n}}
</code>```

Strings are represented as arrays of characters.

Title: Substring Chainification

Body:
Ruby, 26 bytes

->w,a{a.map{|n|w.shift n}}

Strings are represented as arrays of characters.