答:
Perl, 28 bytes

Includes +1 for -n

Run with the input string on STDIN followed by each number on a separate line:

```<code>(echo "Hello, World!"; echo 3; echo 2; echo 3) | perl -nE 'say for/(??{"."x<>||"^"})/g'
</code>```

Just the code:

```<code>say for/(??{"."x<>||"^"})/g
</code>```

The 23 bytes version without ||"^" also sort of works, but prints spurious trailing newlines

"^" can be replaced by $_ if the string does not contain regex meta characters

Title: Substring Chainification

Body:
Perl, 28 bytes

Includes +1 for -n

Run with the input string on STDIN followed by each number on a separate line:

(echo "Hello, World!"; echo 3; echo 2; echo 3) | perl -nE 'say for/(??{"."x<>||"^"})/g'

Just the code:

say for/(??{"."x<>||"^"})/g

The 23 bytes version without ||"^" also sort of works, but prints spurious trailing newlines

"^" can be replaced by $_ if the string does not contain regex meta characters


问:
Obfuscated FizzBuzz Golf
Create the shortest possible obfuscated FizzBuzz implementation.

To be considered obfuscated, it should satisfy at least one of the following:

Does not contain any of the words "Fizz", "Buzz", or "FizzBuzz"

Does not contain the numbers 3, 5, or 15.

Use any of the above in a misleading way.

Remember: The goal is to be short and hard to follow.

The code sample which inspired this question follows:

```<code>public class Default
{
        enum FizzBuzz
        {
            Buzz = 1,
            Fizz,
            FizzBuzz
        }
        public static void Main(string[] args)
        {
            byte[] foo =
              Convert.FromBase64String("IAmGMEiCIQySYAiDJBjCIAmGMEiCIQySYA==");
            MemoryStream ms = new MemoryStream(foo);
            byte[] myByte = new byte[1];
            do
            {
                FizzBuzz fb;
                ms.Read(myByte, 0, 1);
                for (int i = 0; i < 4; i++)
                {
                    fb = (FizzBuzz)(myByte[0] >> (2 * i)
                         & (int)FizzBuzz.FizzBuzz);
                    Console.Out.WriteLine( (((int)fb > 0) ? "" + fb : ""
                         + ((ms.Position - 1) * 4 + i + 1)));
                }
            } while (ms.Position < ms.Length);
        }
}
</code>```

答:
JavaScript - 166 chars

Here's another JavaScript solution which uses an encoded for loop body to hide 3, 5, Fizz, and Buzz. It's relatively terse, but you can still kind of see what's going on.

for(i=0;++i<101;)console.log(eval(String.fromCharCode(...'286925333f27273a2746697a7a27292b286925353f27273a2742757a7a27297c7c69'.match(/../g).map(n=>parseInt(n,16)))))```
</div>
</div>
</p>

<p>For something a bit more interesting, we can encode <em>all</em> the programming logic in zero-width whitespace characters and have something that <em>looks</em> concise but is actually not at all. This is similar to dzuc's Ruby solution.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>eval(''.split('').map(=>String.fromCharCode(.length)).join('')) </code>```

Personally, I like playing with fire.

Function('ಠ_ಠ',''.split('').map(ಠ_ಠ=>String.fromCharCode(ಠ_ಠ.length)).join(''))(100)```

ContentLicense: CC BY-SA 2.5

Title: Obfuscated FizzBuzz Golf

Body:
JavaScript - 166 chars

Here's another JavaScript solution which uses an encoded for loop body to hide 3, 5, Fizz, and Buzz. It's relatively terse, but you can still kind of see what's going on.

for(i=0;++i<101;)console.log(eval(String.fromCharCode(...'286925333f27273a2746697a7a27292b286925353f27273a2742757a7a27297c7c69'.match(/../g).map(n=>parseInt(n,16)))))

For something a bit more interesting, we can encode all the programming logic in zero-width whitespace characters and have something that looks concise but is actually not at all. This is similar to dzuc's Ruby solution.

eval(''.split('').map(=>String.fromCharCode(.length)).join(''))

Personally, I like playing with fire.

Function('ಠ_ಠ',''.split('').map(ಠ_ಠ=>String.fromCharCode(ಠ_ಠ.length)).join(''))(100)

ContentLicense: CC BY-SA 3.0


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

答:
Jelly, 6 bytes

```<code>Jx$ĠịY
</code>```

Try it online!

```<code>        The implicit working value is the first argument.
Jx$     Given a list L, repeat (x) an element of [1..len(n)] (J)
        as many times as the corresponding value in L.
   Ġ    Group indices by values. This turns [1, 1, 1, 2, 2, 3, 3]
        into [[1, 2, 3], [4, 5], [6, 7]].
    ị   Index into the second argument.
     Y  Join by newlines.
</code>```

Title: Substring Chainification

Body:
Jelly, 6 bytes

Jx$ĠịY

Try it online!

        The implicit working value is the first argument.
Jx$     Given a list L, repeat (x) an element of [1..len(n)] (J)
        as many times as the corresponding value in L.
   Ġ    Group indices by values. This turns [1, 1, 1, 2, 2, 3, 3]
        into [[1, 2, 3], [4, 5], [6, 7]].
    ị   Index into the second argument.
     Y  Join by newlines.


问:
Just repeat yourself
Write a program that outputs

```<code>Do not repeat yourself!
</code>```

Your program code must respect the following constraints :

its length must be an even number

each character that is in position 2n (where n is an integer > 0) must be equal to the character in position 2n-1. The second character of the program is equal to the first, the fourth is equal to the third, etc.

Newlines count as characters!

This is code-golf, so the shortest code wins!

Examples

HHeellllooWWoorrlldd is a valid program

123 or AAABBB or HHeello are incorrect

Verification

You can use this CJam script to verify that your source code is valid. Simply paste your code into the "Input" box and run the script.

答:
Befunge 98, 70 66 bytes

Try it online!

After my invalid answer, here's a better one that actually fits the challenge!

```<code>2200**xx""!!fflleessrruuooyy  ttaaeeppeerr  ttoonn  ooDD��""kk,,@@
</code>```

(Thanks to Martin Ender for suggesting the use of ��, character 0x17, instead of 88ff++)

Explanation:

```<code>2200          Push 2, 2, 0, and 0 onto the stack
*             Multiply 0 and 0, yielding 0
*             Multiply 2 and 0, yielding 0
              The stack is now [2, 0]
x             Pop a vector off the stack and set the instruction pointer delta to that
              The instruction pointer is now skipping over every other character, since the delta is (2, 0)
"!f ... oD�" Push the string onto the stack, with the number 23 (number of characters in the string) at the top
k,            Pop characters off the stack and print them, 23 times
@             End the program
</code>```

Title: Just repeat yourself

Body:
Befunge 98, 70 66 bytes

Try it online!

After my invalid answer, here's a better one that actually fits the challenge!

2200**xx""!!fflleessrruuooyy  ttaaeeppeerr  ttoonn  ooDD��""kk,,@@

(Thanks to Martin Ender for suggesting the use of ��, character 0x17, instead of 88ff++)

Explanation:

2200          Push 2, 2, 0, and 0 onto the stack
*             Multiply 0 and 0, yielding 0
*             Multiply 2 and 0, yielding 0
              The stack is now [2, 0]
x             Pop a vector off the stack and set the instruction pointer delta to that
              The instruction pointer is now skipping over every other character, since the delta is (2, 0)
"!f ... oD�" Push the string onto the stack, with the number 23 (number of characters in the string) at the top
k,            Pop characters off the stack and print them, 23 times
@             End the program


问:
Are there any languages especially good at ASCII art?
I was wondering if there are any esoteric or golfing languages which specifically target text output and ASCII art?

For example, 05AB1E at least started by targeting base conversions. Are there any golfing languages targeting text output and text output art?

If so, do they have tip pages here, and are they in common use?

Note: I'm not looking for languages that are able to output ASCII art, but rather ones intentionally designed to be able to complete ascii-art challenges in a relatively short and concise way.

答:
Well, as a matter of fact, there is! One such language is one I have been working on for a while called V.

Under the hood, V is just vim, but all of the keystrokes are run automatically, and the contents of the vim buffer are printed to STDOUT when the program is over. This just makes running it more convenient.

Some history on the language. When I started using the vim text editor for code-golf, I discovered that it's actually pretty good at it, but has some annoying features that make it more difficult to compete it. For example, you can set up a "while loop" of sorts by doing

```<code>qq<foobar>@qq@q
</code>```

which will repeat <foobar> until an error happens. This has 7 bytes of boilerplate code. In V, this is shortened to ò<foobar>ò.

Some of the things that make V great for ASCII-art:

It is 2d by nature. One feature is that is has a "cursor" position, where most of the commands do something based on where the cursor is in the text. The other commands move the location of the cursor. For example, x deletes a single character, but Wx moves forward a word and then deletes a character. Since most other languages are not intentionally 2 dimensional, this offers a nice edge when the challenge is about positioning text in 2D space

It is entirely string based. You can use some mathy operations, but these are usually the longer way to achieve things.

It uses regex compression to quickly change text.

All of it's internal memory, which is just a 2d array of characters, is implicitly printed when the program ends. Additionally, all inputs is implicitly added into it's internal memory, which is nice when most of the challenge is about changing the input in a certain way.

So I really enjoy using this language, and if you are looking for a specifically ascii-art language, I highly recommend it. However, I would also give a few disclaimers.

It is very confusing to learn. It's also very powerful, but because it's based on a very popular text editor that is 30 years old, there are lot's of obscure features that could very easily confuse new users.

Even though it is better at handling numbers than vim, it's number support is still not great. Personally, I think this makes it more fun to work in (kind of like using retina for tasks regex was never intended for). :D

It is still a WIP. There are some bugs, and some things I haven't gotten around to adding yet.

It doesn't have very many users. (Current number of users: 1).

If you are interested in learning more, here are some good resources:

A chat room where I would be happy to answer any questions you have, and help explain how it works to you.

A tips thread for golfing in vim, but most of the tips carry over.

A meta post describing V in some more detail.

Body:
Well, as a matter of fact, there is! One such language is one I have been working on for a while called V.

Under the hood, V is just vim, but all of the keystrokes are run automatically, and the contents of the vim buffer are printed to STDOUT when the program is over. This just makes running it more convenient.

Some history on the language. When I started using the vim text editor for code-golf, I discovered that it's actually pretty good at it, but has some annoying features that make it more difficult to compete it. For example, you can set up a "while loop" of sorts by doing

qq<foobar>@qq@q

which will repeat <foobar> until an error happens. This has 7 bytes of boilerplate code. In V, this is shortened to ò<foobar>ò.

Some of the things that make V great for ASCII-art:

It is 2d by nature. One feature is that is has a "cursor" position, where most of the commands do something based on where the cursor is in the text. The other commands move the location of the cursor. For example, x deletes a single character, but Wx moves forward a word and then deletes a character. Since most other languages are not intentionally 2 dimensional, this offers a nice edge when the challenge is about positioning text in 2D space

It is entirely string based. You can use some mathy operations, but these are usually the longer way to achieve things.

It uses regex compression to quickly change text.

All of it's internal memory, which is just a 2d array of characters, is implicitly printed when the program ends. Additionally, all inputs is implicitly added into it's internal memory, which is nice when most of the challenge is about changing the input in a certain way.

So I really enjoy using this language, and if you are looking for a specifically ascii-art language, I highly recommend it. However, I would also give a few disclaimers.

It is very confusing to learn. It's also very powerful, but because it's based on a very popular text editor that is 30 years old, there are lot's of obscure features that could very easily confuse new users.

Even though it is better at handling numbers than vim, it's number support is still not great. Personally, I think this makes it more fun to work in (kind of like using retina for tasks regex was never intended for). :D

It is still a WIP. There are some bugs, and some things I haven't gotten around to adding yet.

It doesn't have very many users. (Current number of users: 1).

If you are interested in learning more, here are some good resources:

A chat room where I would be happy to answer any questions you have, and help explain how it works to you.

A tips thread for golfing in vim, but most of the tips carry over.

A meta post describing V in some more detail.


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

答:
C# <s>64</s> <s>62</s> <s>56</S> 50 Bytes

```<code>s=>1>s.Split("aeiouAEIOU".ToCharArray()).Length%2;
</code>```

<s>We are already using linq, so Contains saves 2 bytes over IndexOf</s>

<s>Using the method overload of Count saves 6 bytes</s>

Thanks to @Milk for suggesting a neat method and saving 6 more bytes

An anonymous function that takes a string and counts the odd letters then returns true if there is an odd number of them or false if there is not.

This new solution splits the string on any of the characters in the given char array. The mechanics of this flip the meaning of the %2 result; 0 is now odd and 1 even hence the 1>.

Try it online here!

Title: Is it an Odd Word?

Body:
C# <s>64</s> <s>62</s> <s>56</S> 50 Bytes

s=>1>s.Split("aeiouAEIOU".ToCharArray()).Length%2;

<s>We are already using linq, so Contains saves 2 bytes over IndexOf</s>

<s>Using the method overload of Count saves 6 bytes</s>

Thanks to @Milk for suggesting a neat method and saving 6 more bytes

An anonymous function that takes a string and counts the odd letters then returns true if there is an odd number of them or false if there is not.

This new solution splits the string on any of the characters in the given char array. The mechanics of this flip the meaning of the %2 result; 0 is now odd and 1 even hence the 1>.

Try it online here!


答:
Java, 73

```<code>boolean f(String s){return s.replaceAll("(?i)[^aeiou]","").length()%2>0;}
</code>```

saw a couple other java answers, otherwise wouldn't have shared. Thanks to Phaeze for saving a byte.

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:
Java, 73

boolean f(String s){return s.replaceAll("(?i)[^aeiou]","").length()%2>0;}

saw a couple other java answers, otherwise wouldn't have shared. Thanks to Phaeze for saving a byte.


问:
Compute the Carmichael function

Task description

In number theory, the Carmichael function λ takes a positive integer n and returns the least positive integer k so that the k-th power of each integer coprime to n equals 1 modulo n.

Given a positive integer n, your solution must compute λ(n). The shortest code in bytes wins.

Your program should theoretically work for arbitrarily large inputs, but doesn’t need to be efficient.

Tips

The sequence of all λ(n) is OEIS A002322.

An ungolfed Python implementation would look like

```<code>from fractions import gcd

def carmichael(n):
    coprimes = [x for x in range(1, n) if gcd(x, n) == 1]
    k = 1
    while not all(pow(x, k, n) == 1 for x in coprimes):
        k += 1
    return k
</code>```

(In Python, pow(A, B, C) efficiently computes pow(A, B) % C.)

Test cases

```<code>Input    Output
1        1
2        1
3        2
10       4
35       12
101      100
530      52
3010     84
6511     3056
10000    500
</code>```

答:
Java, 209 207 202 194 192 bytes

Code (96 bytes):

```<code>n->{for(int x,k=1,a;;k++){for(a=1,x=0;++x<=n&&a<2;)a=g(x,n)<2?p(x,k,n):1;if(a<2||n<2)return k;}}
</code>```

extra functions (96 bytes):

```<code>int g(int a,int b){return b<1?a:g(b,a%b);}int p(int n,int p,int m){return p<2?n:n*p(n,p-1,m)%m;}
</code>```

Testing & ungolfed

```<code>import java.util.Arrays;
import java.util.function.IntUnaryOperator;

public class Main2 {

  static int g(int a,int b) { // recursive gcd
    return b < 1
        ? a
        : g(b,a%b);
  }

  static int p(int n, int p, int m) { // recursive modpow
    return p < 2
      ? n
      : n * p(n, p - 1, m) % m;
  }

  public static void main(String[] args) {

    IntUnaryOperator f = n -> {
      for(int x,k=1,a;;k++) { // for each k
        for(a=1,x=0;++x<=n&&a<2;) // for each x
          a=g(x,n)<2?p(x,k,n):1; // compute modpow(x,k,n) if g(x,n)
        if(a<2||n<2) // if all modpow(x,k,n)=1. Also check for weird result for n=1.
          return k;
      }
    };

    Arrays.stream(new int[]{1, 2, 3, 10, 35, 101, 530, 3010, 6511, 10000})
        .map(f)
        .forEach(System.out::println);
  }
}
</code>```

Notes

the use of a being an int is shorter than if I had to use a boolean to perform my tests.

Yes, it's shorter to valueOf all new BigInteger than create a separate function (there are 5, plus the ONE constant is a freebie).

Algorithm is different than @Master_ex' algorithm, so it's not just a golfed repost. Also, this algorithm is much less efficient as gcd is computed again and again for the same values.

Shaves

209 -> 207 bytes:

if(...)a=...; -> a=...?...:1;

a==1 -> a<2

207 -> 202 bytes

Got rid of BigInteger by golfing gcd and modPow for int.

202 -> 194 bytes

looping modPow -> recursive

194 -> 192 bytes

==1 -> <2 (seems to work for all the test cases, don't know for other numbers.)

Title: Compute the Carmichael function

Body:
Java, 209 207 202 194 192 bytes

Code (96 bytes):

n->{for(int x,k=1,a;;k++){for(a=1,x=0;++x<=n&&a<2;)a=g(x,n)<2?p(x,k,n):1;if(a<2||n<2)return k;}}

extra functions (96 bytes):

int g(int a,int b){return b<1?a:g(b,a%b);}int p(int n,int p,int m){return p<2?n:n*p(n,p-1,m)%m;}

Testing & ungolfed

import java.util.Arrays;
import java.util.function.IntUnaryOperator;

public class Main2 {

  static int g(int a,int b) { // recursive gcd
    return b < 1
        ? a
        : g(b,a%b);
  }

  static int p(int n, int p, int m) { // recursive modpow
    return p < 2
      ? n
      : n * p(n, p - 1, m) % m;
  }

  public static void main(String[] args) {

    IntUnaryOperator f = n -> {
      for(int x,k=1,a;;k++) { // for each k
        for(a=1,x=0;++x<=n&&a<2;) // for each x
          a=g(x,n)<2?p(x,k,n):1; // compute modpow(x,k,n) if g(x,n)
        if(a<2||n<2) // if all modpow(x,k,n)=1. Also check for weird result for n=1.
          return k;
      }
    };

    Arrays.stream(new int[]{1, 2, 3, 10, 35, 101, 530, 3010, 6511, 10000})
        .map(f)
        .forEach(System.out::println);
  }
}

Notes

the use of a being an int is shorter than if I had to use a boolean to perform my tests.

Yes, it's shorter to valueOf all new BigInteger than create a separate function (there are 5, plus the ONE constant is a freebie).

Algorithm is different than @Master_ex' algorithm, so it's not just a golfed repost. Also, this algorithm is much less efficient as gcd is computed again and again for the same values.

Shaves

209 -> 207 bytes:

if(...)a=...; -> a=...?...:1;

a==1 -> a<2

207 -> 202 bytes

Got rid of BigInteger by golfing gcd and modPow for int.

202 -> 194 bytes

looping modPow -> recursive

194 -> 192 bytes

==1 -> <2 (seems to work for all the test cases, don't know for other numbers.)


答:
Python 2, 42 bytes

s,a=input()
for n in a:print s[:n];s=s[n:]
```

Sometimes you just do it the boring way.

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 2, 42 bytes

s,a=input()
for n in a:print s[:n];s=s[n:]

Sometimes you just do it the boring way.


Title: Substring Chainification

Body:
C 474 byte

char**f(char*a,int*b){int  i,j;static char *t[99];for(j=0;j<99;++j)t[j]=0;t[0]=a;for(i=0,j=1;j<99&&a[i]&&b[j-1];++i)if(i>=b[j-1]){t[j++]=a+i;i=0;a=t[j-1];}t[j]=a+i;return j>=99?0:t;}void showResult(char**p, int*b){char *v;int i,j;if(p==0) {printf("NULL"); return;}printf("\'%s\' [", p[0]);for(i=0;b[i];++i)printf("%d%s", b[i], b[i+1]?", ":"");printf("]==[");for(i=0;b[i];++i){printf("\'");for(v=p[i]; v<p[i+1];++v)putchar(*v);printf("\'%s", b[i+1]?", ": "");}printf("]\n");}

main

main()
{char *test[]={"Hello, World", "abcdefghijk", "Code Golf",
               "Ayyy","lexicographically",0}, **p;
 int  v[80];

 v[0]=3;v[1]=2;v[2]=3;v[3]=0;showResult(f(test[0], v), v);
 v[0]=2;v[1]=1;v[2]=3;v[3]=0;showResult(f(test[1], v), v);
 v[0]=4;v[1]=1;v[2]=0;       showResult(f(test[2], v), v);
 v[0]=3;v[1]=0;              showResult(f(test[3], v), v);
 v[0]=2;v[1]=2;v[2]=2;v[3]=7; v[4]=4; v[5]=0;
                         showResult(f(test[4], v), v);
}
/*
 474
 'Hello, World' [3, 2, 3]==['Hel', 'lo', ', W']
 'abcdefghijk' [2, 1, 3]==['ab', 'c', 'def']
 'Code Golf' [4, 1]==['Code', ' ']
 'Ayyy' [3]==['Ayy']
 'lexicographically' [2, 2, 2, 7, 4]==['le', 'xi', 'co', 'graphic', 'ally']
*/


答:
Batch, 132 bytes

```<code>@echo off
set/ps=
set s=%s%%s:a=%%s:e=%%s:i=%%s:o=%%s:u=%
:l
if "%s%"=="" exit/b0
if "%s:~1%"=="" exit/b1
set s=%s:~2%
goto l
</code>```

Takes input on STDIN, exits with ERRORLEVEL equal to 1 if the word is odd, 0 if it is even. Works by multiplying all the vowels by five and other letters by six, then calculating the parity of the resulting length.

Title: Is it an Odd Word?

Body:
Batch, 132 bytes

@echo off
set/ps=
set s=%s%%s:a=%%s:e=%%s:i=%%s:o=%%s:u=%
:l
if "%s%"=="" exit/b0
if "%s:~1%"=="" exit/b1
set s=%s:~2%
goto l

Takes input on STDIN, exits with ERRORLEVEL equal to 1 if the word is odd, 0 if it is even. Works by multiplying all the vowels by five and other letters by six, then calculating the parity of the resulting length.


答:
Mathematica 152

Still has some format issues. Spaces added for clarity

```<code>Flatten@{#[[5]], {Looplab, Sevit, Hexteria,  Sinpad}[[#[[4, 2]] + 1]],
        N[#[[3, 2]] + #[[2, 2]]/864, 4]} &@
               FoldList[QuotientRemainder[#1[[1]], #2] &, {#, 0}, {864, 100, 4, 91}]&
</code>```

Title: Gregorian to Noxu Time System Conversion

Body:
The world's changing to a new time system!  We need to update our computer programs.  Given an input of epoch time (number of seconds since January 1st, 1970 00:00), print out a time in the new Noxu date-time format.

864 seconds make one Fluffster.  100 Fluffsters make a Skizzle.  There are 4 Skizzles in one Zestpond.  Their names are Looplab, Sevit, Hexteria, and Sinpad.  There are 91 Zestponds in one Lulerain.

The format is Lulerain Zestpond-Skizzle-Fluffster.  Fluffsters are rounded to two decimal places.  An example would be 50 13-Sevit-40.90.

Given that epoch 0 was 0 0-Looplab-00.00, create a program that takes input either via stdin or as a command line argument of any epoch time between 0 and 2^32, and prints out the Noxu equivalent.

Time of edit:

```<code>1357510372 -> 43 14-Sinpad-92.56
</code>```

Random test data:

```<code>675416077 -> 21 43-Sevit-31.57
330585453 -> 10 46-Hexteria-22.05
1328127085 -> 42 20-Sinpad-84.13
837779784 -> 26 58-Looplab-52.53
1240280676 -> 39 39-Sinpad-10.04
122646385 -> 3 81-Sinpad-51.83
1311245658 -> 41 63-Looplab-45.44
57792972 -> 1 76-Looplab-90.01
788388068 -> 25 6-Looplab-86.19
304341865 -> 9 61-Hexteria-47.53
417857784 -> 13 26-Looplab-31.69
671276878 -> 21 31-Sevit-40.83
1259758896 -> 40 5-Looplab-54.28
604286664 -> 19 19-Hexteria-5.86
646395018 -> 20 50-Sevit-42.38
563025133 -> 17 82-Looplab-49.46
96133144 -> 3 5-Looplab-65.21
101542552 -> 3 20-Sinpad-26.10
1006825856 -> 32 1-Sevit-7.70
928867348 -> 29 48-Hexteria-77.95
1235022079 -> 39 24-Hexteria-23.70
439505287 -> 13 88-Hexteria-86.67
99686711 -> 3 15-Sevit-78.14
379859609 -> 12 7-Looplab-52.33
1167091685 -> 37 10-Looplab-0.56
612032437 -> 19 41-Sinpad-70.88
503040778 -> 15 90-Hexteria-23.12
1084809411 -> 34 44-Sinpad-66.45
1105664386 -> 35 14-Sevit-4.15
197303893 -> 6 24-Sinpad-60.99
368559287 -> 11 65-Sevit-73.25
686824300 -> 21 76-Sevit-35.53
196468204 -> 6 22-Sevit-93.75
673542185 -> 21 37-Sinpad-62.71
993063782 -> 31 52-Sevit-79.38
270951743 -> 8 56-Looplab-1.55
1074506753 -> 34 15-Looplab-42.08
198143696 -> 6 27-Sevit-32.98
539601298 -> 17 14-Sevit-38.54
110090607 -> 3 45-Hexteria-19.68
276492708 -> 8 72-Looplab-14.71
113389138 -> 3 55-Looplab-37.43
571578220 -> 18 15-Sinpad-48.87
1238516450 -> 39 34-Hexteria-68.11
742293312 -> 23 54-Sinpad-35.78
1031929490 -> 32 73-Sinpad-62.84
503091914 -> 15 90-Hexteria-82.31
264094386 -> 8 36-Looplab-64.80
483820698 -> 15 34-Sinpad-77.66
548410387 -> 17 39-Sinpad-34.24
</code>```

Body:
Mathematica 152

Still has some format issues. Spaces added for clarity

Flatten@{#[[5]], {Looplab, Sevit, Hexteria,  Sinpad}[[#[[4, 2]] + 1]],
        N[#[[3, 2]] + #[[2, 2]]/864, 4]} &@
               FoldList[QuotientRemainder[#1[[1]], #2] &, {#, 0}, {864, 100, 4, 91}]&


问:
Prime factors buddies
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.

答:
PHP 486 bytes

could probably be shorter with an algorithm that´s not so by the book.

(but I like the current byte count)

```<code>function p($n){for($i=1;$i++<$n;)if($n%$i<1&&($n-$i?p($i)==$i:!$r))for($x=$n;$x%$i<1;$x/=$i)$r.=$i;return $r;}function e($s){if(!$n=strlen($s))yield$s;else foreach(e(substr($s,1))as$p)for($i=$n;$i--;)yield substr($p,0,$i).$s[0].substr($p,$i);}foreach(e(p($n=$argv[1]))as$p)for($m=1<<strlen($p)-1;$m--;){$q="";foreach(str_split($p)as$i=>$c)$q.=$c.($m>>$i&1?"*":"");foreach(split("\*",$q)as$x)if(0===strpos($x,48)|p($x)!=$x)continue 2;eval("\$r[$q]=$q;");}unset($r[$n]);echo join(",",$r);
</code>```

breakdown

```<code>// find and concatenate prime factors
function p($n)
{
    for($i=1;$i++<$n;)  // loop $i from 2 to $n
        if($n%$i<1      // if $n/$i has no remainder
            &&($n-$i    // and ...
                ?p($i)==$i  // $n!=$i: $i is a prime
                :!$r        // $n==$i: result so far is empty ($n is prime)
            )
        )
            for($x=$n;      // set $x to $n
                $x%$i<1;    // while $x/$i has no remainder
                $x/=$i)     // 2. divide $x by $i
                $r.=$i;     // 1. append $i to result
    return $r;
}

// create all permutations of digits
function e($s)
{
    if(!$n=strlen($s))yield$s;else  // if $s is empty, yield it, else:
    foreach(e(substr($s,1))as$p)    // for all permutations of the number w/o first digit
        for($i=$n;$i--;)            // run $i through all positions around the other digits
            // insert removed digit at that position and yield
            yield substr($p,0,$i).$s[0].substr($p,$i);
}

// for each permutation
foreach(e(p($n=$argv[1]))as$p)
    // create all products from these digits: binary loop through between the digits
    for($m=1<<strlen($p)-1;$m--;)
    {
        // and insert "*" for set bits
        $q="";
        foreach(str_split($p)as$i=>$c)$q.=$c.($m>>$i&1?"*":"");
        // test all numbers in the expression
        foreach(split("\*",$q)as$x)
            if(
                0===strpos($x,48)   // if number has a leading zero
                |p($x)!=$x          // or is not prime
            )continue 2; // try next $m
        // evaluate expression and add to results (use key to avoid array_unique)
        eval("\$r[$q]=$q;");
    }

// remove input from results
unset($r[$n]);

// output
#sort($r);
echo join(",",$r);
</code>```

Title: Prime factors buddies

Body:
PHP 486 bytes

could probably be shorter with an algorithm that´s not so by the book.

(but I like the current byte count)

function p($n){for($i=1;$i++<$n;)if($n%$i<1&&($n-$i?p($i)==$i:!$r))for($x=$n;$x%$i<1;$x/=$i)$r.=$i;return $r;}function e($s){if(!$n=strlen($s))yield$s;else foreach(e(substr($s,1))as$p)for($i=$n;$i--;)yield substr($p,0,$i).$s[0].substr($p,$i);}foreach(e(p($n=$argv[1]))as$p)for($m=1<<strlen($p)-1;$m--;){$q="";foreach(str_split($p)as$i=>$c)$q.=$c.($m>>$i&1?"*":"");foreach(split("\*",$q)as$x)if(0===strpos($x,48)|p($x)!=$x)continue 2;eval("\$r[$q]=$q;");}unset($r[$n]);echo join(",",$r);

breakdown

// find and concatenate prime factors
function p($n)
{
    for($i=1;$i++<$n;)  // loop $i from 2 to $n
        if($n%$i<1      // if $n/$i has no remainder
            &&($n-$i    // and ...
                ?p($i)==$i  // $n!=$i: $i is a prime
                :!$r        // $n==$i: result so far is empty ($n is prime)
            )
        )
            for($x=$n;      // set $x to $n
                $x%$i<1;    // while $x/$i has no remainder
                $x/=$i)     // 2. divide $x by $i
                $r.=$i;     // 1. append $i to result
    return $r;
}

// create all permutations of digits
function e($s)
{
    if(!$n=strlen($s))yield$s;else  // if $s is empty, yield it, else:
    foreach(e(substr($s,1))as$p)    // for all permutations of the number w/o first digit
        for($i=$n;$i--;)            // run $i through all positions around the other digits
            // insert removed digit at that position and yield
            yield substr($p,0,$i).$s[0].substr($p,$i);
}

// for each permutation
foreach(e(p($n=$argv[1]))as$p)
    // create all products from these digits: binary loop through between the digits
    for($m=1<<strlen($p)-1;$m--;)
    {
        // and insert "*" for set bits
        $q="";
        foreach(str_split($p)as$i=>$c)$q.=$c.($m>>$i&1?"*":"");
        // test all numbers in the expression
        foreach(split("\*",$q)as$x)
            if(
                0===strpos($x,48)   // if number has a leading zero
                |p($x)!=$x          // or is not prime
            )continue 2; // try next $m
        // evaluate expression and add to results (use key to avoid array_unique)
        eval("\$r[$q]=$q;");
    }

// remove input from results
unset($r[$n]);

// output
#sort($r);
echo join(",",$r);


答:
Japt, 7 bytes

```<code>1&Uè"%v
</code>```

Test it online! Outputs 1 for odd, 0 for even.

How it works

```<code>         // Implicit: U = input string
  Uè     // Count the number of matches of the following regex in the input:
    "%v  //   /[AEIOUaeiou]/g
1&       // Take only the first bit (convert 1, 3, 5, etc. to 1, and others to 0)
         // Implicit output
</code>```

Title: Is it an Odd Word?

Body:
Japt, 7 bytes

1&Uè"%v

Test it online! Outputs 1 for odd, 0 for even.

How it works

         // Implicit: U = input string
  Uè     // Count the number of matches of the following regex in the input:
    "%v  //   /[AEIOUaeiou]/g
1&       // Take only the first bit (convert 1, 3, 5, etc. to 1, and others to 0)
         // Implicit output


Title: Is it an Odd Word?

Body:
Brain-Flak, <s>524, 446</s>, 422 bytes

{(<((((()()()()){}){}){}<>)>)<>{({}[()])<>(({}[({})]())){{}(<({}({}))>)}{}<>}{}<>([(((({}<{}<>>))))]()){(<{}>)<>({}[()])<>}<>({}())<>{}([{}]()()()()()){(<{}>)<>({}[()])<>}<>({}())<>{}(((()()())){}{}[{}]){(<{}>)<>({}[()])<>}<>({}())<>{}(((()()()()())){}{}[{}]){(<{}>)<>({}[()])<>}<>({}())<>{}((((()()()){}())){}{}[{}]){(<{}>)<>({}[()])<>}<>({}())<>{}}(<(()())>)<>{({}[()])<>(({}[({})]())){{}(<({}({}))>)}{}<>}{}<>({}<{}<>>)

<a href="http://brain-flak.tryitonline.net/#code=eyg8KCgoKCgpKCkoKSgpKXt9KXt9KXt9PD4pPik8Pnsoe31bKCldKTw-KCh7fVsoe30pXSgpKSl7e30oPCh7fSh7fSkpPil9e308Pn17fTw-KFsoKCgoe308e308Pj4pKSkpXSgpKXsoPHt9Pik8Pih7fVsoKV0pPD59PD4oe30oKSk8Pnt9KFt7fV0oKSgpKCkoKSgpKXsoPHt9Pik8Pih7fVsoKV0pPD59PD4oe30oKSk8Pnt9KCgoKCkoKSgpKSl7fXt9W3t9XSl7KDx7fT4pPD4oe31bKCldKTw-fTw-KHt9KCkpPD57fSgoKCgpKCkoKSgpKCkpKXt9e31be31dKXsoPHt9Pik8Pih7fVsoKV0pPD59PD4oe30oKSk8Pnt9KCgoKCgpKCkoKSl7fSgpKSl7fXt9W3t9XSl7KDx7fT4pPD4oe31bKCldKTw-fTw-KHt9KCkpPD57fX0oPCgoKSgpKT4pPD57KHt9WygpXSk8Pigoe31bKHt9KV0oKSkpe3t9KDwoe30oe30pKT4pfXt9PD59e308Pih7fTx7fTw-Pik&input=SGFsbG8&args=LWE">Try it online!

Ungolfed, more readable version:

{((((()()()()){}){}){})(<({}<>)>)<>{({}[()])<>(({}()[({})])){{}(<({}({}))>)}{}<>}{}<>({}<{}><>)((((({})))))
(())
({}[{}]){(<{}>)<>({}[()])<>}<>({}())<>{}
(()()()()())
({}[{}]){(<{}>)<>({}[()])<>}<>({}())<>{}
(()()()()()()()()())
({}[{}]){(<{}>)<>({}[()])<>}<>({}())<>{}
(()()()()()()()()()()()()()()())
({}[{}]){(<{}>)<>({}[()])<>}<>({}())<>{}
(()()()()()()()()()()()()()()()()()()()()())
({}[{}])
{(<{}>)<>({}[()])<>}<>({}())<>{}}<>(()())(<({}<>)>)<>{({}[()])<>(({}()[({})])){{}(<({}({}))>)}{}<>}{}<>({}<{}><>){{}([()])
(<><>)}({}{}())


答:
Turtlèd, <s>91 65 64 52 47</s> 67 bytes

More bytes because now takes case insensitive input

Changed approach again

does * for even, else o for odd

(trailing space)

```<code>!-u[*+.(a,)(e,)(i,)(o,)(u,)(A,)(E,)(I,)(O,)(U,)(*d(*'ou)(o'*u))_]'
</code>```

It goes through input, writing it down on one square, each time there is a vowel, it moves down, flips the state of a the output cell, continues until EOF of input, then removes the cell where it writes down all the characters.

Title: Is it an Odd Word?

Body:
Turtlèd, <s>91 65 64 52 47</s> 67 bytes

More bytes because now takes case insensitive input

Changed approach again

does * for even, else o for odd

(trailing space)

!-u[*+.(a,)(e,)(i,)(o,)(u,)(A,)(E,)(I,)(O,)(U,)(*d(*'ou)(o'*u))_]'

It goes through input, writing it down on one square, each time there is a vowel, it moves down, flips the state of a the output cell, continues until EOF of input, then removes the cell where it writes down all the characters.


问:
A "cheating" quine
Long-time lurker, first-time poster. So here goes.

In the Wikipedia page for quine, it says that "a quine is considered to be 'cheating' if it looks at its own source code." Your task is to make one of these "cheating quines" that reads its own source code.

This is code-golf, so the shortest code in bytes - in each language - wins. This means that a 5-byte Pyth script would not beat a 21-byte Python script - but a 15-byte Python script would.

You must use file I/O to read the source code, so the following JavaScript code, taken from the official Wikipedia page, is invalid:

```<code>function a() {
    document.write(a, "a()");
}
a()
</code>```

It must access the source code of the file on disk.

You are not allowed to specify the file name. You must make it detect the filename itself.

Everyone clear? Go!

答:
Lua, 31 Bytes

```<code>print(io.open(arg[1]):read'*a')
</code>```

The Arg table contains the following in lua.

{Filename, Command Line Argument1, Command Line Argument 2, ...}

Title: A "cheating" quine

Body:
Lua, 31 Bytes

print(io.open(arg[1]):read'*a')

The Arg table contains the following in lua.

{Filename, Command Line Argument1, Command Line Argument 2, ...}


答:
Lua, <s>47</s> <s>44</s> 43 Bytes

```<code>print(#arg[2]:gsub('[^aeiouAEIOU]','')%2>0)
</code>```

Takes the input via the command line, replaces all non-vowels with nothing, (removes them), prints true if the length of that is odd, false otherwise.

Old submission

```<code>_,n=arg[2]:gsub('[aeiouAEIOU]','')print(n%2~=0)
</code>```

Title: Is it an Odd Word?

Body:
Lua, <s>47</s> <s>44</s> 43 Bytes

print(#arg[2]:gsub('[^aeiouAEIOU]','')%2>0)

Takes the input via the command line, replaces all non-vowels with nothing, (removes them), prints true if the length of that is odd, false otherwise.

Old submission

_,n=arg[2]:gsub('[aeiouAEIOU]','')print(n%2~=0)


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

答:
Jelly, <s>30</s> 26 bytes

```<code>Ḣị“+-“| ”ị@
1;+\Ṭ
Ç€,€/Ñ€Y
</code>```

Test it at TryItOnline

How?

The input taken is a list of the two lists, [vertical, horizontal], and uses the incremented option

- so example 3 takes [[3,2,1,1], [2,1,4,1,3,1]]

Each of these is then converted to a boolean array indicating the rowType or rowCharacterType respectively, e.g. [[1,0,0,1,0,1,1,1], [1,0,1,1,0,0,0,1,1,0,0,1,1]]

The boxes are then constructed by making the rows from the characters identified by the rowType and rowCharacterType combinations - i.e. a rowType identifies either "+-" or "| " and a rowCharacterType identifies one of those two characters.

```<code>Ḣị“+-“| ”ị@ - Link 1, create a row: [rowType, [rowCharaterTypes]]
Ḣ           - head - get the rowType
  “+-“| ”   - list of strings ["+-", "| "]
 ị          - index into (if rowType is 1 "+-"; if rowType is 0 "| ")
         ị@ - index into with reversed operands (index into that from rowCharaterTypes)
                (replace each 1 in rowCharaters with "+" or "|" and each 0 with "-" or " ")

1;+\Ṭ - Link 2, create the Type lists from the inputs: int[] nCharacters
1;    - 1 concatenated with the input
  +\  - reduce with addition (accumulation provides the indices)
    Ṭ - boolean array with 1s at those indices
            As an example take the vertical of example 3:
            [3,2,1,1] -> [1,3,2,1,1] -> [1,4,6,7,8] -> [1,0,0,1,0,1,1,1]
            each of which will be passed as a rowType for Link 1

Ç€,€/Ñ€Y - Main link, takes one argument: [Vertical, Horizontal] (incremented option)
Ç€       - call the last link (2) for each of the two lists in the input
  ,€/    - pair each and reduce (making a list of [rowtype [rowCharacterTypes]])
     Ñ€  - call the next link (1) for each
       Y - join on line feeds
</code>```

Title: Draw some ASCII-boxes

Body:
Jelly, <s>30</s> 26 bytes

Ḣị“+-“| ”ị@
1;+\Ṭ
Ç€,€/Ñ€Y

Test it at TryItOnline

How?

The input taken is a list of the two lists, [vertical, horizontal], and uses the incremented option

- so example 3 takes [[3,2,1,1], [2,1,4,1,3,1]]

Each of these is then converted to a boolean array indicating the rowType or rowCharacterType respectively, e.g. [[1,0,0,1,0,1,1,1], [1,0,1,1,0,0,0,1,1,0,0,1,1]]

The boxes are then constructed by making the rows from the characters identified by the rowType and rowCharacterType combinations - i.e. a rowType identifies either "+-" or "| " and a rowCharacterType identifies one of those two characters.

Ḣị“+-“| ”ị@ - Link 1, create a row: [rowType, [rowCharaterTypes]]
Ḣ           - head - get the rowType
  “+-“| ”   - list of strings ["+-", "| "]
 ị          - index into (if rowType is 1 "+-"; if rowType is 0 "| ")
         ị@ - index into with reversed operands (index into that from rowCharaterTypes)
                (replace each 1 in rowCharaters with "+" or "|" and each 0 with "-" or " ")

1;+\Ṭ - Link 2, create the Type lists from the inputs: int[] nCharacters
1;    - 1 concatenated with the input
  +\  - reduce with addition (accumulation provides the indices)
    Ṭ - boolean array with 1s at those indices
            As an example take the vertical of example 3:
            [3,2,1,1] -> [1,3,2,1,1] -> [1,4,6,7,8] -> [1,0,0,1,0,1,1,1]
            each of which will be passed as a rowType for Link 1

Ç€,€/Ñ€Y - Main link, takes one argument: [Vertical, Horizontal] (incremented option)
Ç€       - call the last link (2) for each of the two lists in the input
  ,€/    - pair each and reduce (making a list of [rowtype [rowCharacterTypes]])
     Ñ€  - call the next link (1) for each
       Y - join on line feeds


Body:
Python, 123

x=input()
b=86400
c=b*4
d=c*91
print x/d,'%d-%s-%.2f'%(x%d/c,['Looplab','Sevit','Hexteria','Sinpad'][x%d%c/b],x%d%c%b/864.)


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:
Brain-Flak <s>206</s> <s>196</s> <s>192</s> 178 + 3 = 181 bytes

Try it Online!

([]<{({}[((((((()()())){}){}){}){}){}()]){({}[({}())]){({}[({})]){({}[({}()())]){({}[({})]){({}<>)(<>)}}}}}{}{}}><>[[]]<>()()){(({}[<>(())<>()()])){{}({}())((<>)<>)}{}}{}<>({}<>)

This requires the -c flag to run in ASCII mode adding an extra 3 bytes to the length of the program.

Ungolfed

([]<
{({}[(((((()()()){}){}){}){}){}()])
 {
  ({}[()()()()])
  {
   ({}[()()()()])
   {
    ({}[(()()()){}])
    {
     ({}[(()()()){}])
     {
      ({}<>)
      (<>)
     }
    }
   }
  }
 }
 {}
}
><>[[]]<>)
(<(()()<>)>)<>{({}[()])<>(({}()[({})])){{}(<({}({}))>)}{}<>}{}<>({}<{}><>)

Explanation

First store the stack height for future purposes

([]<...>

Then while the stack is not empty (assumes that none of the characters is zero)

{...}

Subtract ninety seven (and store 3 for later optimizations)

({}[((((((()()())){}){}){}){}){}()])

If it is not zero (i.e. not a)

{...}

Subtract 4 (and store 4 for later optimizations)

({}[({}())])

If it is not zero (i.e. not e)

{...}

Subtract 4 (and store 4 for later optimizations)

({}[({})])

If it is not zero (i.e. not i)

{...}

Subtract 6 (and store 6 for later optimizations)

({}[({}()())])

If it is not zero (i.e. not o)

{...}

Subtract 6 (store 6 because the program expects one later)

({}[({})])

If it is not zero (i.e. not u)

{...}

Move the remainder to the other stack and put a zero on the active stack to escape all of the ifs

({}<>)(<>)

Once all of the ifs have been escaped remove the zero and the six

{}{}

Once all the characters have been processed subtract the height of the offset from the originally stored height.

...<>[[]]<>)

Mod by two

{(({}[<>(())<>()()])){{}({}())((<>)<>)}{}}{}<>({}<>)


答:
Python, 41 bytes

lambda s:sum(map(s.count,"aeiouAEIOU"))%2
```

Title: Is it an Odd Word?


问:
Create output twice the length of the code

The Challenge

Write a complete program that writes twice as many bytes to standard output as the length of the program.

Rules

The program must write ASCII characters to the standard output.

The contents of the output doesn't matter.

The output, measured in bytes, must be exactly twice the length of the program, also measured in bytes, unless you fulfill the bonus.

Any trailing newline is included in the output's byte count.

Bonus

Your program can optionally take a number, n, as input. If so, the output must be exactly n * program length bytes. You can assume that n will always be a positive integer. If no input is provided, n must default to 2.

If you do this,  you can subtract 25 bytes from your score.

Shortest program wins.

Restrictions

No standard loopholes.

The program must be at least 1 byte long.

No adding unnecessary whitespace to the source code to change its length. Similarly, comments don't count.

Unless you fulfill the bonus, the program must accept no input. If you do fulfill the bonus, the integer must be the only input.

Lowest score (program length in bytes - bonus) wins.

The shortest answer for each language wins for that language.

Leaderboards

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by 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=59436,OVERRIDE_USER=41505;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

```

答:
Cubix, 10 bytes

Cubix is a 2D esolang with a twist: the source code is wrapped around the outside of a cube.

```<code>>..(NU@?O/
</code>```

Test it online! This maps to the following cube:

```<code>    > .
    . (
N U @ ? O / . .
. . . . . . . .
    . .
    . .
</code>```

The output is

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

Don't even ask how it works... though if you'd like to watch it in action, run it here.

Body:
Cubix, 10 bytes

Cubix is a 2D esolang with a twist: the source code is wrapped around the outside of a cube.

>..(NU@?O/

Test it online! This maps to the following cube:

    > .
    . (
N U @ ? O / . .
. . . . . . . .
    . .
    . .

The output is

10998877665544332211

Don't even ask how it works... though if you'd like to watch it in action, run it here.


问:
Hate/love conundrum

Challenge description

In this challenge, we only consider love and hate as feelings. If we want to utter a feeling expression of order N, we alternate between these two (starting with hate):

```<code>order | expression

1       I hate it.
2       I hate that I love it.
3       I hate that I love that I hate it.
4       I hate that I love that I hate that I love it.
</code>```

The pattern follows for every positive integer N. Given N, output the correspoinding feeling expression of order N.

Notes

Full stop (.) at the end of the expression is mandatory,

Trailing and leading whitespaces (including newlines) are permitted,

Output for a non-positive or non-integer N is undefined,

This is a code-golf challenge, so make your code as short as possible!

答:
///, 68 bytes

```<code>/@/1\/#love //%/hate//#/that I //%1i/% i//I %1/I % //1@#% //@/I %1it.
</code>```

Input in unary - add more 1s in the last section.

Try it online!

Title: Hate/love conundrum

Body:
///, 68 bytes

/@/1\/#love //%/hate//#/that I //%1i/% i//I %1/I % //1@#% //@/I %1it.

Input in unary - add more 1s in the last section.

Try it online!


答:
I recently made a new programming language, called Turtlèd, which operates on a grid of characters with a turtle, which moves around the grid, writes to the grid, and has control flow with the grid. The grid is implicitly printed at the end. By this fact that it does not have to write spaces, and that it can write the text spatially, rather than left to right, up to down, it probably makes it meet the definition given, being good at ascii art.

Currently, there are not any docs, so you probably will not be able to use it, unless you want to read my interpreter, which is probably not something you want to do. I think there may also be bugs in the interpreter, but the spec is not developed enough to say if it is a bug. Turtlèd will probably be finished soon, with docs and all, though

Title: Are there any languages especially good at ASCII art?

Body:
I was wondering if there are any esoteric or golfing languages which specifically target text output and ASCII art?

For example, 05AB1E at least started by targeting base conversions. Are there any golfing languages targeting text output and text output art?

If so, do they have tip pages here, and are they in common use?

Note: I'm not looking for languages that are able to output ASCII art, but rather ones intentionally designed to be able to complete ascii-art challenges in a relatively short and concise way.


问:
Close-Knit Words

Introduction

According to Rand Al'Thor's post in the Puzzling SE, a close-knit word is any word that contains three alphabetically consecutive letters (in any order).

Words like education, foghorn and cabaret are all considered close-knit words whereas words like learning, klaxon and perform are not close-knit words.

Challenge

The challenge is to code-golf a program capable of taking a single word as input (assumed lower case, for all intents and purposes) and to return output that (if available) lists all consecutive letter sets (also in lower case) if it is a close-knit word, and empty output if it is not a close-knit word.

Examples

```<code>Input: education
Output: cde

Input: foghorn
Output: fgh

Input: cabaret
Output: abc

Input: hijacking
Output: ghi, hij, ijk

Input: pneumonia
Output: mno, nop

Input: klaxon
Output: <<no output>>

Input: perform
Output: <<no output>>

Input: learning
Output: <<no output>>
</code>```

Rules

Whereas input is to be assumed to be a single lower-case word and output must be lower-case, the nature of the output will vary according to the choice of your coding language. Please select a form of output that will best suit the nature of the challenge, whether it be STDOUT, file output, array, etc.

Because this is code-golf, it will be a case of lowest number of bytes being the clear winner.

No silly loopholes.

I will not accept answers that have the consecutive letters in non-alphabetical order... So cab will not be deemed a suitable output for cabaret, for example.

Special note, while the "triplets" don't necessarily have to be in alphabetical order, but the characters within the triplets must be... so in the case of the word "performance", for example, the output mno,nop will be accepted, as will nop,mno. In the case of the word "hijacking", there are six ways that the triplets of ghi, hij and ijk could be arranged in a list, and all six permutations are acceptable as output.

Other than that, on your marks, get set, golf!

答:
Actually, 13 bytes

Golfing suggestions welcome. Try it online!

```<code>S3@╧`εj`M3úV∩
</code>```

Ungolfing

```<code>                Implicit input string s.
S               sorted(s).
 3@╧            Push all length-3 combinations of s.
    `εj`M       Join all of those combinations into single strings.
         3úV    Push all slices of the lowercase alphabet of length 1 <= n <= b
            ∩   Push the intersection of the combinations and slices.
                Implicit return.
</code>```

Title: Close-Knit Words

Body:
Actually, 13 bytes

Golfing suggestions welcome. Try it online!

S3@╧`εj`M3úV∩

Ungolfing

                Implicit input string s.
S               sorted(s).
 3@╧            Push all length-3 combinations of s.
    `εj`M       Join all of those combinations into single strings.
         3úV    Push all slices of the lowercase alphabet of length 1 <= n <= b
            ∩   Push the intersection of the combinations and slices.
                Implicit return.


问:
Esolang-Comment-Template-Generator
Lots of people on this site use esoteric languages, and since these languages are unusual and hard to understand, they will frequently write an explanation in a certain format. For example, if the code was

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

And this languages uses # for comments, they would write an explanation like this:

```<code>a                #Explanation of what 'a' does
 bc              #Bc
   d             #d
    e            #Explanation of e
     fgh         #foobar
        ij       #hello world
          k      #etc.
           l     #so on
            mn   #and
              op #so forth
</code>```

I frequently do this too, but every time I do this, I feel like creating the layout of text is really obnoxious and time-consuming. So I want you to create a "Esolang-Comment-Template-Generator" for me. For example, if we ignore the comments, the previous code has this template:

```<code>a                #
 bc              #
   d             #
    e            #
     fgh         #
        ij       #
          k      #
           l     #
            mn   #
              op #
</code>```

The Challenge:

You must write a program or function that takes two strings as input, and outputs this "Esolang-Comment-Template". The first input will be the code, but with bars (|) inserted where the newlines go. The second input is what we will use for comments. So our last example would have this for input:

```<code>"a|bc|d|e|fgh|ij|k|l|mn|op", "#"
</code>```

Unfortunately this excludes bars from being part of the code input, but that's OK. You can assume that the comment input will be a single character. For simplicity's sake, the comment char will not be a bar. The code input will only contain printable ASCII, and it will not contain any newlines.

Hopefully you can infer what to do from the testcases, but I'll try to clarify some things.

You must split the code input up into "code-sections" on every bar. Then, each section of code is output on its own line and left-padded with the length of all the previous code (not including the bars). Then, each line is right-padded with enough spaces so that the last two characters on every line are "One additional space" + "The comment character".

One trailing newline is allowed.

Here is another example. For the input

```<code>"Hello|World", "/"
</code>```

The first section of code is "Hello" and the second is "World". So it should give the output:

```<code>Hello      /
     World /
</code>```

Here are some more samples:

```<code>Input:
"a|b|c|d|e|f|g", ","

Output:
a       ,
 b      ,
  c     ,
   d    ,
    e   ,
     f  ,
      g ,

Input:
"abcdefg", ":"

Output:
abcdefg :

Input:
"4|8|15|16|23|42", "%"

Output:
4          %
 8         %
  15       %
    16     %
      23   %
        42 %

Input:
"E|ac|h s|ecti|on is| one c|haracte|r longer| than the| last!", "!"

Output:
E                                                   !
 ac                                                 !
   h s                                              !
      ecti                                          !
          on is                                     !
                one c                               !
                     haracte                        !
                            r longer                !
                                     than the       !
                                              last! !

Input:
"This|Code|has||empty||sections", "@"

Output:
This                     @
    Code                 @
        has              @
                         @
           empty         @
                         @
                sections @
</code>```

Rules:

You may take these inputs and outputs in any reasonable format. For example, reading/writing a file, STDIN/STOUT, function arguments/return value, etc. As usual, this is code-golf, so try to make your code as short as possible and you win if you can get the shortest solution in your language! I will also select the shortest solution as the overall winner. Standard loopholes are banned.

答:
Turtlèd, 35 bytes (noncompeting)

Takes one input, the last character is the comment character. Does not work with comment character as space, but I assume that isn't necessary.

```<code>!' [*.+(|' dl)r_]' r[*+.(|u)_][ .d]
</code>```

Explanation:

```<code>!                                  take input into string variable
 '                                 write space over current cell
   [*           ]                  while cell is not *
     .+                            write pointed char of string, stringpointer+1 (starts 0)
       (|    )                     if current cell is |
         ' dl                      write space (over |), move down, left
              r_                   move right, write * if pointed char is
                                   last char, else space

                 ' r               write space, move right
                    [*       ]     while cell is not *
                      +.           increment pointer and write pointed char
                        (|u)       if cell is |, move up
                            _      write * if the pointed char is the last char

                              [   ] while cell is not space
                                .d  write the pointed char from string, move down
</code>```

ContentLicense: CC BY-SA 4.0

Title: Esolang-Comment-Template-Generator

Body:
Turtlèd, 35 bytes (noncompeting)

Takes one input, the last character is the comment character. Does not work with comment character as space, but I assume that isn't necessary.

!' [*.+(|' dl)r_]' r[*+.(|u)_][ .d]

Explanation:

!                                  take input into string variable
 '                                 write space over current cell
   [*           ]                  while cell is not *
     .+                            write pointed char of string, stringpointer+1 (starts 0)
       (|    )                     if current cell is |
         ' dl                      write space (over |), move down, left
              r_                   move right, write * if pointed char is
                                   last char, else space

                 ' r               write space, move right
                    [*       ]     while cell is not *
                      +.           increment pointer and write pointed char
                        (|u)       if cell is |, move up
                            _      write * if the pointed char is the last char

                              [   ] while cell is not space
                                .d  write the pointed char from string, move down


答:
Turtlèd, 8 bytes

```<code>15:[*,l]
</code>```

explanation:

```<code>[implicit] initial cell is *, initial char var is *
15       put 15 in register
  :      move right by as many cells as the amount in register
   [*  ] while cell not *
     ,l  write char var, move left 1 cell
</code>```

Title: Create output twice the length of the code

Body:
The Challenge

Write a complete program that writes twice as many bytes to standard output as the length of the program.

Rules

The program must write ASCII characters to the standard output.

The contents of the output doesn't matter.

The output, measured in bytes, must be exactly twice the length of the program, also measured in bytes, unless you fulfill the bonus.

Any trailing newline is included in the output's byte count.

Bonus

Your program can optionally take a number, n, as input. If so, the output must be exactly n * program length bytes. You can assume that n will always be a positive integer. If no input is provided, n must default to 2.

If you do this,  you can subtract 25 bytes from your score.

Shortest program wins.

Restrictions

No standard loopholes.

The program must be at least 1 byte long.

No adding unnecessary whitespace to the source code to change its length. Similarly, comments don't count.

Unless you fulfill the bonus, the program must accept no input. If you do fulfill the bonus, the integer must be the only input.

Lowest score (program length in bytes - bonus) wins.

The shortest answer for each language wins for that language.

Leaderboards

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

Body:
Turtlèd, 8 bytes

15:[*,l]

explanation:

[implicit] initial cell is *, initial char var is *
15       put 15 in register
  :      move right by as many cells as the amount in register
   [*  ] while cell not *
     ,l  write char var, move left 1 cell


问:
Write a program that uses all printable non-alphanumeric ASCII symbols
In particular, use each of these symbols at least once in your source code:

```<code>! " # $ % & ' () * + , - .  / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
</code>```

Symbols inside comments, string literals, regexps (or any other kinds of literals etc.) don't count (but their delimiters such as /**/ or "" do count).

The program should not perform any action. It just has to compile and do nothing when run.

If for some reason some of the symbols cannot be used in the language of your choice, explain that rigorously (what and why must be excluded).

Update: A few answers used symbols withing regular expressions. I'd consider this a bit problematic, it's the same thing as putting them into string literals or comments (that's why I put etc. in that requirement). Please try without this. I also updated the requirement above.

Update: Shortest code wins (tagged as code-golf). As suggested, we'll most likely need some tie-breaker criteria. I suggest that if there is a tie, the winning one is the one in which the ASCII symbols appear as much ordered as possible. Formally: Filter out the first occurrence of each of the listed symbols from a program. This will result in a permutation on the listed symbols. The program with less inversion number of its permutation wins.

Update: I'd be happy to see some/more solutions in regular/mainstream languages, such as C(++), Java, Scala, Haskell, etc.

答:
Common Lisp, 33 characters

```<code>#+()'|!"$%&*,-./:;<=>?@[\]^_`{}~|
</code>```

The main part of the above evaluates (or rather, would evaluate if not for the #+() in front of it) to the symbol named:

```<code>!#$%&()*+,-./:;<=>?@[\]^_`{}~
</code>```

The #+() is to avoid output. I'm not sure if the |foo| syntax for symbols counts as a literal, but symbols are used as variable/function names in Common Lisp, and there are a few answers already using the necessary characters in those.

Body:
Common Lisp, 33 characters

#+()'|!"$%&*,-./:;<=>?@[\]^_`{}~|

The main part of the above evaluates (or rather, would evaluate if not for the #+() in front of it) to the symbol named:

!#$%&()*+,-./:;<=>?@[\]^_`{}~

The #+() is to avoid output. I'm not sure if the |foo| syntax for symbols counts as a literal, but symbols are used as variable/function names in Common Lisp, and there are a few answers already using the necessary characters in those.


答:
Racket 237 bytes

```<code>(define(f s)(let((lr(λ(l i)(list-ref l i)))(l(sort(map char->integer(string->list s))<)))(for((i(-(length l)2)))
(when(=(-(lr l(+ i 2))(lr l(+ i 1)))1(-(lr l(+ i 1))(lr l i)))(for((j 3))(display(string(integer->char(lr l(+ i j))))))))))
</code>```

Testing:

```<code>(f "education")
</code>```

Output:

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

Detailed version:

```<code>(define(f2 s)
  (let ((lr (λ(l i)(list-ref l i)))
        (l (sort (map char->integer (string->list s)) <)))
  (for ((i (-(length l)2)))
    (when (=  (- (lr l (+ i 2)) (lr l (+ i 1)))
              1
              (- (lr l (+ i 1)) (lr l i)))
      (for((j 3))
        (display (string(integer->char (lr l (+ i j))))))))))
</code>```

Title: Close-Knit Words

Body:
Introduction

According to Rand Al'Thor's post in the Puzzling SE, a close-knit word is any word that contains three alphabetically consecutive letters (in any order).

Words like education, foghorn and cabaret are all considered close-knit words whereas words like learning, klaxon and perform are not close-knit words.

Challenge

The challenge is to code-golf a program capable of taking a single word as input (assumed lower case, for all intents and purposes) and to return output that (if available) lists all consecutive letter sets (also in lower case) if it is a close-knit word, and empty output if it is not a close-knit word.

Examples

```<code>Input: education
Output: cde

Input: foghorn
Output: fgh

Input: cabaret
Output: abc

Input: hijacking
Output: ghi, hij, ijk

Input: pneumonia
Output: mno, nop

Input: klaxon
Output: <<no output>>

Input: perform
Output: <<no output>>

Input: learning
Output: <<no output>>
</code>```

Rules

Whereas input is to be assumed to be a single lower-case word and output must be lower-case, the nature of the output will vary according to the choice of your coding language. Please select a form of output that will best suit the nature of the challenge, whether it be STDOUT, file output, array, etc.

Because this is code-golf, it will be a case of lowest number of bytes being the clear winner.

No silly loopholes.

I will not accept answers that have the consecutive letters in non-alphabetical order... So cab will not be deemed a suitable output for cabaret, for example.

Special note, while the "triplets" don't necessarily have to be in alphabetical order, but the characters within the triplets must be... so in the case of the word "performance", for example, the output mno,nop will be accepted, as will nop,mno. In the case of the word "hijacking", there are six ways that the triplets of ghi, hij and ijk could be arranged in a list, and all six permutations are acceptable as output.

Other than that, on your marks, get set, golf!

Body:
Racket 237 bytes

(define(f s)(let((lr(λ(l i)(list-ref l i)))(l(sort(map char->integer(string->list s))<)))(for((i(-(length l)2)))
(when(=(-(lr l(+ i 2))(lr l(+ i 1)))1(-(lr l(+ i 1))(lr l i)))(for((j 3))(display(string(integer->char(lr l(+ i j))))))))))

Testing:

(f "education")

Output:

cde

Detailed version:

(define(f2 s)
  (let ((lr (λ(l i)(list-ref l i)))
        (l (sort (map char->integer (string->list s)) <)))
  (for ((i (-(length l)2)))
    (when (=  (- (lr l (+ i 2)) (lr l (+ i 1)))
              1
              (- (lr l (+ i 1)) (lr l i)))
      (for((j 3))
        (display (string(integer->char (lr l (+ i j))))))))))


答:
Java 142 bytes

```<code>public static String[]substringChain(String s,int[]i){
  String[]r=new String[i.length];
  for(int j=-1;++j<i.length;){
    r[j]=s.substring(0,i[j]);
    s=s.substring(i[j]);
  }
  return b;
}
</code>```

Golfed:

```<code>String[]s(String s,int[]i){String[]r=new String[i.length];for(int j=-1;++j<i.length;){r[j]=s.substring(0,i[j]);s=s.substring(i[j]);}return b;}
</code>```

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:
Java 142 bytes

public static String[]substringChain(String s,int[]i){
  String[]r=new String[i.length];
  for(int j=-1;++j<i.length;){
    r[j]=s.substring(0,i[j]);
    s=s.substring(i[j]);
  }
  return b;
}

Golfed:

String[]s(String s,int[]i){String[]r=new String[i.length];for(int j=-1;++j<i.length;){r[j]=s.substring(0,i[j]);s=s.substring(i[j]);}return b;}


问:
Jimmy these arrays down
My coworker, Jimmy is kinda new to C/C++. He's also kind of a slow learner. Now, to be fair, his code always compiles, but he has some really sloppy habits. For example, everybody knows that you can define an array like this:

```<code>int spam[] = {4, 8, 15, 16, 23, 42};
</code>```

Everybody that is, except for Jimmy. He is convinced that the only way to make an array is like this:

```<code>int spam[6];
spam[0] = 4;
spam[1] = 8;
spam[2] = 15;
spam[3] = 16;
spam[4] = 23;
spam[5] = 42;
</code>```

I keep fixing this for him in code-review, but he won't learn. So I need you to write a tool that automagically does this for him when he commits¹.

The challenge

I want you to write either a full program or a function that takes in a multiline string as input, and outputs the more compact version of the C array. The input will always follow this format, whitespace included:

```<code>identifier_one identifier_two[some_length];
identifier_two[0] = some_number;
identifier_two[1] = some_number;
identifier_two[2] = some_number;
...
identifier_two[some_length - 1] = some_number;
</code>```

In short, the input will always be valid and well defined C. In more detail:

All of the identifiers will be made up of just letters and underscores. The length will always be at least one, and there will never be any missing or out of bounds indexes. You may also assume that the indexes are in order. For example:

```<code>foo bar[3];
bar[0] = 1
bar[2] = 9;
</code>```

<s></s>

```<code>foo bar[1];
bar[0] = 1;
bar[1] = 3;
</code>```

and

```<code>foo bar[3];
bar[2] = 9;
bar[0] = 1
bar[1] = 3
</code>```

are all invalid inputs, and may cause undefined behavior in your submission. You may also assume that all of the numbers will be valid decimal numbers, negative or positive. The input will not have extraneous spaces. The output should always follow this format, whitespace included:

```<code>identifier_one identifier_two[] = {n1, n2, n3, ...};
</code>```

Here is some sample data:

```<code>Input:
spam eggs[10];
eggs[0] = 0;
eggs[1] = 4;
eggs[2] = 8;
eggs[3] = -3;
eggs[4] = 3;
eggs[5] = 7;
eggs[6] = 888;
eggs[7] = 555;
eggs[8] = 0;
eggs[9] = -2;

Output:
spam eggs[] = {0, 4, 8, -3, 3, 7, 888, 555, 0, -2};

Input:
char ans[2];
ans[0] = 52;
ans[1] = 50;

Output:
char ans[] = {52, 50};

Input:
blah_blah quux[1];
quux[0] = 105;

Output:
blah_blah quux[] = {105};
</code>```

You may take your input and output in any reasonable format, such as STDIN/STDOUT, function arguments and return value, reading and writing files etc. Standard loopholes apply. The shortest answer in bytes wins!

¹This is passive-aggressive and a terrible idea. You did not get this idea from me.

Title: Jimmy these arrays down

Body:
JavaScript (ES6), <s>65</s> <s>64</s> 63 bytes

s=>`${s.split`[`[0]}[] = {${s.match(/-?\d+(?=;)/g).join`, `}};`


答:
Lua, 121 Bytes.

```<code>function g(s)print(s:gmatch('.-%[')()..'] = {'..s:gsub('.-\n','',1):gsub('.-([%d.-]+);\n?','%1, '):gsub(',%s+$','};'))end
</code>```

Explained

```<code>function g(s)
    print(                              -- Print, Self Explaintry.
        s:gmatch('.-%[')()..'] = {'     -- Find the 'header', match the first line's class and assignment name (everything up to the 'n]') and append that. Then, append ] = {.
                                        -- In the eggs example, this looks like; 'spam eggs[] = {' now
        ..                              -- concatenate...
        s:gsub('.-\n','',1)             -- the input, with the first line removed.
        :gsub('.-([%d.-]+);\n?','%1, ') -- Then that chunk is searched, quite boringly, a number followed by a semicolon, and the entire string is replaced with an array of those,
                                        -- EG, '1, 2, 3, 4, 5, 6, '
        :gsub(',%s+$','};')          -- Replace the final ', ' (if any) with a single '};', finishing our terrifying combination
    )
end
</code>```

Title: Jimmy these arrays down

Body:
My coworker, Jimmy is kinda new to C/C++. He's also kind of a slow learner. Now, to be fair, his code always compiles, but he has some really sloppy habits. For example, everybody knows that you can define an array like this:

```<code>int spam[] = {4, 8, 15, 16, 23, 42};
</code>```

Everybody that is, except for Jimmy. He is convinced that the only way to make an array is like this:

```<code>int spam[6];
spam[0] = 4;
spam[1] = 8;
spam[2] = 15;
spam[3] = 16;
spam[4] = 23;
spam[5] = 42;
</code>```

I keep fixing this for him in code-review, but he won't learn. So I need you to write a tool that automagically does this for him when he commits¹.

The challenge

I want you to write either a full program or a function that takes in a multiline string as input, and outputs the more compact version of the C array. The input will always follow this format, whitespace included:

```<code>identifier_one identifier_two[some_length];
identifier_two[0] = some_number;
identifier_two[1] = some_number;
identifier_two[2] = some_number;
...
identifier_two[some_length - 1] = some_number;
</code>```

In short, the input will always be valid and well defined C. In more detail:

All of the identifiers will be made up of just letters and underscores. The length will always be at least one, and there will never be any missing or out of bounds indexes. You may also assume that the indexes are in order. For example:

```<code>foo bar[3];
bar[0] = 1
bar[2] = 9;
</code>```

<s></s>

```<code>foo bar[1];
bar[0] = 1;
bar[1] = 3;
</code>```

and

```<code>foo bar[3];
bar[2] = 9;
bar[0] = 1
bar[1] = 3
</code>```

are all invalid inputs, and may cause undefined behavior in your submission. You may also assume that all of the numbers will be valid decimal numbers, negative or positive. The input will not have extraneous spaces. The output should always follow this format, whitespace included:

```<code>identifier_one identifier_two[] = {n1, n2, n3, ...};
</code>```

Here is some sample data:

```<code>Input:
spam eggs[10];
eggs[0] = 0;
eggs[1] = 4;
eggs[2] = 8;
eggs[3] = -3;
eggs[4] = 3;
eggs[5] = 7;
eggs[6] = 888;
eggs[7] = 555;
eggs[8] = 0;
eggs[9] = -2;

Output:
spam eggs[] = {0, 4, 8, -3, 3, 7, 888, 555, 0, -2};

Input:
char ans[2];
ans[0] = 52;
ans[1] = 50;

Output:
char ans[] = {52, 50};

Input:
blah_blah quux[1];
quux[0] = 105;

Output:
blah_blah quux[] = {105};
</code>```

You may take your input and output in any reasonable format, such as STDIN/STDOUT, function arguments and return value, reading and writing files etc. Standard loopholes apply. The shortest answer in bytes wins!

¹This is passive-aggressive and a terrible idea. You did not get this idea from me.

Body:
Lua, 121 Bytes.

function g(s)print(s:gmatch('.-%[')()..'] = {'..s:gsub('.-\n','',1):gsub('.-([%d.-]+);\n?','%1, '):gsub(',%s+$','};'))end

Explained

function g(s)
    print(                              -- Print, Self Explaintry.
        s:gmatch('.-%[')()..'] = {'     -- Find the 'header', match the first line's class and assignment name (everything up to the 'n]') and append that. Then, append ] = {.
                                        -- In the eggs example, this looks like; 'spam eggs[] = {' now
        ..                              -- concatenate...
        s:gsub('.-\n','',1)             -- the input, with the first line removed.
        :gsub('.-([%d.-]+);\n?','%1, ') -- Then that chunk is searched, quite boringly, a number followed by a semicolon, and the entire string is replaced with an array of those,
                                        -- EG, '1, 2, 3, 4, 5, 6, '
        :gsub(',%s+$','};')          -- Replace the final ', ' (if any) with a single '};', finishing our terrifying combination
    )
end


答:
CJam, <s>43</s> 36 bytes

```<code>qN/('[/~;"[] = {"@{S/W=W<}%", "*"};"
</code>```

Online Example

Explanation:

```<code>qN/                                     |Read all lines to array
   ('[/~;                               |slice first line left of [
         "[] = {"                       |add formatting to stack
                 @                      |rotate to remaining lines
                  {      }%             |for each line in array
                   S/W=                 |split after last space
                       W<               |remove last character (;)
                           ", "*        |insert ", " to array
                                "};"    |add formatting
</code>```

A big thanks to Martin Ender for the improvements on my first CJam answer.

Title: Jimmy these arrays down

Body:
CJam, <s>43</s> 36 bytes

qN/('[/~;"[] = {"@{S/W=W<}%", "*"};"

Online Example

Explanation:

qN/                                     |Read all lines to array
   ('[/~;                               |slice first line left of [
         "[] = {"                       |add formatting to stack
                 @                      |rotate to remaining lines
                  {      }%             |for each line in array
                   S/W=                 |split after last space
                       W<               |remove last character (;)
                           ", "*        |insert ", " to array
                                "};"    |add formatting

A big thanks to Martin Ender for the improvements on my first CJam answer.


答:
Vim, 43 36 bytes

You don't need to give Jimmy a script, just teach him to use a proper text editor. (literal returns for clarity)

```<code>:%s/.*=//|%s/;\n/,/<cr><cr>
3wcf ] = {<esc>
$s};
</code>```

Title: Jimmy these arrays down

Body:
Vim, 43 36 bytes

You don't need to give Jimmy a script, just teach him to use a proper text editor. (literal returns for clarity)

:%s/.*=//|%s/;\n/,/<cr><cr>
3wcf ] = {<esc>
$s};


答:
05AB1E, <s>31</s> <s>30</s> 28 bytes

```<code>žh-|vy#¤¨ˆ\}¨… = ¯ïžuDÀÀ‡';J
</code>```

Explanation

```<code>žh-¨                            # remove numbers and ";" from first input
    |v      }                   # for each of the rest of the inputs
      y#                        # split on spaces
        ¤¨                      # take the last element (number) minus the last char (";")
          ˆ\                    # store in global array and throw the rest of the list away
             … =                # push the string " = "
                 ¯ï             # push global array and convert to int
                   žuDÀÀ‡       # replace square brackets of array with curly ones
                         ';     # push ";"
                           J    # join everything and display
</code>```

Try it online!

Saved a byte thanks to Adnan

Title: Jimmy these arrays down

Body:
05AB1E, <s>31</s> <s>30</s> 28 bytes

žh-|vy#¤¨ˆ\}¨… = ¯ïžuDÀÀ‡';J

Explanation

žh-¨                            # remove numbers and ";" from first input
    |v      }                   # for each of the rest of the inputs
      y#                        # split on spaces
        ¤¨                      # take the last element (number) minus the last char (";")
          ˆ\                    # store in global array and throw the rest of the list away
             … =                # push the string " = "
                 ¯ï             # push global array and convert to int
                   žuDÀÀ‡       # replace square brackets of array with curly ones
                         ';     # push ";"
                           J    # join everything and display

Try it online!

Saved a byte thanks to Adnan