Shortest code to throw SIGILL Background

We already have a challenge about throwing SIGSEGV, so why not a challenge about throwing SIGILL?

What is SIGILL?

SIGILL is the signal for an illegal instruction at the processor, which happens very rarely. The default action after receiving SIGILL is terminating the program and writing a core dump. The signal ID of SIGILL is 4. You encounter SIGILL very rarely, and I have absolutely no idea how to generate it in your code except via sudo kill -s 4 <pid>.

Rules

You will have root in your programs, but if you don't want to for any reasons,  you may also use a normal user. I'm on a Linux computer with German locale and I do not know the English text which is displayed after catching SIGILL, but I think it's something like 'Illegal instruction'. The shortest program which throws SIGILL wins.

PDP-11 Assembler (UNIX Sixth Edition), 1 byte
9

Instruction 9 is not a valid instruction on the PDP-11 (in octal, it would be 000011, which does not appear on the list of instructions (PDF)). The PDP-11 assembler that ships with UNIX Sixth Edition apparently echoes everything it doesn't understand into the file directly; in this case, 9 is a number, so it generates a literal instruction 9. It also has the odd property (unusual in assembly languages nowadays) that files start running from the start, so we don't need any declarations to make the program work.
You can test out the program using this emulator, although you'll have to fight with it somewhat to input the program.
Here's how things end up once you've figured out how to use the filesystem, the editor, the terminal, and similar things that you thought you already knew how to use:
% a.out
Illegal instruction -- Core dumped

I've confirmed with the documentation that this is a genuine SIGILL signal (and it even had the same signal number, 4, all the way back then!)

MachineCode on x86_64, 2 1 bytes

7

Try it online!

Simply calls the x86_64 instruction 0x07 (ceilingcat suggested 0x07 instead of 0x27)


Find words containing every vowel Your program must find all the words in this wordlist that contain all the vowels (a e i o u y). There are easy ways to do this, but I am looking for the shortest answer. I will take any language, but I'd like to see Bash.

Here is an example (could be much improved):

cat wordlist.txt | grep "a" | grep "e" | grep "i" | grep "o" | grep "u" | grep "y"

Your score is the length of the code.

-5 points for counting all occurrences of the word.

Lowest score wins.

GolfScript, 19 characters
n%{'aeiouy'&,6=},n*

Usage:
golfscript vowels.gs < wordlist.txt

Output:
abstemiously
authoritatively
behaviourally
[...]
uninformatively
unintentionally
unquestionably
unrecognisably

If you also want to output the count at the end you can use
n%{'aeiouy'&,6=},.n*n@,

which is four characters longer.

Python

file = open('wordlist.txt', 'r')
for word in file:
    if 'a|e|i|o|u' in word:
        print(word)


Find minimum difference between numbers in array STDIN: Array of integers

STDOUT: Smallest difference (the difference between the closest two numbers in the array).

Rules: Given an array of positive integers find the difference between the closest two numbers in the array. Performance should be taken into consideration.

Example:

STDIN: [55, 99, 6, 29, 1, 523, 3]

STDOUT: 2 (e.g. 3-1)

Scoring: Although somewhat informal, the shortest, most efficient (performance wise) will win. Creativity will also be taken into consideration.

The R language

23 characters,  O(n log n)

min(diff(sort(scan())))

Example:

> min(diff(sort(scan())))
1: 55 99 6
4: 29 1 523 3
8:
Read 7 items
[1] 2

...The [1] 2 shows the result 2. (the [1] is to keep track of where in the result vector your are since in R all values are vectors - in this case of length 1)

Python 3.1.3, 77 chars

a=sorted(eval(input()))
print(min([abs(x-y)for x,y in zip(a[::2],a[1::2])]))


Generate the longest error message in C++ Write a short program, that would generate the longest possible error message, in a standard C++ compiler (gcc, cl.exe, icc, or clang).

The score of each entry is the number of characters in the longest error message the compiler emitted. Types included in your source code and quoted by the compiler are counted as a single character.

Cheating

You can always redefine a template in template in template with long names, but I expect something creative. I tried to prevent some of that by the last rule, but of course the rules can be better, and I'll be glad for improvements.

19 characters

Create a file a.cpp with this content :

#include __FILE__
p;

Compile as :

g++ a.cpp

and get amazing 21300 lines error messages  :

In file included from a.cpp:1:0,
                 from a.cpp:1,
                 from a.cpp:1,
                 from a.cpp:1,

...

... 21280 error lines ...
...

In file included from a.cpp:1:0,
                 from a.cpp:1,
                 from a.cpp:1,
                 from a.cpp:1,
                 from a.cpp:1:
a.cpp:2:1: error: ‘p’ does not name a type
In file included from a.cpp:1:0,
                 from a.cpp:1,
                 from a.cpp:1,
                 from a.cpp:1:
a.cpp:2:1: error: ‘p’ does not name a type
In file included from a.cpp:1:0,
                 from a.cpp:1,
                 from a.cpp:1:
a.cpp:2:1: error: ‘p’ does not name a type
In file included from a.cpp:1:0,
                 from a.cpp:1:
a.cpp:2:1: error: ‘p’ does not name a type
In file included from a.cpp:1:0:
a.cpp:2:1: error: ‘p’ does not name a type
a.cpp:2:1: error: ‘p’ does not name a type

50 bytes: Result will be the sum of the length of all the positive numbers with a single error message:

=>

#include<utility>
std::make_index_sequence<-1>::x;

174 bytes: quadratic explosion with multiple error messages:

=>

#include<utility>
template<size_t N, size_t... M>
void a(std::index_sequence<N, M...>) {
  a(std::index_sequence<M...>{});
  static_assert(!N);
}
auto x{a(std::make_index_sequence<C>{})};

compile with

g++ -c truc.cpp -std=c++17 -DC=10 2>&1 > /dev/null | wc -c

index_sequence seems to bypass the template instantiation depth limit problem

for C=10:    8238 chars
for C=100:   264288 chars
for C=1000:  23118522 chars

errors look like this: the whole 0 ... C-1 number sequence looks like it is printed 4*C times

truc.cpp:7:6: error: « void x » a un type incomplet
 auto x{a(std::make_index_sequence<C>{})};
      ^
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] » :
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:5:3: error: l'assertion statique a échoué
   static_assert(!N);
   ^~~~~~~~~~~~~
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 2; long unsigned int ...M = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] » :
truc.cpp:4:4:   requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:5:3: error: l'assertion statique a échoué
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 3; long unsigned int ...M = {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] » :
truc.cpp:4:4:   requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:5:3: error: l'assertion statique a échoué
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 4; long unsigned int ...M = {5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] » :
truc.cpp:4:4:   requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:5:3: error: l'assertion statique a échoué
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 5; long unsigned int ...M = {6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>  » :
truc.cpp:4:4:   requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:5:3: error: l'assertion statique a échoué
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 6; long unsigned int ...M = {7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 6, 7, 8, 9, 10, 11, 12, 13, 14>] » :
truc.cpp:4:4:   requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:5:3: error: l'assertion statique a échoué
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 7; long unsigned int ...M = {8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 7, 8, 9, 10, 11, 12, 13, 14>] » :
truc.cpp:4:4:   requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:5:3: error: l'assertion statique a échoué
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 8; long unsigned int ...M = {9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 8, 9, 10, 11, 12, 13, 14>] » :
truc.cpp:4:4:   requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:5:3: error: l'assertion statique a échoué
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 9; long unsigned int ...M = {10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 9, 10, 11, 12, 13, 14>] » :
truc.cpp:4:4:   requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:5:3: error: l'assertion statique a échoué
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 10; long unsigned int ...M = {11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 10, 11, 12, 13, 14>] » :
truc.cpp:4:4:   requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:5:3: error: l'assertion statique a échoué
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 11; long unsigned int ...M = {12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 11, 12, 13, 14>] » :
truc.cpp:4:4:   requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:5:3: error: l'assertion statique a échoué
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 12; long unsigned int ...M = {13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 12, 13, 14>] » :
truc.cpp:4:4:   requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:5:3: error: l'assertion statique a échoué
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 13; long unsigned int ...M = {14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 13, 14>] » :
truc.cpp:4:4:   requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:5:3: error: l'assertion statique a échoué
truc.cpp: Dans l'instanciation de « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 14; long unsigned int ...M = {}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 14>] » :
truc.cpp:4:4:   requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:4:4:   requis par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 0; long unsigned int ...M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14>] »
truc.cpp:7:39:   requis depuis ici
truc.cpp:4:4: error: pas de fonction correspondant à l'appel « a(std::index_sequence<>) »
   a(std::index_sequence<M...>{});
   ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
truc.cpp:3:6: note: candidate: template<long unsigned int N, long unsigned int ...M> void a(std::index_sequence<N, M ...>)
 void a(std::index_sequence<N, M...>) {
      ^
truc.cpp:3:6: note:   la déduction/substitution de l'argument du patron a échoué:
truc.cpp:4:4: note:   le candidat attend 2 arguments, 0 fourni(s)
   a(std::index_sequence<M...>{});
   ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
truc.cpp:5:3: error: l'assertion statique a échoué
   static_assert(!N);
   ^~~~~~~~~~~~~
[1]    11052 exit 1     g++ -c -O3 truc.cpp -std=c++17 -DC=15

and the number sequences are able to go past the default template instantiation depth limit, certainly because it's a builtin:

... requis récursivement par « void a(std::index_sequence<N, M ...>) [avec long unsigned int N = 1; long unsigned int ...M = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499}; std::index_sequence<N, M ...> = std::integer_sequence<long unsigned int, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499>


Trumpscript, 303 285 244 231 226 bytes

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

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

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

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

Golfing tips welcome.


Write a hash function for Morse Code Your goal is to write a hash function, that accepts morse code character and returns a hash code that you get to define.

You can be sure, passed string will be:

One of the Latin characters (A-Z) encoded into Morse Code using . and -, or
One of the digits (0-9) encoded into Morse Code using . and -, or
Empty

So, there could be any of 37 different strings passed to you.

Requirements:

The returned number should be unique for all 37 strings
For empty string the function should return 0

Score:

Initially, you have a 100 points.
You will lose

1 point for every bitwise operator in your code
2 points for every addition (subtraction) operator in your code (operators in loop clauses (e.g. inside for(;;) or while() don't count)
4 points for every multiplication (division, modulo, etc) operator
6 points for every if (else) statement
8 points for every loop statement (including loops in the called functions. You can presume that any called function has no more than one loop)
12 points for every conditional operator
200 points for using a built-in hash function

Bonuses:

If all numbers, produced by your function are less than N, you will get additional 137 - N points (of course, if the bonus is positive)

Winners:

Score matters, but be creative!

Example:

Score: 100 - 5*2 - 3*4 - 8 + (137 - 134) = 73

I know, this could be improved by removing modulo operator and make a loop starts from 1, but this is just an example

#include <iostream>
#include <map>
#include <set>

std::size_t hash_morse(const std::string& s)
{
    std::size_t ans = 0;

    for(std::size_t i = 0; i < s.size(); ++i)
    {
        ans += (s.at(i) - '-' + 2) * (i + 1) * (i + 1);
    }

    return ans % 134;
}

int main()
{
    std::map<std::string, char> m
    {
        {"",     0},
        {".-",   'A'},
        {"-...", 'B'},
        {"-.-.", 'C'},
        {"-..",  'D'},
        {".",    'E'},
        {"..-.", 'F'},
        {"--.",  'G'},
        {"....", 'H'},
        {"..",   'I'},
        {".---", 'J'},
        {"-.-",  'K'},
        {".-..", 'L'},
        {"--",   'M'},
        {"-.",   'N'},
        {"---",  'O'},
        {".--.", 'P'},
        {"--.-", 'Q'},
        {".-.",  'R'},
        {"...",  'S'},
        {"-",    'T'},
        {"..-",  'U'},
        {"...-", 'V'},
        {".--",  'W'},
        {"-..-", 'X'},
        {"-.--", 'Y'},
        {"--..", 'Z'},

        {".----",    '1'},
        {"..---",    '2'},
        {"...--",    '3'},
        {"....-",    '4'},
        {".....",    '5'},
        {"-....",    '6'},
        {"--...",    '7'},
        {"---..",    '8'},
        {"----.",    '9'},
        {"-----",    '0'}
    };

    std::map<std::size_t, std::string> hashes;

    for(const auto& elem: m)
    {
        auto hash = hash_morse(elem.first);

        if(hashes.find(hash) != hashes.end())
        {
            std::cout << "Collision" << std::endl;
            std::cout << '"' << hashes[hash] << R"(" and ")" << elem.first << '"' << std::endl;
            std::cout << "Hash: " << hash << std::endl;
            std::cout << std::endl;
        }
        else
        {
            hashes[hash] = elem.first;
        }
    }

    std::cout << "Total amount of collisions: " << (m.size() - hashes.size()) << std::endl;

    return 0;
}

Arguably perfect score

There are some possible loopholes in the scoring system. In particular,

  8 points for every loop statement (including loops in the called functions. You can presume that any called function has no more than one loop)

According to PHP documentation,

  array() is a language construct used to represent literal arrays, and not a regular function.

So it's arguable that

$hash = array(
    '' => 0,
    '.-' => -1,
    ...
);
return $hash[$morse];

contains no called functions and should score a perfect 100 + (137 - 1) = 236 points.


Tips for golfing in JavaScript What general tips do you have for golfing in JavaScript? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to JavaScript (e.g. "remove comments" is not an answer).

  Note: Also see Tips for Golfing in ECMAScript 6 and above

Splitting with numbers to save the quotemarks:

"alpha,bravo,charlie".split(",") // before
"alpha0bravo0charlie".split(0)   // after

Converting a string to an int/float by subtracting a empty array

Before(22 bytes)

parseFloat("12.52463")

After(13 bytes, saved 9 bytes)

"12.52463"-[]


Helicopter challenge There is a helicopter flying 500 meters from the ground. It can fly up 100 meters, which takes 1.0 secs. Or if it doesn't fly up it will fall 200 meters, which also takes 1.0 secs - This means if the instruction is anything other than "Fly" the helicopter falls. Build a program that takes input of a list of instructions, telling the helicopter when to fly and when not to. When the helicopter falls it should output the time counter.

INPUT:

  Fly Dance Fly Golf Fly Fly

OUTPUT:

  8.5 secs

Walkthrough:

  1) Fly == Fly so +100 = 600m

  2) Dance != Fly so -200 = 400m

  3) Fly == Fly so +100 = 500m

  4) Golf != Fly so -200m = 300m

  5) Fly == Fly so +100 = 400m

  6) Fly == Fly so +100 = 500m

  7) NO INSTRUCTIONS so -200 = 300m

  8) NO INSTRUCTIONS so -200 = 100m

  9) NO INSTRUCTIONS so -100 = 0m (This takes 0.5 seconds)

Each instruction should be separated by a space, and if the instuction isn't fly, then automatically fall. When the program runs out of instructions automatically fall. Your program must output in (float)secs, and if it takes  => 60.0 seconds display in mins and seconds eg. 1 mins 32.0 secs

Seconds are float decimal values, minutes are whole interger values. Also note capitalization does not matter your program should work for capitals or no capitals.

This is code-golf so the least NO bytes wins!

Python, 100 92 89 bytes

lambda I:sum(reduce(lambda(a,s),i:(a+(a>0)*(-1,.5)[i=='Fly'],s+(a>0)),I.split(),(2.5,0)))

try it online

Python 2, 85 91 bytes

t=2.5+input().upper().split().count('FLY')*1.5
print('%d mins'%(t/60))*(t>59),`t%60`,'secs'

Takes input on STDIN, surrounded by quotes (single or double). Simply counts the number of Flys there are in the input, performs some path to calculate the number of seconds, then formats it.

Now case-insensitive!

Fixed a bug with the same bytecount thanks to Jonathan Allan!

Saved 2 bytes thanks to Shebang!


Add without addition (or any of the 4 basic arithmetic operators) Problem:
Your goal is to add two input numbers without using any of the following math operators: +,-,*,/.
Additionally, you can't use any built-in functions that are designed to replace those math operators.
Scoring:
Smallest code (in number of bytes) wins.
Update

Most of the programs i've seen either concatenate two arrays containing their numbers, or make first number of a character, append second number characters, then count them all.
Shortest array counter: APL with 8 chars, by Tobia
Shortest array concatenation: Golfscript with 4 chars, by Doorknob
Shortest logarithmic solution: TI-89 Basic with 19 chars, by Quincunx
Integration solution: Mathematica with 45 chars, by Michael Stern
Coolest, in my opinion: bitwise operators in javascript, by dave

Javascript (25)

while(y)x^=y,y=(y&x^y)<<1

This adds two variables x and y, using only bitwise operations, and stores the result in x.

This works with negative numbers, too.

Java, 85 bytes

import java.math.*;class a{BigInteger A(BigInteger b,BigInteger B){return b.add(B);}}

BigInteger isn't located in java.lang, java.util, java.io (is it even possible for a numeric type to be related to I/O?) or their subpackages, so its add method doesn't count as a language feature. Problem?


Sum of positive integers. Problem:
Given a set of integers, find the sum of all positive integers in it.
Input:

t – number of test cases [t < 1000]
On each of next t lines, an integer N [-1000 ≤ N ≤ 1000]

Output
The program should output the sum of all the positive integers.
Check your code in online judge
Score
Score is equal to size of source code of your program except symbols with ASCII code ≤ 32.
Here is the best score list: Python Best Scores (Best score is 29)

Whitespace, 0

I couldn't resist. S= space, T= tab, N = newline, all have ASCII codes <= 32.

SSSSNSSSSNTTSSSSSTNTNTTNSSSNSSSSTNTTTNTSTNSSSSTNSSSSTNTTTSSSSTNTSSTTTSSSSSTSNTNTTSSSSTSNTTTNTTSNSSSSNSSSSTSNTTTSSSSNTTTTSSSTTSNSNSNNSSTNSSSSNTTTTNSTSSSSTSTSNTNSSNNN

Base64 encoded for easy copy & paste.

ICAgIAogICAgCgkJICAgICAJCgkKCQkKICAgCiAgICAJCgkJCQoJIAkKICAgIAkKICAgIAkKCQkJ
ICAgIAkKCSAgCQkJICAgICAJIAoJCgkJICAgIAkgCgkJCQoJCSAKICAgIAogICAgCSAKCQkJICAg
IAoJCQkJICAgCQkgCiAKIAoKICAJCiAgICAKCQkJCQogCSAgICAJIAkgCgkKICAKCgo=

C++ (96 points)
#include<iostream>
main()
{
int t,n,s=0;
for(std::cin>>t;t;std::cin>>n, --t, n>0?s+=n:s);
std::cout<<s;
}


Tips for golfing in Scala What general tips do you have for golfing in Scala? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Scala (e.g. "remove comments" is not an answer). Please post one tip per answer.

(This is a shameless copy of ... in Python)

The shortest way of repeating something is with Seq.fill.

1 to 10 map(_=>println("hi!")) // Wrong!
for(i<-1 to 10)println("hi!") // Wrong!
Seq.fill(10)(println("hi!")) // Right!

You can also use ⇒ instead of using => for function definitions.


The shortest code to invert bit-wise a binary string Me thinks there aren't enough easy questions on here that beginners can attempt!

The challenge: Given a random input string of 1's and 0's such as:

10101110101010010100010001010110101001010

Write the shortest code that outputs the bit-wise inverse like so:

01010001010101101011101110101001010110101

J, 5 bytes
Assumes the input string is in variable b.
b='0'

This does not do what it would do in most languages...

 The J comparison operator is just = (=: and =. are global and local assignment, respectively). However, = doesn't work like the normal == operator: it compares item-by-item. Keep in mind that an array is formed like this: 0 2 3 2 3 1 2 3 4. 2 = 0 2 3 2 3 1 2 3 4 gives 0 1 0 1 0 0 1 0 0 for example. This is similar for a string: 'a'='abcadcadda' doesn't just return 0, it returns 1 0 0 1 0 0 1 0 0 1 (This can be extrapolated to mean 0 with */, which basically means all.) In this case however, this behavior is excelent, since we want a string of ones and zeros, or true's and false's. Since J's bools are 1 and 0, this results in an array of 1's and 0's (They aren't strings, and every other character other than 1 would also result in 0 in this array.) This doesn't need printing: J automatically prints the result of an expression. I hope this was adequate explanation, if not, please ask for something that isn't yet clear in the comments. This answer also could've been '0'&= (or =&'0'), but I felt that b='0' was clearer.

TI-BASIC, 3 bytes
B=0

Same "feature" as J; assuming the binary is stored in B, it will display the output. Here is an explanation:

 The TI-BASIC comparison operator is =. However, = doesn't work like the normal == operator: it compares item-by-item. Keep in mind that an array is formed like this: {0,2,3}. 2={0,2,3} returns {0,1,0} for example. Since TI-BASIC's bools are 1 and 0, this results in a list of 1's and 0's (They aren't strings, and every other character other than 1 would also result in 0.)


Numbers Decrease while Letters Increase Randomly inspired by Numbers Increase While Letters Decrease

Given a list of mixed letters and integers (e.g., ['a', 2, 3, 'b']) increase the letters by one position in the alphabet (wrapping at z to a) and decrease the numbers by 1. For the above example, the output should be ['b', 1, 2, 'c'].

The input can be a mixed-type list, a delimited string, a list of strings, etc.
z wraps to a, but 1 goes to 0, and 0 goes to -1, etc.
The input will only ever be [a-z] and integers. You can choose capital letters [A-Z] as input if that's easier for you.
The input is guaranteed non-empty.
The input may contain only numbers or only letters.

Examples:

Input
Output

['a', 2, 3, 'b']
['b', 1, 2, 'c']

['a', 'b', 'z']
['b', 'c', 'a']

[-1, 0, 257, 'x']
[-2, -1, 256, 'y']

[0, 3, 1, 20382876]
[-1, 2, 0, 20382875]

Rules and Clarifications

Input and output can be given by any convenient method.
You can print the result to STDOUT or return it as a function result.
The output doesn't have to be the same format as the input (e.g., you could take input as a string and output as a list).
Either a full program or a function are acceptable.
If applicable, you can assume the input/output integers fit in your language's native int range.
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

05AB1E, 5 bytes

<AAÀ‡

Try it online!

<          # decrement the numbers
 A         # constant "abcdefghijklmnopqrstuvwxyz"
  AÀ       # same, but rotated left ("bcd...yza")
    ‡      # transliterate

Perl, 64 bytes

foreach (@ARGV){$_=~m/[a-zA-Z]/?++$_:--$_;print substr $_,0,1;}


JavaScript: Tricks to shorten onkeydown, setInterval etc Are there any tricks to shorten defined function names like setInterval, onkeydown, onkeyup, createLinearGradient or even return?

When using it more than once it's nice to put it as a string into a variable and reuse it afterwards but most functions I only need once.

I know that ES6 has arrowed functions - maybe there is an apporach?

There is a rather clever trick for shortening method names for a particular object that I first learned about during the first JS1k competition.  See Martijn Haverbeke's page about it, under "Mechanized Abbreviation".

The idea is that you iterate over the keys of the object and apply a hash function h(k) to each of the keys in order to compute an alias for the key.  With some trickery you can make sure to only apply the aliasing to keys referring to function values (i.e. only if typeof o[k] == 'function'), but of course this costs some extra characters.  If only one of the keys being aliased hash to the same value, then you can use the abbreviated name unambiguously.  If there are collisions you have to fall back to the full name (since the order of iteration is undefined).

When using this trick, remember that it's a trade-off between length of hash function (expression) and number of collisions.  Of course, this approach is only helpful when you use a lot of long-name methods on one particular object (e.g. canvas code).  For a paricular snippet that you want to golf, it could be useful to find the number of occurrences of each identifier and put together something like this page, to simplify the search for a good hash function.

This trick could be used with global functions since the global object is this at the global scope (or even shorter, windows = window.top = top in a web environment).  Also, another thing to keep in mind with frequent use of methods on one object is the with statement.

var i=0;
function printNo()
{
document.write(i+" ")
i++;
}
var stInt=setInterval;
var callSet=stInt(printNo);


Lookup without conditional statements This challenge was inspired by programming an Arduino microcontroller. I have 6 LEDs and 6 buttons connected to various pins on the board. In the code, each button and LED is assigned an ID number (1-6). Pin numbers (ranging from 0-13) corresponding to the ID numbers are looked up using a switch statement. Purely for amusement, I was wondering if these switches could be circumvented with an arithmetic/other function just to horrify future code maintainers.

The challenge

Provide the function/functions that take the ID number (integer) as a parameter and return the pin number (integer) for the 6 LEDs and/or the 6 buttons, without using conditional statements (no if, no switch and no ternary).

Return values for LEDs:

ID    Pin
1      3
2      5
3      6
4      9
5     10
6     11

Return values for buttons:

ID    Pin
1      2
2      4
3      7
4      8
5     12
6     13

Bonus challenge

Provide a single function that takes an ID number (integer) and second parameter (any type) indicating whether LED or button pins are requested, and returns the corresponding pin (integer).

Rules

This is not an Arduino-specific challenge. Use any language, do whatever you want.

Edit: at the suggestion of steveverril, this is now a code golf challenge.

Good luck!

(If you're still reading: although patently absurd and arbitrary by programming standards, the mappings are based on the Arduino Micro's pinout. Pins 0 and 1 are reserved for serial communication, LEDs are assigned to the 6 lowest-numbered PWM-capable pins, buttons are assigned to remaining pins)

C, 28 bytes each
p(i){return"@cefijk"[i]&15;}
b(i){return"@bdghlm"[i]&15;}

This is basically the same as the answer by kirbyfan64sos, but uses a char array instead of integers, and has a dummy first byte so there is no need to subtract 1 from the function parameter.

Pyth, 19 bytes each
L.&.>3500459*4-6b15
L.&.>2390221*4-6b15

For pins and buttons, respectively.


LED Numbers and Letters The program must print the following block of text of LED numbers exactly.

+-----------------------------------------------------------------+
|                                                                 |
| 000   1 222 333 4 4 555 666 777 888 999 AAA B   CCC   D EEE FFF |
| 0 0   1   2   3 4 4 5   6     7 8 8 9 9 A A B   C     D E   F   |
| 0 0   1 222 333 444 555 666   7 888 999 AAA BBB C   DDD EEE FFF |
| 0 0   1 2     3   4   5 6 6   7 8 8   9 A A B B C   D D E   F   |
| 000   1 222 333   4 555 666   7 888 999 A A BBB CCC DDD EEE F   |
|                                                                 |
+-----------------------------------------------------------------+

Notice the 1-char padding inside the borders.
The trailing newlines, and the types of the newlines are not significant.
However, the whitespaces are the spaces you get when you press spacebars (ASCII 32).

Shortest code wins. Using data encoding (base64, gzip), or compressing with other Unicode characters is discouraged. You cannot use programs like cat or gzip since they are not programming languages.

The character count must be less than 600 to qualify.

Golfscript, 142 137 chars

Unfortunately some of the characters are control codes, so I'm going to have to post a hexdump and a link rather than a direct copy of the source:

00000000  27 2b 27 3a 28 27 2d 27  36 35 2a 3a 5e 28 6e 27  |'+':('-'65*:^(n'|
00000010  7c 27 3a 29 27 20 27 3a  7c 36 34 2a 3a 40 27 20  ||':)' ':|64*:@' |
00000020  7c 0a 7c 20 27 3a 76 5b  27 77 12 5d 5b 3a 6b 6f  ||.| ':v['w.][:ko|
00000030  52 7f 7b 7e 2f 65 1f 6d  6c 27 7b 7d 2f 5d 3a 24  |R.{~/e.ml'{}/]:$|
00000040  2c 2c 7b 3a 78 3b 5b 27  60 40 50 20 00 10 2c 08  |,,{:x;['`@P ..,.|
00000050  1a 04 00 02 05 01 03 27  7b 7d 2f 5d 7b 24 78 3d  |.......'{}/]{$x=|
00000060  26 21 5b 34 38 78 2e 31  30 2f 37 2a 2b 2b 5d 7c  |&![48x.10/7*++]||
00000070  2b 3d 7d 25 33 2f 7d 25  7a 69 70 7b 7c 2a 7d 25  |+=}%3/}%zip{|*}%|
00000080  76 2a 76 40 29 6e 28 5e  28                       |v*v@)n(^(|

leds.gs

Note that all of the characters are 7-bit values and legal Unicode code points, so the number of characters is the same as the number of bytes in UTF-8.

Basically there are two hard-coded arrays. The first is a 15-element bitmap indicating which of the 7 segments control each grid cell. The second is the 7-segment encoding of the 16 characters. Then it's just a case of using bitwise and to work out which segments are turned on and doing some string manipulation.


Build a Faulty XKCD Browser Challenge

Given the number of an XKCD comic, output the title text of that comic (the mouseover text).

However, the program must throw an error when given the numbers 859 or 404.

Rules

The number given will always be an existing comic (except 404).

Your program must not throw an error for any other numbers than 859 or 404.

For reference, comic 404 does not exist and 859 is:

Brains aside, I wonder how many poorly-written xkcd.com-parsing scripts will break on this title (or ;;"''{<<[' this mouseover text."

Url shorteners are disallowed. You may use the internet to get the title text.

Examples

Input > Output
1642 > "That last LinkedIn request set a new record for the most energetic physical event ever observed. Maybe we should respond." "Nah."
1385 > ::PLOOOOSH:: Looks like you won't be making it to Vinland today, Leaf Erikson.
1275 > If replacing all the '3's doesn't fix your code, remove the 4s, too, with 'ceiling(pi) / floor(pi) * pi * r^floor(pi)'. Mmm, floor pie.
1706 > Plus, now I know that I have risk factors for elbow dysplasia, heartworm, parvo, and mange.

Bounty

I will award a bounty to the shortest answer which fails on comic 859 because it's poorly written instead of checking for the number.

Your program may break on other alt texts (such as 744) providing they have unmatched parentheses, quotation marks etc.

Winning

Shortest code in bytes wins.

Python 2.7 + xkcd,  55 bytes

xkcd is a third-party Python package. In Python, there is a package for everything!

lambda n:[xkcd.getComic(n).altText][n==859]
import xkcd

  For 404: urllib2.HTTPError: HTTP Error 404: Not Found

  For 859: IndexError: list index out of range

Perl, 129 167 bytes

use LWP::Simple;use HTML::Entities;print decode_entities($1)if(get("http://www.xkcd.com/$ARGV[0]")=~m/text: ([^<]*)\}\}<\/div>/)

EDIT: Psyche it's actually

use LWP::Simple;use HTML::Entities;$x=$ARGV[0];if($x==404||$x==859){die}else{print decode_entities($1)if(get("http://www.xkcd.com/$x")=~m/text: ([^<]*)\}\}<\/div>/)}

Import HTML decoding and HTTP accessing, then print the group matching the (...) in

{{Title text: (...)}}</div>

(saving a bit by omitting {{Title  from the query)

For 404 and 859, death.


Let's build a Staircase We don't have enough (semi-)easy challenges for beginners. More and more of the easy ones are already taken. So I tried to come up with something that might be achievable by beginners, but that isn't a duplicate.
Input:
A single string separated with your OS new-line (i.e. \r\n),
or an array with multiple strings.
Output - The Stairs:
Remove all non-alphabetic and non-numeric symbols. So all that's left is [A-Za-z0-9]. And then 'build a stairs'; basically ordering them on length with the smallest at top and widest at the bottom.
Challenge rules:

When two strings are of equal length, we merge them with each other as one big string (the order doesn't matter, so it could be from first to last or last to first, whichever of the two you prefer).
The rule above can stack when the merged strings are of equal length again (see test case 2).

General rules:

The input is STDIN and contains only ASCII characters. And the output is STDOUT.
The case of the output must be the same as the input.
Each submission must be a full program able to compile and run, so not just a method/function. EDIT: I'm rather new, so perhaps it's indeed better to use the default from now on, even though I prefer a full program myself. Sorry for everyone that has already posted a full program. Feel free to edit, and I'll try to not change the post mid-challenge next time.
This is code-golf, so the shortest answer in bytes wins. I probably accept the shortest answer in a year from now.
Don't let code-golf answers discourage you from posting golfed non-codegolf languages like C# and alike! Try to come up with the shortest answer for any programming language.
Feel free to use newer languages than this question.

Test cases:
Input 1:
This is a sample text,
that you will have to use to build stairs.
The wood may be of excellent quality,
or pretty crappy almost falling apart and filled with termites.
Bla bla bla - some more text
Ok, that will do

Output 1:
Okthatwilldo
Thisisasampletext
Blablablasomemoretext
Thewoodmaybeofexcellentquality
thatyouwillhavetousetobuildstairs
orprettycrappyalmostfallingapartandfilledwithtermites

Input 2:
A
small
one
that
contains
equal
length
strings
for
the
special
rule

Output 2:
A                   Or alternatively:       A
length                                      length
oneforthe                                   theforone
smallequal                                  equalsmall
stringsspecial                              specialstrings
thatrulecontains                            containsrulethat

Steps explained of 2:
First order on length:
A
one
for
the
that
rule
small
equal
length
strings
special
contains

First merge:
A
oneforthe
thatrule
smallequal
length
stringsspecial
contains

Second order on length:
A
length
thatrule
contains
oneforthe
smallequal
stringsspecial

Second merge:
A
length
thatrulecontains
oneforthe
smallequal
stringsspecial

Third order on length:
A
length
oneforthe
smallequal
stringsspecial
thatrulecontains

Input 3:
Test,
test.
This
is
a
test.

Output 3:
a                   Or alternatively:       a
is                                          is
TesttestThistest                            testThistestTest

Input 4:
a
bc
d!
123

Output 4:
123     Or alternatively:    123
adbc                         dabc

Python 3, 264 Bytes
I'm not good at code golf so I'm confident this won't be the best Python 3 answer. This uses recursion and an ordered dict with all the words for each length.
from collections import*
def f(i):
 d = defaultdict(list)
 for l in i: x = "".join(c for c in l if c.isalnum());d[len(x)].append(x)
 n = (sorted(["".join(d[z]) for z in d.keys()], key=len))
 if n == i:return "\n".join(n)
 return f(n)
print(f(eval(input())))

Takes input from stdin as a list, for example, test it with this list:
['A', 'small', 'one', 'that', 'contains', 'equal', 'length', 'strings', 'for', 'the', 'special', 'rule']

Will output:
A
length
oneforthe
smallequal
stringsspecial
thatrulecontains

Powershell, Windows 10, 63 bytes

So input...

$n = @"
This is a sample text,
that you will have to use to build stairs.
The wood may be of excellent quality,
or pretty crappy almost falling apart and filled with termites.
Bla bla bla - some more text
Ok, that will do
"@

and code...

((($n -Split '\n').Replace(" ","")) -Replace '[\W]','')|Sort *h

That covers input/output 1, working on 2 and 3...


Randomly pick one number that is different than two other random numbers Two random numbers A and B have been generated to be either 1, 2, or 3
your job is to randomly pick a third number C that can also be 1, 2 or 3. But, C cannot equal A or B.

A can equal B.
If A = B, then C has only two numbers left it can be.
If A ≠ B, C has only one number it can be.
Assume A and B have already been chosen for you

This is how A and B would be created in Python
A = random.randrange(1,4)
B = random.randrange(1,4)

Assume this is already in your code.
This is the shortest I've come up with in Python
while True:
    C = random.randrange(1,4)
    if C != A and C != B:
        break

Here are some acceptable values for A, B and C.

1,2,3
1,1,2
2,3,1
3,3,2

Here are some unacceptable values for A, B and C.

1,2,1
2,3,3
1,1,1
3,2,3

Ruby, 22 characters

([1,2,3]-[A,B]).sample

Still not sure if I understood the question correctly ...

Python, 54 41 characters

Quite long answer in Python but I like list comprehension, so I decided to post this here

// [0] means it is the first element of

C=[i for i in[1,2,3]if not(i in(A,B))][0]


Hello world!!! Fibonacci distribution Your program should output exactly: Hello world!!! with or without linefeed after.
Your program should take no input.
Sourcecode character distribution must be correct according to:

The number of numeric characters (0-9) must be exactly one fibonacci sequence number.
The number of other non-numeric characters !(0-9) in the sourcecode must be exactly the fibonacci sequence number before the above fibonacci sequence number.

Four examples of valid character distribution in sourcecode:

13 numeric, 8 non-numeric characters.
34 numeric, 21 non-numeric characters.
55 numeric, 34 non-numeric characters.
89 numeric, 55 non-numeric characters.

This is code-golf, shortest code in bytes wins! Good luck!

Edit: As this question has constraints on the sourcecode size in combination with being code-golf the accepted answer (if more than one share the equal winning character length) will be the answer with most votes (and least character-count): 2014-03-01.

Windows Command Prompt - 34, 8, 5 chars, (2 below)

*These ones may or may not be breaking rule 2, but here it is anyway

%~099

Name the file:

&start call echo Hello world!!!&exit -b .cmd

Now lets corrupt the file-system a little - 2 chars (or less if you want)

A1

Name the file (using your preferred unorthodox method):

"&start call echo Hello world!!!&exit&.cmd

How does this work:

Since cmd scripts are invoked with 'cmd.exe /C "%1" %*' the executed command will be:

cmd.exe /C "c:\PATH_TO_THE_SCRIPT\"&start call echo Hello world!!!&exit&.cmd"

which will in the following order:

Fail to execute "c:\PATH_TO_THE_SCRIPT\"
Open a new shell printing Hello world!\n
Exit the original shell

http://esolangs.org/wiki/Hello%2B%2B

h000000000051090942171709440034

the h prints hello and the rest is just numbers


Generate a 6 character string from a 15 character alphabet In one of our projects at work, we recently discovered a particularly large method for generating a 6 character string from a 15 character alphabet. A few of us claimed "I bet we can get that in one line" which started a little internal game of code golf.

Your task is to beat us, which I have no doubt won't take long!

The original algorithm used the alphabet 0-9A-E, but we've experimented with other alphabets. There are therefore three subtasks.

Generate a 6 character string randomly selecting from an arbitrary hardcoded 15 character alphabet like ABC123!@TPOI098. (This is just an example, and should be customizable without affecting the byte count.)
Generate a 6 character string randomly selecting from a 15 character alphabet 0123456789ABCDE.
Generate a 6 character string randomly selecting from a 15 character alphabet of your choice (printable characters only please).

Each character should have equal chance of selection and repetition should be possible.

The best we have been able to manage for each of the subtasks is:

"ABC123!@TPOI098" - 24 bytes
"0123456789ABCDE" - 21 bytes
Custom alphabet   -  13 bytes

Your score is the sum of the bytes in each subtask's solution. i.e. our score is currently 58.

We've attempted using among others, CJam and Ruby. The original was in C#. Use any language you like, but we'll be interested to see solutions in these languages particularly

CJam (23 + 14 + 10 = 47 bytes)

Arbitrary alphabet: 23 bytes (online demo)

{"ABC123!@TPOI098"mR}6*

Hexadecimal alphabet: 14 bytes (online demo)

{FmrAbHb'0+}6*

Custom alphabet: ABCDEFGHIJKLMNO, 10 bytes (online demo)

{Fmr'A+}6*

Dissection

The hexadecimal one is the interesting one:

{      e# Loop...
  Fmr  e#   Select a random number from 0 to 14
  AbHb e#   Convert to base 10 and then to base 17
       e#   (i.e. add 7 if the number is greater than 9)
  '0+  e#   Add character '0' (i.e. add 48 and convert from integer to character)
       e#   Note that 'A' - '0' = 17
}6*    e# ...six times

The six characters are left on the stack and printed automatically.

Pyke, 35 bytes

Arbitary alphabet, 20 bytes

6V"ABC123!@TPOI098"H

Try it here!

Hex alphabet, 8 bytes

6V~J15<H

Try it here!

~J15< - "0123456789abcdefghijklmno..."[:15]

Custom alphabet, 7 bytes

6VG15<H

Try it here!

G15< - alphabet[:15]

Alphabet chosen: abcdefghijklmno

6V     - repeat 6 times:
  ...  -   get alphabet
     H -  choose_random(^)


m3ph1st0s's programming puzzle 1 (C++) This is the first of a series of C++ puzzles for you. Hope you will enjoy.

So, puzzle no.1:

Given the following program:

#include <iostream>
int main()
{
   const int a=1;
   const int b=2;
   const float c=0.5;
   std::cout << a/b-a*c;
}

Insert some code on a single new line anywhere inside the program so that the output will be 0. The new line will contain AT MOST 18 characters (including spaces), and the rest of the lines will remain unmodified.
 To be clear, here is an example of a valid new code:

#include <iostream>
int main()
{
   const int a=1;
   const int b=2;
   int* p = NULL;
   const float c=0.5;
   std::cout << a/b-a*c;
}

A new line with 15 characters was inserted so it's ok. However it does not solve the problem.

If this is too simple for you, don't worry, more is coming!!

We can get rid of a=1 by moving it into another scope:

#include <iostream>
main()
{
int a=0;if(0)
    const int a=1;
    const int b=2;
    const float c=0.5;
    std::cout << a/b-a*c;
}

This is I think 13 characters. Or better yet get a new a that also results in 0:

#include <iostream>
int main()
{
   const int a=1;
   const int b=2;
   const float c=0.5;
if(int a=2)
   std::cout << a/b-a*c;
}

That's 11 characters

#include <iostream>
int main()
{
int a;if(a)
   const int a=1;
   const int b=2;
   const float c=0.5;
   std::cout << a/b-a*c;
}

How about these 11 chars...


Short Deadfish Numbers Deadfish is one of the best known non Turing-complete programming languages. It has only one accumulator (which starts at 0) to store data, and only four commands:
i - Increment the accumulator
s - Square the accumulator
d - Decrement the accumulator
o - Output the accumulator

A Deadfish program may look like:
iiisdo

And that would print:
8

The challenge
Create a program that will input a number and output Deadfish code to display the number.(Or make a function that takes the number as a parameter and returns the code.) It must work for any integer from 0 to 255
Goal
Try to make your code make the shortest code possible to generate the given number. For example:
iiiiiiiiio

and
iiiso

each print 9, but the second is shorter.
Scoring
Your score is:
The number of characters in your source code +
The sum of the lengths of your output for all numbers from 1-255
-100 if the language you chose is Deadfish :)

Lowest score wins!

In the original challenge I only had the sum of 6 numbers(9,17,99,100 and 123).
This was from me wanting to not make everyone test for every number, and I wanted the shortest code to be relevant. Then I realized that programmers are good at making scripts to test things like that, and I would rather have this be a contest for best algorithm with golfing as a tiebreaker.
Therefor I changed this, as suggested by Martin Büttner.

ES6 JavaScript 2126 + 311 = 2437 score

m=Math;s=n=>[b=m.min(m.sqrt(n)+.5|0,15),n-b*b];f=n=>(n<0?'d':'i').repeat(m.abs(n));g=(n,t)=>n<4?f(n):g((t=s(n))[0])+'s'+f(t[1]);q=n=>((x=g(n)).length>(z=[...n+''].map((k,i,a)=>i?(a[i-1]==a[i]?'':(y=f((l=s(k))[0]-a[i-1])+(l[0]?'s':'')+f(l[1])).length>m.abs(Q=a[i]-a[i-1])?f(Q):y):g(k)).join('o')).length?z:x)+'o'

Semi-commented:

m = Math; // Keep a reference to math
// This function returns the closest perfect square and the distance from that square to the number
// E.g. s(10) --> [3, 1] because 3^2 + 1 = 10
s = n => [b = m.min(m.sqrt(n) + .5 | 0, 15), n - b * b];
// This creates a bunch of "d"s or "i"s
// E.g. f(3) --> "iii" or f(-2) --> "dd"
f = n => Array(m.abs(n) + 1).join(n < 0 ? 'd' : 'i');
// This constructs the number as a number rather than by digit
g = (n, t) => n < 4 ?
              // If n is less than 4, then we can just increment in normally (base case)
              f(n) :
              // Otherwise, build the square root recursively and shift
              g((t = s(n))[0]) + 's' + f(t[1]);
// This maps based on digits (constructs the number by digit)
// This has now been removed and replaced inline because it is only used once
d = n => (a = [...(n + '')]).map((k, i) => i ? (a[i - 1] == a[i] ? '' : f((l = s(k))[0] - a[i - 1]) + (l[0] ? 's' : '') + f(l[1])) : g(k)).join('o');
// For the official function, compare the digit-method and nondigit-method and return the best one
q = n => ((x = g(n)).length > (z = d(n)).length ? z : x) + 'o'

This takes advantage of the fact that in deadfish, you can print more than one character.

Example: 10 compiles to iodo which is "print one, decrement, print zero."

Usage:

q(10) // --> iodo
q(16) // --> iisso

Here's json data of output:

{
    "0": "o",
    "1": "io",
    "2": "iio",
    "3": "iiio",
    "4": "iiso",
    "5": "iisio",
    "6": "iisiio",
    "7": "iiisddo",
    "8": "iiisdo",
    "9": "iiiso",
    "10": "iodo",
    "11": "ioo",
    "12": "ioio",
    "13": "ioiio",
    "14": "ioiso",
    "15": "iissdo",
    "16": "iisso",
    "17": "iissio",
    "18": "iissiio",
    "19": "ioiiso",
    "20": "iioddo",
    "21": "iiodo",
    "22": "iioo",
    "23": "iioio",
    "24": "iioso",
    "25": "iisiso",
    "26": "iisisio",
    "27": "iisisiio",
    "28": "iioisdo",
    "29": "iioiso",
    "30": "iiiodddo",
    "31": "iiioddo",
    "32": "iiiodo",
    "33": "iiioo",
    "34": "iiioio",
    "35": "iiioiio",
    "36": "iisiiso",
    "37": "iisiisio",
    "38": "iiiosdo",
    "39": "iiioso",
    "40": "iisoddddo",
    "41": "iisodddo",
    "42": "iisoddo",
    "43": "iisodo",
    "44": "iisoo",
    "45": "iisoio",
    "46": "iisoiio",
    "47": "iisoiiio",
    "48": "iisodsdo",
    "49": "iisodso",
    "50": "iiisddsio",
    "51": "iiisddsiio",
    "52": "iisiodddo",
    "53": "iisioddo",
    "54": "iisiodo",
    "55": "iisioo",
    "56": "iisioio",
    "57": "iisioiio",
    "58": "iisioiiio",
    "59": "iisioddso",
    "60": "iiisdsddddo",
    "61": "iiisdsdddo",
    "62": "iiisdsddo",
    "63": "iiisdsdo",
    "64": "iiisdso",
    "65": "iiisdsio",
    "66": "iisiioo",
    "67": "iisiioio",
    "68": "iisiioiio",
    "69": "iisiioiiio",
    "70": "iiisdsiiiiiio",
    "71": "iiisdsiiiiiiio",
    "72": "iiisddodddddo",
    "73": "iiisddoddddo",
    "74": "iiisddodddo",
    "75": "iiisddoddo",
    "76": "iiisddodo",
    "77": "iiisddoo",
    "78": "iiissdddo",
    "79": "iiissddo",
    "80": "iiissdo",
    "81": "iiisso",
    "82": "iiissio",
    "83": "iiissiio",
    "84": "iiissiiio",
    "85": "iiissiiiio",
    "86": "iiisdoddo",
    "87": "iiisdodo",
    "88": "iiisdoo",
    "89": "iiisdoio",
    "90": "iiissiiiiiiiiio",
    "91": "iiisoddddddddo",
    "92": "iiisodddddddo",
    "93": "iiisoddddddo",
    "94": "iiisodddddo",
    "95": "iiisoddddo",
    "96": "iiisodddo",
    "97": "iiisoddo",
    "98": "iiisodo",
    "99": "iiisoo",
    "100": "iodoo",
    "101": "iodoio",
    "102": "iodoiio",
    "103": "iodoiiio",
    "104": "iodoiiso",
    "105": "iodoiisio",
    "106": "iodoiisiio",
    "107": "iodoiiisddo",
    "108": "iodoiiisdo",
    "109": "iodoiiiso",
    "110": "ioodo",
    "111": "iooo",
    "112": "iooio",
    "113": "iooiio",
    "114": "iooiso",
    "115": "iooisio",
    "116": "iooisiio",
    "117": "iooiisddo",
    "118": "iooiisdo",
    "119": "iooiiso",
    "120": "ioioddo",
    "121": "ioiodo",
    "122": "ioioo",
    "123": "ioioio",
    "124": "ioioso",
    "125": "ioiosio",
    "126": "ioiosiio",
    "127": "ioioisddo",
    "128": "ioioisdo",
    "129": "ioioiso",
    "130": "ioiiodddo",
    "131": "ioiioddo",
    "132": "ioiiodo",
    "133": "ioiioo",
    "134": "ioiioio",
    "135": "ioiioiio",
    "136": "ioiioiiio",
    "137": "ioiiosddo",
    "138": "ioiiosdo",
    "139": "ioiioso",
    "140": "ioisoddddo",
    "141": "ioisodddo",
    "142": "ioisoddo",
    "143": "ioisodo",
    "144": "ioisoo",
    "145": "ioisoio",
    "146": "ioisoiio",
    "147": "ioisoiiio",
    "148": "ioisodsdo",
    "149": "ioisodso",
    "150": "ioisiodddddo",
    "151": "ioisioddddo",
    "152": "ioisiodddo",
    "153": "ioisioddo",
    "154": "ioisiodo",
    "155": "ioisioo",
    "156": "ioisioio",
    "157": "ioisioiio",
    "158": "ioisioiiio",
    "159": "ioisioddso",
    "160": "ioisiioddddddo",
    "161": "ioisiiodddddo",
    "162": "ioisiioddddo",
    "163": "ioisiiodddo",
    "164": "ioisiioddo",
    "165": "ioisiiodo",
    "166": "ioisiioo",
    "167": "ioisiioio",
    "168": "iissdddsdo",
    "169": "iissdddso",
    "170": "iissdddsio",
    "171": "iissdddsiio",
    "172": "iissdddsiiio",
    "173": "iissdddsiiiio",
    "174": "ioiisddodddo",
    "175": "ioiisddoddo",
    "176": "ioiisddodo",
    "177": "ioiisddoo",
    "178": "ioiisddoio",
    "179": "ioiisddoiio",
    "180": "ioiisdoddddddddo",
    "181": "ioiisdodddddddo",
    "182": "ioiisdoddddddo",
    "183": "ioiisdodddddo",
    "184": "ioiisdoddddo",
    "185": "ioiisdodddo",
    "186": "ioiisdoddo",
    "187": "ioiisdodo",
    "188": "ioiisdoo",
    "189": "ioiisdoio",
    "190": "iissddsddddddo",
    "191": "iissddsdddddo",
    "192": "iissddsddddo",
    "193": "iissddsdddo",
    "194": "iissddsddo",
    "195": "iissddsdo",
    "196": "iissddso",
    "197": "iissddsio",
    "198": "ioiisodo",
    "199": "ioiisoo",
    "200": "iioddoo",
    "201": "iioddoio",
    "202": "iioddoiio",
    "203": "iioddoiiio",
    "204": "iioddoiiso",
    "205": "iioddoiisio",
    "206": "iioddoiisiio",
    "207": "iioddoiiisddo",
    "208": "iioddoiiisdo",
    "209": "iioddoiiiso",
    "210": "iiododo",
    "211": "iiodoo",
    "212": "iiodoio",
    "213": "iiodoiio",
    "214": "iiodoiso",
    "215": "iiodoisio",
    "216": "iiodoisiio",
    "217": "iiodoiisddo",
    "218": "iiodoiisdo",
    "219": "iiodoiiso",
    "220": "iiooddo",
    "221": "iioodo",
    "222": "iiooo",
    "223": "iiooio",
    "224": "iiooso",
    "225": "iissdso",
    "226": "iissdsio",
    "227": "iissdsiio",
    "228": "iiooisdo",
    "229": "iiooiso",
    "230": "iioiodddo",
    "231": "iioioddo",
    "232": "iioiodo",
    "233": "iioioo",
    "234": "iioioio",
    "235": "iioioiio",
    "236": "iioioiiio",
    "237": "iioiosddo",
    "238": "iioiosdo",
    "239": "iioioso",
    "240": "iiosoddddo",
    "241": "iiosodddo",
    "242": "iiosoddo",
    "243": "iiosodo",
    "244": "iiosoo",
    "245": "iiosoio",
    "246": "iiosoiio",
    "247": "iiosoiiio",
    "248": "iiosodsdo",
    "249": "iiosodso",
    "250": "iiosiodddddo",
    "251": "iiosioddddo",
    "252": "iiosiodddo",
    "253": "iiosioddo",
    "254": "iiosiodo",
    "255": "iiosioo"
}

That was generated by this code:

var c = {}, result = 0;
for (var i = 0; i <= 255; ++i) result += (c[i] = q(i)).length;

which prints result = (the result) and c = the thing above.

This gets a remarkably high score despite being pretty simple. It searches for the nearest perfect square, calculates the square root of that perfect square, adds 's', and increments/decrements appropriately.

Old version which didn't use the fact that "10" = "print one, print zero"

m=Math;s=n=>[b=m.sqrt(n)+.5|0,n-b*b];f=(n)=>Array(m.abs(n)+1).join('id'[+(n<0)]);g=(n,t)=>n<4?f(n):g((t=s(n))[0])+'s'+f(t[1]);q=n=>g(n)+'o'

CJam, 2436 2392 2296 2173 (74 characters + 2099)

"叴噯撘桜᪍뾀戠냞霳㈨嵃畯㓱눿裸㺯蛙㡟激떍䑜㦘啟䂳嗳溘桠㼼ᗎ윆꘶英贈袄瞦㺣樅휏╴෼瓵ꃴ︥㷮싎ꗞ冺憳딕礕䀘䬴卺㽅鬞庘䲵"2G#b129b:c~

Which translates to:

r_(sa\a+{},\1/{{i_L\[_Tm3>{{__mqi:NN*-N)_*@-_@e<_@=_N+:N;'d'i?*+'s+N_Z3e>>}g}*T-_0<'d'i?\z*\2$3<'s*-W%'o]s\:Z:T;}%s0:T;3:Z;}:A~\A]_:,_$0=#=

Tries to optimize the Deadfish code length by choosing the shortest path to reach each digit of the number.

Thanks Martin for the Unicode translation

Here is the complete list of code

1:io
2:iio
3:iiio
4:iiso
5:iisio
6:iisiio
7:iiisddo
8:iiisdo
9:iiiso
10:iodo
11:ioo
12:ioio
13:ioiio
14:ioiiio
15:ioisio
16:ioisiio
17:ioiisddo
18:ioiisdo
19:ioiiso
20:iioddo
21:iiodo
22:iioo
23:iioio
24:iioiio
25:iioiiio
26:iiosiio
27:iioisddo
28:iioisdo
29:iioiso
30:iiiodddo
31:iiioddo
32:iiiodo
33:iiioo
34:iiioio
35:iiioiio
36:iiioiiio
37:iiiosddo
38:iiiosdo
39:iiioso
40:iisoddddo
41:iisodddo
42:iisoddo
43:iisodo
44:iisoo
45:iisoio
46:iisoiio
47:iisoiiio
48:iisodsdo
49:iisodso
50:iisiodddddo
51:iisioddddo
52:iisiodddo
53:iisioddo
54:iisiodo
55:iisioo
56:iisioio
57:iisioiio
58:iisioiiio
59:iisioddso
60:iisiioddddddo
61:iisiiodddddo
62:iisiioddddo
63:iisiiodddo
64:iisiioddo
65:iisiiodo
66:iisiioo
67:iisiioio
68:iisiioiio
69:iisiioiiio
70:iiisddodddddddo
71:iiisddoddddddo
72:iiisddodddddo
73:iiisddoddddo
74:iiisddodddo
75:iiisddoddo
76:iiisddodo
77:iiisddoo
78:iiisddoio
79:iiisddoiio
80:iiisdoddddddddo
81:iiisdodddddddo
82:iiisdoddddddo
83:iiisdodddddo
84:iiisdoddddo
85:iiisdodddo
86:iiisdoddo
87:iiisdodo
88:iiisdoo
89:iiisdoio
90:iiisodddddddddo
91:iiisoddddddddo
92:iiisodddddddo
93:iiisoddddddo
94:iiisodddddo
95:iiisoddddo
96:iiisodddo
97:iiisoddo
98:iiisodo
99:iiisoo
100:iodo
101:ioo
102:ioio
103:ioiio
104:ioiiio
105:ioisio
106:ioisiio
107:ioiisddo
108:ioiisdo
109:ioiiso
110:ioodo
111:iooo
112:iooio
113:iooiio
114:iooiiio
115:iooisio
116:ioisso
117:ioissio
118:iooiisdo
119:iooiiso
120:ioioddo
121:ioiodo
122:ioioo
123:ioioio
124:ioioiio
125:ioisiso
126:ioiosiio
127:ioioisddo
128:ioioisdo
129:ioioiso
130:ioiiodddo
131:ioiioddo
132:ioiiodo
133:ioiioo
134:ioiioio
135:ioiioiio
136:ioisiiso
137:ioiiosddo
138:ioiiosdo
139:ioiioso
140:ioiiioddddo
141:ioiiiodddo
142:ioiiioddo
143:ioiiiodo
144:ioiiioo
145:ioiiioio
146:ioiiioiio
147:ioiiioiiio
148:ioiiiodsdo
149:ioiiiodso
150:ioiisddsio
151:ioisioddddo
152:ioisiodddo
153:ioisioddo
154:ioisiodo
155:ioisioo
156:ioisioio
157:ioisioiio
158:ioisioiiio
159:ioisioddso
160:ioiisdsddddo
161:ioiisdsdddo
162:ioiisdsddo
163:ioiisdsdo
164:ioiisdso
165:ioisiiodo
166:ioisiioo
167:ioisiioio
168:ioisiioiio
169:ioisiioiiio
170:ioiisdsiiiiiio
171:ioiisddoddddddo
172:ioiisddodddddo
173:ioiisddoddddo
174:ioiisddodddo
175:ioiisddoddo
176:ioiisddodo
177:ioiisddoo
178:ioiisddoio
179:ioiissddo
180:ioiissdo
181:ioiisso
182:ioiissio
183:ioiissiio
184:ioiissiiio
185:ioiisdodddo
186:ioiisdoddo
187:ioiisdodo
188:ioiisdoo
189:ioiisdoio
190:ioiisodddddddddo
191:ioiisoddddddddo
192:ioiisodddddddo
193:ioiisoddddddo
194:ioiisodddddo
195:ioiisoddddo
196:ioiisodddo
197:ioiisoddo
198:ioiisodo
199:ioiisoo
200:iioddo
201:iiodo
202:iioo
203:iioio
204:iioiio
205:iioiiio
206:iiosiio
207:iioisddo
208:iioisdo
209:iioiso
210:iiododo
211:iiodoo
212:iiodoio
213:iiodoiio
214:iiossddo
215:iiossdo
216:iiosso
217:iiossio
218:iiossiio
219:iiodoiiso
220:iiooddo
221:iioodo
222:iiooo
223:iiooio
224:iiooiio
225:iiosiso
226:iioosiio
227:iiooisddo
228:iiooisdo
229:iiooiso
230:iioiodddo
231:iioioddo
232:iioiodo
233:iioioo
234:iioioio
235:iioioiio
236:iiosiiso
237:iioiosddo
238:iioiosdo
239:iioioso
240:iioiioddddo
241:iioiiodddo
242:iioiioddo
243:iioiiodo
244:iioiioo
245:iioiioio
246:iioiioiio
247:iioiioiiio
248:iioiiodsdo
249:iioiiodso
250:iioisddsio
251:iioisddsiio
252:iioiiiodddo
253:iioiiioddo
254:iioiiiodo
255:iioiiioo

Try it online here:


Golf Your Favorite Minecraft Tool In Minecraft, the default item textures are all reasonably simple 16×16 pixel images, which makes them seem ideal for golfing.

Below are simplified textures of the five "core" diamond tools in Minecraft: pickaxe, shovel, axe, sword, and hoe.

The images shown are enlarged to show their detail. Click on an image to view its correctly sized 16×16 pixel version.

To make golfing easier, I've modified each of them from the originals to only use the five same 24-bit RGB colors:

R=75 G=82 B=73 for the background.
R=51 G=235 B=203 for the diamond tool heads.
R=14 G=63 B=54 for the diamond outlines.
R=137 G=103 B=39 for the wooden handle core.
R=40 G=30 B=11 for the wooden handle outlines.

Choose your favorite tool out of the five and write a program that outputs its simplified 16×16 pixel texture in any common lossless truecolor image format (such as bpm, png, ppm, etc.).

So, for example, if you chose the axe, you would write a program that outputs this image:

No input should be taken and a web connection should not be required. The image can be output as a file with the name of your choice, or the raw image file data can be output to stdout, or you can simply display the image.

You only need to choose one of the five images. The program that outputs any one of the five images in the fewest number of bytes is the winner.

You may write programs for more than one of the images, but only the one with the minimum number of bytes counts towards your score. If there's a tie, the highest voted post wins.

If you enjoy PPCG and play Minecraft, I invite you to come join our trial Minecraft server. Just ask in the dedicated chatroom.

Minecraft 18w11a (.mcfunction), 757 bytes
fill ~ ~ ~ ~15 ~ ~15 ice
fill ~13 ~ ~13 ~7 ~ ~11 cyan_wool
fill ~12 ~ ~14 ~10 ~ ~8 cyan_wool
fill ~12 ~ ~13 ~10 ~ ~11 diamond_block
fill ~11 ~ ~12 ~9 ~ ~10 diamond_block
fill ~10 ~ ~11 ~8 ~ ~9 diamond_block
fill ~3 ~ ~4 ~1 ~ ~2 dirt
setblock ~3 ~ ~4 oak_planks
setblock ~2 ~ ~3 oak_planks
clone ~3 ~ ~4 ~1 ~ ~2 ~4 ~ ~5
setblock ~4 ~ ~5 oak_planks
setblock ~4 ~ ~7 ice
setblock ~6 ~ ~5 ice
clone ~6 ~ ~5 ~4 ~ ~7 ~7 ~ ~8
setblock ~9 ~ ~10 diamond_block
setblock ~4 ~ ~4 dirt
setblock ~3 ~ ~5 dirt
setblock ~7 ~ ~7 dirt
setblock ~6 ~ ~8 dirt
setblock ~1 ~ ~2 ice
fill ~12 ~ ~9 ~12 ~ ~8 ice
setblock ~11 ~ ~8 ice
fill ~8 ~ ~13 ~7 ~ ~13 ice
setblock ~7 ~ ~12 ice
fill ~ ~ ~ ~15 ~ ~15 light_gray_concrete replace ice
fill ~ ~ ~ ~9 ~ ~10 dark_oak_bark replace dirt

Of course someone had to answer the question with Minecraft. Place answer inside of a datapack, and run with /function <packname>:<filename>. The shovel is drawn relative to you in the +X and +Z direction. Colors are wrong but I'll count that as a language limitation ;)
But the shovel is actually made out of wood and diamonds!!!!
Output

Since this is a minecraft problem, I will do a command block solution:
50 characters

summon ItemFrame ~1 ~0 ~0 {Item:{id:diamond_axe}}

creates an item frame showing an axe.


Return the first N primes With a twist; your algorithm has to be less complex than O(X2) where X is the Nth prime. Your solution post should include the character count and the theoretical complexity in terms of X (or N, which ~= X/ln(X) and so will usually be more efficient)

Here's a hint solution in C# (O(Xln(sqrt(X))), 137 chars):

   public List<int> P(int n){var r = new List<int>{2}; int i=3; while(r.Count<n) if(!r.TakeWhile(x=>x<Math.Sqrt(i)).Any(x=>i%x==0)) r.Add(i++); else i++; }

J, 4 characters
p:i.

Usage:
   p:i.10
2 3 5 7 11 13 17 19 23 29

The problem with using J here is that I don't really know how efficient it is. I'd assume that as a language specialising in "mathematical, statistical, and logical analysis of data", that the algorithm used to generate the primes is pretty good.
I did look at the C source for clues, but it turns out that the C source for J is almost as unreadable as J itself. :-)
(The file is called v2.c for anyone who wants to have a look)

Ruby 37

require 'prime'
p Prime.take gets.to_i


Be the First 1 (leave only the first Truthy) Intro
Every year, Dyalog Ltd. holds a student competition. The challenge there is to write good APL code. This is a language agnostic code-golf edition of this year's eighth problem.
I have explicit permission to post this challenge here from the original author of the competition. Feel free to verify by following the provided link and contacting the author.
Problem
Given a Boolean* list, "turn off" all the Truthies after the first Truthy.
No Truthies? No problem! Just return the list unmodified.
Examples
[falsy,truthy,falsy,truthy,falsy,falsy,truthy] → [falsy,truthy,falsy,falsy,falsy,falsy,falsy]
[] → []
[falsy,falsy,falsy,falsy] → [falsy,falsy,falsy,falsy]

* All your truthies must be identical, and all your falsies must be identical. This includes output.

Python 2, 35 bytes

while 1:b=input();print b;True&=b<1

Try it online! Input and output are lines of True/False.

Based on Dennis's solution. Redefines the variable True to be False after a True input is encountered. That way, any further inputs of True will evaluate to False and be printed as such. Python 3 no longer allows True and False to be redefined, so this answer uses Python 2.

The redefinition is True&=b<1, i.e. True = True & (b<1). When the input b is True, then (b<1) is False (since True==1), so True becomes False. See Kevin Cruijssen's answer for a shorter way to handle this redefinition.

PowerShell, 25 bytes

$args|%{$_-and!$f;$f+=$_}

Previous "non legal" version

{$_*!$f;if($_){$f=1}}

Try it online!
The one more version with the same length of 25 bytes

$args|%{!!$f-lt$_;$f+=$_}

Try it online!


Convert singular to plural There are two forms of nouns, singular and plural. The conversion between these two is quite easy.

Normally, you end it with s. ex. car => cars.

If it ends with s,x,z,ch or sh, end it with es. ex. bus=>buses.

If it ends with y with a consonant just before it, change the y to ies. ex. penny => pennies.

If it ends with f or fe, change it to ves. ex. knife => knives.

If it ends with o with a consonant just before it, change it to oes. ex.potato => potatoes.

Task
You will be given a singular noun. You have to convert the given noun to plural and output it.

Rules

You will not be given irregular nouns, like mouse and moose.

You will not be given exceptions, such as safe (safes; violating #4), piano (pianos; violating #5) and o (oes, violating #5).

You will not be given words which have two or more possible plural forms, such as mosquito (mosquitos or mosquitoes) and roof (roofs or rooves).

You will not be given uncountable nouns.

y doesn't count as a vowel.

Examples
car => cars
bus => buses
potato => potatoes
knife => knives
penny => pennies
exception => exceptions
wolf => wolves
eye => eyes
decoy => decoys
radio => radios

Mathematica, 9 bytes
Pluralize

Yes, there is a built-in for this!
Sample output
Pluralize["car"]

cars

Pluralize /@ {"bus", "potato", "knife", "penny", "exception", "wolf", "eye"}

{"buses", "potatoes", "knives", "pennies", "exceptions", "wolves", "eyes"}

Java 7, 408 bytes

Golfed:

boolean b="bcdfghjklmnpqrstvwxyzs".contains(String.valueOf(s.charAt(s.length()-2))); String x=s.substring(0,s.length()-1);if(s.endsWith("s")||s.endsWith("x")||s.endsWith("z")||s.endsWith("ch")||s.endsWith("sh"))return s+"es";if(s.endsWith("y")&&b)return x+"ies";if(s.endsWith("f")) return x+"ves";if(s.endsWith("fe"))return s.substring(0,s.length()-2)+"ves";if(s.endsWith("o")&&b)return s+"es";return s+="s";

Basically testing what the end of the String is and adding / replacing letters depending on what case it is. The boolean and String at the beginning are just for removing repetition in the test cases and making the code smaller.

Readable version:

public static String pluralize(String s){

// Consonant at the 2nd last position?
boolean b = "bcdfghjklmnpqrstvwxyzs".contains(String.valueOf(s.charAt(s.length()-2)));

// Substring for cases where last letter needs to be replaced
String x = s.substring(0,s.length()-1);

if(s.endsWith("s") || s.endsWith("x") || s.endsWith("z") || s.endsWith("ch") || s.endsWith("sh"))
    return s + "es";
if(s.endsWith("y") && b)
    return x + "ies";
if(s.endsWith("f"))
    return x + "ves";
if(s.endsWith("fe"))
    return s.substring(0,s.length()-2) + "ves";
if(s.endsWith("o") && b)
    return s + "es";

return s += "s";
}


How do I split a string??? Help plz? (code trolling) My homework assignment is take a string and split it into pieces at every new line. I have no idea what to do! Please help!

Note: This is a code-trolling question. Please do not take the question and/or answers seriously. More information here.

C

  My homework assignment is take a string and split it into pieces at every new line. I have no idea what to do! Please help!

Tricky problem for a beginning C programming class!  First you have to understand a few basics about this complicated subject.

A string is a sequence made up of only characters.  This means that in order for programmers to indicate an "invisible" thing (that isn't a space, which counts as a character), you have to use a special sequence of characters somehow to mean that invisible thing.

On Windows, the new line is a sequence of two characters in the string: backslash and n (or the string "\n")
On Linux or OS/X Macs, it is a sequence of four characters: backslash, n, backslash, and then r: (or "\n\r").

(Interesting historical note: on older Macintoshes it was a different sequence of four characters: "\r\n"... totally backwards from how Unix did things!  History takes strange roads.)

It may seem that Linux is more wasteful than Windows, but it's actually a better idea to use a longer sequence.  Because Windows uses such a short sequence the C language runtime cannot print out the actual letters \n without using special system calls.  You can usually do it on Linux without a system call (it can even print \n\ or \n\q ... anything but \n\r).  But since C is meant to be cross platform it enforces the lowest common-denominator.  So you'll always be seeing \n in your book.

(Note: If you're wondering how we're talking about \n without getting newlines every time we do, StackOverflow is written almost entirely in HTML...not C.  So it's a lot more modern.  Many of these old aspects of C are being addressed by things you might have heard about, like CLANG and LLVM.)

But back to what we're working on.  Let's imagine a string with three pieces and two newlines, like:

"foo\nbaz\nbar"

You can see the length of that string is 3 + 2 + 3 + 2 + 3 = 13.  So you have to make a buffer of length 13 for it, and C programmers always add one to the size of their arrays to be safe.  So make your buffer and copy the string into it:

/* REMEMBER: always add one to your array sizes in C, for safety! */
char buffer[14];
strcpy(buffer, "foo\nbaz\nbar");

Now what you have to do is look for that two-character pattern that represents the newline.  You aren't allowed to look for just a backslash.  Because C is used for string splitting quite a lot, it will give you an error if you try.  You can see this if you try writing:

char pattern[2];
strcpy(pattern, "\");

(Note: There is a setting in the compiler for if you are writing a program that just looks for backslashes.  But that's extremely uncommon; backslashes are very rarely used, which is why they were chosen for this purpose.  We won't turn that switch on.)

So let's make the pattern we really want, like this:

char pattern[3];
strcpy(pattern, "\n");

When we want to compare two strings which are of a certain length, we use strncmp.  It compares a certain number of characters of a potentially larger string, and tells you whether they match or not.  So strncmp("\nA", "\nB", 2) returns 1 (true).  This is even though the strings aren't entirely equal over the length of three... but because only two characters are needed to be.

So let's step through our buffer, one character at a time, looking for the two character match to our pattern.  Each time we find a two-character sequence of a backslash followed by an n, we'll use the very special system call (or "syscall") putc to put out a special kind of character: ASCII code 10, to get a physical newline.

#include "stdio.h"
#include "string.h"

char buffer[14]; /* actual length 13 */
char pattern[3]; /* actual length 2 */
int i = 0;

int main(int argc, char* argv[]) {
    strcpy(buffer, "foo\nbar\nbaz");
    strcpy(pattern, "\n");

    while (i < strlen(buffer)) {
       if (1 == strncmp(buffer + i, pattern, 2)) {
           /* We matched a backslash char followed by n */
           /* Use syscall for output ASCII 10 */
           putc(10, stdout);
           /* bump index by 2 to skip both backslash and n */
           i += 2;
       } else {
           /* This position didn't match the pattern for a newline */
           /* Print character with printf */
           printf("%c", buffer[i]);
           /* bump index by 1 to go to next matchable position */
           i += 1;
       }
    }

    /* final newline and return 1 for success! */
    putc(10, stdout);
    return 1;
}

The output of this program is the desired result...the string split!

foo
baz
bar

\t is for \trolling...

   Absolutely incorrect from the top to the bottom.  Yet filled with plausible-sounding nonsense that has scrambled information like what's in the textbook or Wikipedia.  Program logic appears transparent in the context of the misinformation, but is completely misleading.  Even global variables and returning an error code, for good measure...

...

   Of course, there's only one character in the C string representation of the two-character source literal sequence \n.  But making a buffer larger is harmless, as long as strlen() is used to get the actual length to operate on.

...

   We try to convince the reader that strncmp is a boolean operation that either matches (1) or doesn't (0).  But it actually has three return values (-1 matching less, 0 for equal, 1 for matching greater).  Our two character "pattern" being compared is not [\, n], but rather [\n, \0]...picking up the implicit null terminator.  As that sequence slides through the string it will never be greater than a two-character sequence it's compared to...at best it will be zero if there is a terminating newline in the input string.

...

   So all this does is loop through the string and print it one character at a time.  The top branch never runs.  (Though you could get it to if your string had lower-than \n codes in it, say tab...which could be used to mysteriously omit characters from the output :-P)

Python

from sys import stdout as o
i=raw_input("Give me string plz? ")
for x in i+"\n": o.write(x) if x!="\n" else o.write("\n")