Using two linked programs, output ordinal numbers up to n ...Ordinal numbers (or ordinal numerals) are words representing position or rank in a sequential order.

From Wikipedia.

Your task is, using 2 separate programs (of which can be made from 2 different languages), to output the ordinal sequence from first to nth. You will be outputting the full word second as opposed to 2nd.

The challenge of ordinal numbers has been brought up before, particularly in this entry. In this challenge, ordinals are merely a vehicle to facilitate the unique conditions detailed below.

Part 1

You must make a program that, when given the input of n must output anything.
n will always be a positive, non-zero integer no larger than 999.

Valid output includes but is not limited to:

Any output to stdout / stderr / etc
Creation of files / folders / etc
A graphical interface or images of any kind

Anything goes.

Part 2

You must make a program that uses the output of part 1's program to output a sequence of ordinal numbers, starting from 1 (first), up to whatever n was parsed in part 1.

General Conditions:

The total bytes for part 2 must not exceed the total bytes for part 1 (less than or equal to).

Output conditions:

Not case sensitive.
Output must contain only the ordinal sequence (only characters a-Z) and whitespace (newlines allowed).
Can be output to any source, so long as it is visible either during or after execution.
Program does not need to terminate so long as its output is correct.
Output is not required to have any grammar, but may optionally include it (hyphens, commas, "ands", etc). nine hundred ninety ninth is just as acceptable as nine hundred and ninety-ninth.

Sample Output

Where n is 8

FIRST SECOND THIRD FOURTH FIFTH SIXTH SEVENTH EIGHTH

Scoring

The hierarchy of win conditions is:

  The lowest number of bytes in part 1
  The lowest number of bytes in part 2

Entry #1 | Part 1 = 32 bytes, Part 2 = 22 bytes
Entry #2 | Part 1 = 31 bytes, part 2 = 30 bytes

Entry #2 wins - Part 1 contains 31 bytes vs 32 bytes

---

Entry #1 | Part 1 = 21 bytes, Part 2 = 33 bytes
Entry #2 | Part 1 = 80 bytes, Part 2 = 70 bytes

Entry #2 wins - Entry #1 disqualified (Part 2 contains more bytes than Part 1)

---

Entry #1 | Part 1 = 50 bytes, Part 2 = 49 bytes
Entry #2 | Part 1 = 50 bytes, Part 2 = 50 bytes

Entry #1 wins - Part 1 is equal, Part 2 contains 49 bytes vs 50 bytes

Sledgehammer 0.5.1 / Sledgehammer 0.5.1, 10 bytes

Program 1 (10 bytes):

⣘⢷⠾⣃⢖⣎⢅⡨⠱⢳

Decompresses into this Wolfram Language function:

{Range[#1], "Ordinal"} &

Program 2 (7 bytes):

⡾⡁⢚⣷⣬⠤⣾

Decompresses into this Wolfram Language function:

StringRiffle[IntegerName @@ #1, " "] &

Try it online!


What song is playing? Inspired by this xkcd

You work for Shazam and they have a project for you. Some customers are complaining about their app taking up too much space on their phone, so they want you to code a lite version of the app. Unfortunately, your existing code can only understand the word "na", and you have to ship soon. That's okay, we'll do the best with what we've got.
The Challenge
You must write a full program that takes a user input, or takes a command line argument, and print the title and artist of the song. Since we are trying to fix customers complaining about program size, your code must be as short as possible. The input will be a string consisting entirely of na's, with a single space between them. Lowercase/uppercase is arbitrary. This is considered a valid input: Na Na nA na NA This is an invalid input: nah nah NA naNa banana You must determine what song is playing and print it out in exactly this format:
Song: <trackname>
Artist: <artist>

If the input is exactly 8 na's, this matches two separate songs, so you must print both:
Song: Batman Theme
Artist: Neal Hefti

and
Song: Na Na Hey Hey Kiss Him Goodbye
Artist: Steam

If the input is exactly 10 na's, you must print:
Song: Katamari Damacy
Artist: Yuu Miyake

If the input is exactly 11 na's, you must print:
Song: Hey Jude
Artist: The Beatles

If the input is 12 or more na's, you must print
Song: Land Of 1000 Dances
Artist: Wilson Pickett

Lastly, if the input is invalid, there are less than 8 na's, or any of the words are not "na", your program fails to understand the music. So logically, there is only one other song that it could possibly be. You must print:
Song: Africa
Artist: Toto

As usual, standard loopholes apply, and the shortest answer in bytes wins.

Retina, 242

Try it online!

iG`^na( na)*$
iM`na
m`^8$
>Batman Theme,Neal Hefti$n>Na Na Hey Hey Kiss Him Goodbye,Steam
m`^10$
>Katamari Damacy,Yuu Miyake
m`^11$
>Hey Jude,The Beatles
[0-9].+
>Land Of 1000 Dances,Wilson Pickett
m`^[0-9]
>Africa,Toto
>
Song:
,
$nArtist:

How it works:

IgnoreCase flag + Grep mode flag + Regex ^na( na)*$. If the input is valid, print it as is. If not, print nothing.

iG`^na( na)*$

IgnoreCase flag + Match mode flag + Regex na. Count the "na"s and print the number.

iM`na

If the string is exactly "8", replace by the second line.

m`^8$
>Batman Theme,Neal Hefti$n>Na Na Hey Hey Kiss Him Goodbye,Steam

If the string is exactly "10", replace by the second line.

m`^10$
>Katamari Damacy,Yuu Miyake

If the string is exactly "11", replace by the second line.

m`^11$
>Hey Jude,The Beatles

If the string matches [0-9].+, replace by the second line. This is neither true for single digit numbers, 10 and 11 as they already have been repaced nor any of the above replacement strings.

[0-9].+
>Land Of 1000 Dances,Wilson Pickett

If none of the above matched, the string still starts with a number. Default to Toto, Africa.

m`^[0-9]
>Africa,Toto

Replace the placeholders > and , by Song: and Artist:.

>
Song:
,
$nArtist:


Calculate the bitruncated cubic distance between two points The truncated octahedron is a shape that has the interesting property that it can tessellate an entire 3D space so that any two solids that meet by an edge or corner also meet by a face, in a configuration called the bitruncated cubic honeycomb.

This gives it the special property that there is only one metric for adjacency distance [unlike a cubic grid where two cubes touching by only a corner have a face distance of 3], a property which is shared by a hexagonal grid in two dimensions.

Any solid in the bitruncated cubic honeycomb can be represented by the 3D coordinates (a+h, b+h, c+h) where a, b, c are integers and h is either 0 or 1/2. Any solid at (x, y, z) is adjacent to the solids at the following locations:

x, y, z+1
x, y, z-1
x, y+1, z
x, y-1, z
x+1, y, z
x-1, y, z
x+1/2, y+1/2, z+1/2
x+1/2, y+1/2, z-1/2
x+1/2, y-1/2, z+1/2
x+1/2, y-1/2, z-1/2
x-1/2, y+1/2, z+1/2
x-1/2, y+1/2, z-1/2
x-1/2, y-1/2, z+1/2
x-1/2, y-1/2, z-1/2

Your task is to build a program that, given the locations of two truncated octahedrons in the above arrangement, finds their distance. You can take input in any format you wish.

The shortest code to do this in any language wins.

Golfscript, 10 13 characters
~{$~\-}%$~+\;

input: a space-separated array of three two-element arrays of integers, wrapped in square brackets. Each pair of integers denotes the coordinates of both octahedra in one axis. If half-coordinate inputs are to be supported, the input should be scaled up by an even factor (say, 10).
output: a single integer, scaled up by the same amount as the input
reads: "eval the input, for each axis: {sort both coordinates, then subtract the smaller from the larger}, sort the differences, then dump them onto the stack (resulting in three separate numbers), add the top two (= largest two coordinates) and discard the element just below".
proof:
the algorithm to reach a destination in this amount of steps is:

If all three coordinate differences are nonzero, make a diagonal step. This reduces all three differences by 0.5, meaning their order doesn't change and the sum of the largest two differences reduces by 1
If only one coordinate difference is nonzero, make an orthogonal step. This reduces the largest difference by 1
If two of the difference are nonzero, either of these steps can be chosen.

Thus, this algorithm never underestimates the distance. Also, it is not possible to reduce the sum of top largest two differences by more than 1 in a single step, meaning this algorithm never overestimates either. Thus, the algorithm "sum of the largest two absolute values of coordinate differences" is correct.
example:
;"[[20 0] [30 0] [20 -20]]"
~{$~\-}%$~+\;
#70

test: http://golfscript.apphb.com/?c=OyJbWzIwIDBdIFszMCAwXSBbMjAgLTIwXV0iCn57JH5cLX0lJH4rXDs%3D


Prime Factor Random Numbers! Task:

Given two positive integers, generate a random integer between them (inclusive) and then output all its prime factors.

Examples:

Input:   Random Number:     Output:
1,2      2                  [2]
12,46    18                 [2,9]
142,17   40                 [2,2,2,5]

Scoring:

This is code-golf so the least bytes wins!

05AB1E, 4 bytes

Ÿ.RÒ

Explanation:

Ÿ       Create a list [a .. b]
 .R     Pick a random element
   Ò    Prime factors.

Try it online!


Convert a date to xkcd notation In his xkcd about the ISO 8601 standard date format Randall snuck in a rather curious alternative notation:

The large numbers are all the digits that appear in the current date in their usual order, and the small numbers are 1-based indices of the occurrences of that digit. So the above example represents 2013-02-27.

Let's define an ASCII representation for such a date. The first line contains the indices 1 to 4. The second line contains the "large" digits. The third line contains the indices 5 to 8. If there are multiple indices in a single slot, they are listed next to each other from smallest to largest. If there are at most m indices in a single slot (i.e. on the same digit, and in the same row), then each column should have be m+1 characters wide and left-aligned:

2  3  1  4
0  1  2  3  7
5     67    8

See also the companion challenge for the opposite conversion.

The Challenge

Given an ISO 8601 date (YYYY-MM-DD), output the corresponding xkcd date notation.

You may write a program or function, taking input via STDIN (or closest alternative), command-line argument or function argument and outputting the result via STDOUT (or closest alternative), function return value or function (out) parameter.

Any year from 0000 to 9999 is valid input.

Trailing spaces are allowed, leading spaces are not. You may optionally output a single trailing newline.

Standard code-golf rules apply.

Test Cases

2013-02-27
2  3  1  4
0  1  2  3  7
5     67    8

2015-12-24
2  3  1     4
0  1  2  4  5
   5  67 8

2222-11-11
     1234
1    2
5678

1878-02-08
   1     3  24
0  1  2  7  8
57    6     8

2061-02-22
2   4   1   3
0   1   2   6
5       678

3564-10-28
      1 4 2 3
0 1 2 3 4 5 6 8
6 5 7         8

1111-11-11
1234
1
5678

0123-12-30
1 2 3 4
0 1 2 3
8 5 6 7

JavaScript (ES6), 168 173

As an anonymous function. Using template strings, there is a newline near the end that is significant and included in the byte count.

d=>d.replace(/\d/g,c=>m=(l=((o[c]=o[c]||[b,c,b])[p/2&~1]+=++p).length)>m?l:m,t=[m=p=b='',b,b],o=[])&o.map(x=>x&&x.map((x,i)=>t[i]+=(x+'     ').slice(0,m+1)))||t.join`
`

Less golfed

f=d=>(
  // get the indices in o and the columns width in m
  m=0,
  p=0,
  o=[],
  d.replace(/\d/g,c=>(
    o[c] = o[c]||['',c,''], // for each found digit :array with top indices, digit, bottom indices
    o[c][p/2 & ~1] += ++p, // (p/2 and not 1) maps 0..3 to 0, 4..7 to 2
    l = o[c].length,
    m = l>m ? l : m // max indices string length in m
  )),
  // build the output in t
  t=['','',''],
  o.map(x=> x && x.map(
    (x,i) => t[i]+=(x+'     ').slice(0,m+1)) // left justify, max value of m is 4
  ),
  t.join`\n` // return output as a newline separated string
)

Test snippet

f=d=>
  d.replace(/\d/g,c=>m=(l=((o[c]=o[c]||[b,c,b])[p/2&~1]+=++p).length)>m?l:m,t=[m=p=b='',b,b],o=[])&
  o.map(x=>x&&x.map((x,i)=>t[i]+=(x+'     ').slice(0,m+1)))
  ||t.join`\n`

console.log=x=>O.textContent+=x+'\n'

;['2013-02-27','2015-12-24','2222-11-11','1878-02-08','2061-02-22','3564-10-28','1111-11-11']
.forEach(t=>console.log(t+'\n'+f(t)+'\n'))


Inverse Champernowne Substrings The Champernowne Constant is the irrational number 0.1234567891011... extending  ad infinum.

We've done a question about it before. But this question is about its reciprocal, known as the Inverse Champernowne Constant. This is approximately 8.10000007.

Given a string of between one and three digits (every 3-digit string appears within the first 10,000 decimal places) inclusive, give the number of decimal places in the decimal portion of the Inverse Champernowne Constant that precede the first appearance of that string.

Builtins that perform this directly or generate approximations of either of these constants are forbidden, but builtins for arbitrary precision arithmetic are still permissible.

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

Test cases:

1 0
2 52
3 13
4 29
5 36
6 7
7 8
8 27
9 23
10 0
100 0
998 187
999 67
01 321
001 689
010 418

MATL, 37 bytes
Thanks to @AndrasDeak for his help with Octsympy's vpa function!
'1/'1e4:"@V]N$h1e4H$Y$t32>)I0h)jXf1)q

EDIT (June 11, 2016): due to changes in the language, replace 0 by J in the code. The link below includes that modification
Try it online!
It takes a while in the online compiler (less than 1 minute).
'1/'        % literal string
1e4:        % array [1,2,...,1e4]
"           % for each number in that array
  @V        % push number and convert to string
]           % end loop
N$h         % concatenate all strings
1e4H$Y$     % compute 1/123456789101112... as a string with 1e4 significant digits
t32>)       % remove unwanted spaces and newlines in the output string
I0h)        % remove the first two characters ('8.')
j           % input string
Xf          % find indices of occurrences of input string within computed string
1)          % take first index
q           % subtract 1


Print an array as a table Write a program that prints an associative array (key-value) to a table.
Requirements

Standard loopholes are forbidden
Please include a link to an online interpreter and the byte count  in the answer
Use box drawing characters  to draw the table.
You can write both a full program or a function.
Key or value can't contain multiline strings.
Value/key can't be an array/associative array ( example: ["a"=>["a"=>"b"]] or  ["a"=>["a","b"]] )

Special cases

If the programming language lacks of associative array , you can use a list of pairs. Example:  [[key1,value1],[key2,value2]]
You can insert horizontal lines between successive pairs.
An input array can't be empty

This is a code-golf, the answer with the shortest byte count wins!
Challenge
Your code must draw a vertical table like in the example from a associative array . The key must be at left and value must be at right and them needs to be separed,you can choose how separe them. Every key-value pair must be in another row.
There must be only 2 columns for the keys and value.
Example
Array(PHP):
["a"=>"b","c"=>"d","d"=>"d"]
Output:
┏━━━┓
┃a┃b┃
┃c┃d┃
┃d┃d┃
┗━━━┛

TryAPL, 1 byteSBCS

Anonymous tacit prefix function. As TryAPL has no associative arrays, this takes a list of pairs as argument.

↑

Try APL!

↑ mix the list of pairs into a table


Decompose Commutators A theorem in this paper1 states that every integral n-by-n matrix M over the integers with trace M = 0 is a commutator, that means there are two integral matrices A,B of the same size as M such that M = AB - BA.
Challenge
Given an integral matrix M with trace M = 0 find some integral matrices A,B such that M = AB - BA.
Details

Let A,B be two matrices of compatible size, then AB denotes the matrix product of A and B which in general does not commute, so in general AB = BA does not hold. We can "measure" how close two matrices are to commuting with eachother by measuring how close the commutator - which is defined as AB - BA - is to being zero. (The commutator is sometimes also written as [A, B].)
The trace of a matrix is the sum of the diagonal entries.
The decomposition is not necessarily unique. You have to provide one decomposition.

Examples
Since the decomposition is not unique, you might get different results that are still valid. In the following we just consider some possible example.
M:       A:      B:
[ 1  0]  [1  1]  [1  0]
[-2 -1]  [1 -1]  [1  1]

In the trivial case of 1 x 1 matrices only M = 0 is possible, and any two integers A,B will solve the problem
M:   A:   B:
[0]  [x]  [y] for any integers x,y

Note that for M = 0 (a zero matrix of arbitrary size) implies AB = BA, so in this case any two matrices (A, B) that commute (for example if they are inverse to each other) solve the problem.
M:     A:     B:
[0 0]  [2 3]  [3   12]
[0 0]  [1 4]  [4   11]

M:           A:         B:
[11 12  12]  [1  1  1]  [1  2  3]
[ 7  4   0]  [0  1  1]  [4  5  6]
[ 0 -7 -15]  [0  0  1]  [7  8  9]

M:                    A:          B:
[-11811 -9700 -2937]  [ 3 14 15]  [ 2 71 82]
[ -7749 -1098  8051]  [92 65 35]  [81 82 84]
[  3292  7731 12909]  [89 79 32]  [59  4 52]

1: "Integral similarity and commutators of integral matrices"
by Thomas J.Laffey, Robert Reams, 1994

05AB1E, 36 29 bytes
ÄàD(Ÿsgãsgãã.ΔD2FsN._`øδ*O}-Q

-7 bytes thanks to @ovs in another answer of mine.
Extremely slow since I'm using a brute-force approach with three cartesian products. But performance is irrelevant for code-golf challenges I guess (would love to see this same challenge as fastest-code or fastest-algorithm).
Try it online (only works for matrices of size 2x2, and even then usually times out if the absolute maximum of the integers in the matrix \$M\$ is too large..)
Verify whether the output \$[A,B]\$ results in the input \$M\$.
Explanation:
Assumes all the integers used in the resulting matrices \$[A,B]\$ will be within the range \$[-\max(\lvert M\rvert), \max(\lvert M\rvert)]\$. If you know any way to prove or disprove this assumption, let me know.
Note that there are of course matrices \$[A, B]\$ with integers larger than the integers of the resulting matrix \$M\$. But this \$M\$ will have other possible \$[A, B]\$ which are within this min-max range. I.e. \$[A,B]=\$ [[[1,2],[3,4]], [[-1,-2],[-3,-3]]] will have \$M=\$ [[0,2],[-3,0]], but using this \$M\$ to find a possible \$[A,B]\$ will result in [[[3,2],[3,3]], [[2,2],[3,3]]], which are all within the range \$[-3,3]\$.

Let me start with an explanation of 2FsN._`øδ*O}-, which will calculate \$M = AB-BA\$ of a given matrix-pair \$[A,B]\$ (which is the same code as in the verifier TIO-link above).
2F       # Loop 2 times:
  s      #  Swap the top two values on the stack
         #  (so the matrix-pair is at the top again after the first iteration)
   N._   #  Rotate the pair of matrices the (0-based) loop-index amount of times
         #  (to reverse the order from [A,B] to [B,A] in the second iteration)
      `  #  Push both matrices separated to the stack
  ø      #  Zip/transpose the top matrix; swapping rows/columns
   δ     #  Apply double-vectorized:
    *    #   Multiply
     O   #  And then sum each inner row together
 }       # After the loop:
  -      # Subtract the values at the same positions in the two matrices from each other

As for the rest of the program to create all possible matrices and brute-force over them:
Ä        # Convert each integer in the (implicit) input-matrix `M` to its absolute value
 à       # Pop and push the flattened maximum of these absolute values of `M`
  D(     # Duplicate it, and negate the maximum
    Ÿ    # Pop both and push a list in the range [max, -max]
s        # Swap to get the input matrix again
 g       # Pop and push its length to get the matrix dimension
  ã      # Create the cartesian product of the [max, -max]-list that many times
         # (i.e. if the input-matrix has a dimension of 3, we'll now have all possible
         #  triplets of integers within the [max, -max]-range)
sgã      # Do the same, to create all possible combinations of these triplets
         # (so we now have all possible matrices of the same dimensions as the input-matrix,
         #  using integers within the [max, -max]-range)
ã        # Cartesian product yet again (defaults to 2) to create all possible pairs of matrices
.Δ       # Then find the first pair of matrices which is truthy for:
  D      #  Duplicate the current pair
   2FsN._`øδ*O}-
         #  Calculate M as mentioned above
    Q    #  And check if its equal to the (implicit) input-matrix
         # (after which this matrix-pair is output implicitly as result)

Just to give an idea of how inefficient this brute-force approach is:
The given example input-matrix \$M=\$ [[11,12,12],[1,1,1],[1,2,3]] of the challenge description, will create all possible matrix-pairs of the same 3x3 dimensions with integers in the range \$[-12,12]\$. This means the list of matrix-pairs will contain \$(((12^2+1)^3)^3)^2=802830827198685151406498569488525390625\$ matrix-pairs.
And the given example input-matrix \$M=\$ [[-11811,-9700,-2937],[3,14,15],[2,71,82]] would result in \$(((11811^2+1)^3)^3)^2=400239694511528196808960294025932709663435907226315389994060779277222573307615163703296535923733538440194289670070277830289553752923910908747710464\$ matrix-pairs..


Laser Mirror Portal Party A 2D board will contain the following objects:

^,>,v, or <: A laser emitter facing up, right, down, or left respectively. There may be more than one. Lasers will travel in a straight line in empty space (empty space is represented with a dot .). Lasers do not pass through emitters.
*: A target. Lasers pass through targets. There may be more than one.

The board may also contain the following objects:

@: A solid wall. The laser will not pass through here.
\: A left-leaning reflector. Changes the direction of lasers according to the following table:

Direction laser is travelling     Direction of laser after hitting reflector
Up                                Left
Right                             Down
Down                              Right
Left                              Up

It should be pretty intuitive as to how the reflectors work. Just imagine them as an actual two-sided mirror and the directions should be clear.
/: A right-leaning reflector. Changes the direction of lasers according to the following table:

Direction laser is travelling     Direction of laser after hitting reflector
Up                                Right
Right                             Up
Down                              Left
Left                              Down

1,2,3...9: A portal. The number indicates the channel of the portal - there will be exactly two portals of the same channel (for instance, there won't be three 1's). The portal changes the position of lasers to the position of the other portal of the same channel. For instance:

>     1     @     1     *

The laser will hit the target because when it hits the first 1, it is teleported to the second 1 on the other side. Lasers retain the same direction that they were in before.

A portal will not teleport the laser to a portal of a different channel (i.e. a 1 won't teleport the laser to a 9.

Your program will recieve a 2D representation of the board as input. The board will always be rectangular shaped. The output should be True if all the targets have lasers passing through them, or False otherwise.

Here are some test cases:

Input

>....\
..*...
>./../
..*...

Output

True

Input

>..........\
1........../
2..........1
3..........2
4..........3
5..........4
6..........5
7..........6
8..........7
9..........8
*..........9

Output

True

Input

>.@............*
>..@...........*
>...@..........*
>....@.........*
>.....@........*
>...*..@........
>.......@......*

Output

False

Input

../\.
>./**

Output

False

Input

/.......*.......\/3.....
@..............//\.\....
*.............2\.1\/\...
\..............///.....<
.........*...//\\/.....\
>.............\.1.///.4.
4.......*/...\2\/3/\/..^

Output

True

Input

vvvvvvvvvvvvvvvvv
\\\\\\\\\\\\\\\\\
/////////////////
\\\\\\\\\\\\\\\\\
/////////////////
\\\\\\\\\\\\\\\\\
/////////////////
*****************

Output (note the target at the far right)

False

Python, 310 302 287 278 277 260
Not radically different than the existing Python post, but has one or two noteworthy tricks, I think.
It also handles "non-terminating" input, such as 1>1. EDIT: Oops! emitters block lasers.
def t(b):
 w=len(b[0])+1;B=list('@'*w+'@'.join(b));i=l=len(B);C="<>^v@"
 while i:
    j=l-i;i-=1;d=C.find(B[j]);c='.'
    while c not in C:
     if'+'>c:B[j]='.'
     if'0'<c<C:j=(B*2).index(c,j+1)%l
     elif'.'<c:d^=2+(c<C)
     j-=[1,-1,w,-w,j][d];c=B[j%l]
 return'*'not in B

t takes a list of strings (the input lines) and returns a boolean result.
Here's a nice gif of the code being golfed down:

EDIT: Awsome gif courtesy of Will. Thanks Will!


Write a brain-flak classic interpreter! Brain-Flak (a cross between Brainf**k and Flak-Overstow) is a stack-based esoteric language. Since this challenge was posted, the language has evolved and updated, but this first revision of the language is known as "brain-flak classic".
You must write a program or function that takes a string of Brain-Flak classic code, and evaluates it. It will also take a (possible empty) list of integers. There are the inputs to the Brain-Flak classic program.
The Language
Brain-Flak has two stacks, known as 'left' and 'right'. The active stack starts at left. If an empty stack is popped or peeked, it will return 0. There are no variables. When the program starts, each input is pushed on to the active stack in order (so that the last input is on top of the stack).
The only valid characters in a Brain-Flak program are ()[]{}<>, and they must always be balanced. If there are invalid characters, or the brackets are unmatched, you get undefined behaviour. Anything is valid.
There are two types of functions: Nilads and Monads. A nilad is a function that takes 0 arguments. Here are all of the nilads:

() +1.
[] -1.
{} Pop the active stack.
<> Toggle the active stack.

These are concatenated together when they are evaluated. So if we had a '3' on top of the active stack, this snippet:
()(){}

would evaluate to 1 + 1 + active.pop() which would evaluate to 5. <> evaluates to 0.
The monads take one argument, a chunk of Brain-Flak code. Here are all of the monads:

(n) Push 'n' on the active stack.
[n] Print 'n' as an int and a newline.
{foo} While active.peek() != 0, do foo. Evaluates to 0¹.
<foo> Execute foo, but evaluate it as 0.

These functions will also return the value inside of them, so
(()()())

Will push 3 and
[()()()]

Will print 3 but
[(()()())]

Will print and push 3.
When the program is done executing, each value left on the active stack is printed as an integer, with a newline between. Values on the other stack are ignored.
Rules:

Your program must support numbers in the (-128, 127) range, and a stack size of at least 255. If you support larger, great.

Underflow/overflow is undefined.

Sample IO:
The empty program:
Input: None
Output: None
Addition. Source:
({}{})

Input:
2, 3

Output:
5

Subtraction. Source:
({}<>){({}[])<>({}[])<>}<>

Input:
2, 3

Output:
-1

Multiplication. Source:
({}<>)<>({}[]){({}[])<>(({}))<>}<>{({}<>{})<>}<>

Input:
7, 8

Output:
56

Fibonacci. Source:
<>((()))<>{({}[])<>({}<>)<>(({})<>({}<>))<>}<>

Input:
5

Output:
13
8
5
3
2
1
1

Truth machine
{[({})]}

Standard loopholes apply, and the shortest answer in bytes wins.

¹: This was actually a mistake on my part. {...} should evaluate to the sum of all of it's runs, which is IMO one of the coolest features of brain-flak. However, for the purposes of this challenge, assume that {...} evaluates as 0.


create an ascii progress bar well, it's something similar to this question but with a little differences. you have to write a program to ask for width of progress bar and how much work is done. and then draw a progress bar with following features:

width indicates how many characters you have to use to draw progress bar
progress is given via a floating point value between 0..1.
first and last character in progress bar should be something different from all other character, for example "[" and "]"
your program should use two different characters to how much progress passed since the start
you have to write how much work is done right in the middle of progress bar, using a decimal number + "%" sign.

bonus point for handling extreme inputs, such as 150% or -5% work done.

scoring number of characters * (1 without bonus or 0.75 width bonus)

some examples of valid outputs

79 0.15
[||||||||||||                         15%                                     ]

25 0.76
[##########76%#####.....]

39 -0.12
[                 -12%                 ]

25 7.6
[##########760%#########]


Hyperoperation Golfing Introduction

In mathematics, the hyperoperation sequence is an infinite sequence of arithmetic operations (called hyperoperations) that starts with the unary operation of successor (n = 0), then continues with the binary operations of addition (n = 1), multiplication (n = 2), and exponentiation (n = 3), after which the sequence proceeds with further binary operations extending beyond exponentiation, using right-associativity.

(Source)

Challenge
Your challenge is code this sequence, given 3 inputs, n, a, and b, code a function such that $${\displaystyle H_{n}(a,b)={\begin{cases}b+1&{\text{if }}n=0\\a&{\text{if }}n=1{\text{ and }}b=0\\0&{\text{if }}n=2{\text{ and }}b=0\\1&{\text{if }}n\geq 3{\text{ and }}b=0\\H_{n-1}(a,H_{n}(a,b-1))&{\text{otherwise}}\end{cases}}}$$
(Also from Wikipedia.)

Input
3 positive decimal integers, n, a, and b, taken from STDIN, function or command line arguments, in any order. Make sure to specify this in your answer

Output
The result of applying \$H_{n}(a,b)\$ with the inputs

Example inputs and outputs
Input: 0, 6, 3
Output: 4

Input: 4 5 2
Output: 3125

Restrictions

Your program/function should take input in base 10
Don't use any built in function that already provides H(n, a, b)
Standard loopholes apply

This is code-golf, so shortest code in bytes wins!

JavaScript (ES6),  49  47 bytes
Takes input as (a)(b,n).

a=>g=(b,n)=>n*b?g(g(b-1,n),n-1):-~[b,a-1,-1][n]

Try it online!
Commented
a =>                  // main function taking a
  g = (b, n) =>       // g = recursive function taking b and n
    n * b ?           // if neither n nor b is equal to 0:
      g(              //   go recursive:
        g(b - 1, n),  //     b = g(b - 1, n)
        n - 1         //     decrement n
      )               //   end of recursive call
    :                 // else:
      -~[             //   this is a leaf node:
        b,            //     if n = 0, return b + 1
        a - 1,        //     if n = 1, return (a - 1) + 1 = a
        -1            //     if n = 2, return -1 + 1 = 0
      ][n]            //     if n > 2, return -~undefined = 1


"As a child, I was told Spiders felt no emotion." The challenge: output this exact ASCII art of a spiderweb in a window:
 _______________________________
|\_____________________________/|
||    \         |         /    ||
||     \       /|\       /     ||
||     /\'.__.' : '.__.'/\     ||
|| __.'  \      |      /  '.__ ||
||'.     /\'---':'---'/\     .'||
||\ '. /'  \__ _|_ __/  '\ .' /||
|| |  /.   /\ ' : ' /\   .\  | ||
|| |  | './  \ _|_ /  \.' |  | ||
||/ '/.  /'. // : \\ .'\  .\' \||
||__/___/___/_\(+)/_\___\___\__||
||  \   \   \ /(O)\ /   /   /  ||
||\ .\'  \.' \\_:_// './  '/. /||
|| |  | .'\  /  |  \  /'. |  | ||
|| |  \'   \/_._:_._\/   '/  | ||
||/ .' \   /    |    \   / '. \||
||.'_   '\/.---.:.---.\/'   _'.||
||   '.  / __   |   __ \  .'   ||
||     \/.'  '. : .'  '.\/     ||
||     /       \|/       \     ||
||____/_________|_________\____||
|/_____________________________\|

Source: Joan Stark (slightly modified spider and frame, and remove the initials for the sake of the challenge).
Required characters: _|\/'.:-(+)O (12) + space & new-line (2)
Challenge rules:

One or multiple trailing spaces and/or new-lines are allowed.

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code.
Also, please add an explanation if necessary.

Arnold C, 1257 1261 1256 1233 bytes

IT'S SHOWTIME
TALK TO THE HAND" _______________________________"
TALK TO THE HAND"|\_____________________________/|"
TALK TO THE HAND"||    \         |         /    ||"
TALK TO THE HAND"||     \       /|\       /     ||"
TALK TO THE HAND"||     /\'.__.' : '.__.'/\     ||"
TALK TO THE HAND"|| __.'  \      |      /  '.__ ||"
TALK TO THE HAND"||'.     /\'---':'---'/\     .'||"
TALK TO THE HAND"||\ '. /'  \__ _|_ __/  '\ .' /||"
TALK TO THE HAND"|| |  /.   /\ ' : ' /\   .\  | ||"
TALK TO THE HAND"|| |  | './  \ _|_ /  \.' |  | ||"
TALK TO THE HAND"||/ '/.  /'. // : \\ .'\  .\' \||"
TALK TO THE HAND"||__/___/___/_\(+)/_\___\___\__||"
TALK TO THE HAND"||  \   \   \ /(O)\ /   /   /  ||"
TALK TO THE HAND"||\ .\'  \.' \\_:_// './  '/. /||"
TALK TO THE HAND"|| |  | .'\  /  |  \  /'. |  | ||"
TALK TO THE HAND"|| |  \'   \/_._:_._\/   '/  | ||"
TALK TO THE HAND"||/ .' \   /    |    \   / '. \||"
TALK TO THE HAND"||.'_   '\/.---.:.---.\/'   _'.||"
TALK TO THE HAND"||   '.  / __   |   __ \  .'   ||"
TALK TO THE HAND"||     \/.'  '. : .'  '.\/     ||"
TALK TO THE HAND"||     /       \|/       \     ||"
TALK TO THE HAND"||____/_________|_________\____||"
TALK TO THE HAND"|/_____________________________\|"
YOU HAVE BEEN TERMINATED

This is my first try programming in the supreme language, so I'll eat my downvotes as I offer no intelligent solution to this problem although programming in the language descended from the heavens.

Here's a compiler if anyone by any chance questions this algorithm.

Stick around.


Monte Carlo estimator of Pi Happy Pi Day everyone! For no reason at all, I'm trying to construct a Monte Carlo estimator of Pi that is as short as possible. Can we construct one that can fit in a tweet?

To clarify, what I have in mind is the typical approach of drawing random points from the unit square and calculating the ratio that fall within the unit circle. The number of samples can be hard coded or not. If you hardcode them, you must use at least 1000 samples. The result may be returned or printed as a floating point, fixed point or rational number.

No trig functions or Pi constants, must be a Monte Carlo approach.

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

80386 machine code, 40 38 bytes

Hexdump of the code:

60 33 db 51 0f c7 f0 f7 e0 52 0f c7 f0 f7 e0 58
03 d0 72 03 83 c3 04 e2 eb 53 db 04 24 58 db 04
24 58 de f9 61 c3

How to get this code (from assembly language):

    // ecx = n (number of iterations)
    pushad;
    xor ebx, ebx; // counter
    push ecx; // save n for later
myloop:
    rdrand eax; // make a random number x (range 0...2^32)
    mul eax; // calculate x^2 / 2^32
    push edx;
    rdrand eax; // make another random number y
    mul eax; // calculate y^2 / 2^32
    pop eax;
    add edx, eax; // calculate D = x^2+y^2 / 2^32 (range 0...2^33)
    jc skip; // skip the following if outside the circle
    add ebx, 4; // accumulate the result multiplied by 4
skip:
    loop myloop;
    push ebx; // convert the result
    fild dword ptr [esp]; // to floating-point
    pop eax;
    fild dword ptr [esp]; // convert n to floating-point
    pop eax;
    fdivp st(1), st; // divide

    popad;
    ret;

This is a function using MS fastcall calling convention (number of iterations is passed in register ecx). It returns the result in the st register.

Fun things about this code:

rdrand - just 3 bytes to generate a random number!
It uses (unsigned) integer arithmetic until the final division.
The comparison of squared distance (D) with squared radius (2^32) is performed automatically - the carry flag contains the result.
To multiply the count by 4, it counts the samples in steps of 4.


Sort a difference list The difference list of a list of integers is the list differences of consecutive members.

For example the difference list of

1, 3, 2 ,4

is

2, -1, 2

Your task is to take as input a difference list and output what the difference list would look like if the original list were sorted.

For example the difference list

2, 1, -2, -1

Might represent a list

2 4 5 3 2

Which when sorted is

2 2 3 4 5

Which has a difference list of

0 1 1 1

This is code-golf so answers will be scored in bytes with less bytes being better.

05AB1E, 4 bytes
.¥{¥

Try it online!
Explanation
.¥{¥
.¥   # Undelta the input list
  {  # Sort it
   ¥ # And get the deltas


ASCII-Art Zombie Invasion Simulation To simulate a zombie invasion, start with a grid of # and  representing the map:

##   ##
###   #
## ##
  # ###
#  ####

# represents land.
 represents water.

The zombies start at a point on the map...

##   ##
###   #
## %#
  # ###
#  ####

...and spread. % denotes land infected by zombies.

However, zombies cannot swim. They can move across land in the same way a king moves in chess - one square in any diagonal or orthogonal direction:

!!!
!%!
!!!

At the end of the simulation, some land will be infected with zombies:

%%   ##
%%%   #
%% %%
  % %%%
#  %%%%

Your task is to simulate the zombie invasion. Write a program (or function) that takes as input a string representing the initial state of the grid, and two numbers representing the coordinates of the initial zombie. The program should output (or return) the final state of the invasion.

Specifications

Your program may print an optional trailing newline.
You can assume the input will be in the correct format (padded with spaces), with an optional trailing newline.
You can assume the initial zombie will start on land and will not die immediately.
This is code-golf, so the shortest answer (in bytes) wins.
-100% bonus if your code can also solve the Halting Problem for arbitrary Turing machines.
Your program should handle board widths of up to 50 chars.

Kotlin, 283 218 bytes

Unnamed lambda (with a nested function, heh).

Golfed

{i:String,x:Int,y:Int->val m=i.lines().map{it.toCharArray()};fun v(x:Int,y:Int){try{if(m[y][x]=='#'){m[y][x]='%';for(c in-1..1)for(d in-1..1)if(!(c==0&&d==0))v(x+c,y+d)}}catch(e:Exception){}};v(x, y);m.map(::println)}

Ungolfed

fun zombies(input: String, startX: Int, startY: Int) {
    val m = input.lines().map(String::toCharArray)      // build game map
    fun invade(x: Int, y: Int) {                        // nested functions, woo!
        try {
            if (m[y][x] == '#') {                       // if land
                m[y][x] = '%'                           // mark as invaded
                for (dx in -1..1) {                      // generate neighbour tiles
                    for (dy in -1..1) {
                        if (!(dx == 0 && dy == 0)) {
                            invade(x + dx, y + dy)        // attempt to invade neighbours
                        }
                    }
                }
            }
        } catch(e: Exception) {}                        // catches ArrayIndexOutOfBounds
    }

    invade(startX, startY)                              // start the invasion
    m.map(::println)                                    // print final state
}

Saved quite a few bytes by switching to a recursive solution.


An Array of Challenges #1: Alternating Arrays Alternating Arrays

An alternating array is a list of any length in which two (not necessarily different) values are alternating. That is to say, all even-indexed items are equal, and all odd-indexed items are equal.

Your task is to write a program or function which, when given a list of positive integers, outputs/returns truthy if it is alternating and falsy otherwise.

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

Edge Cases:

[]      ->  True
[1]     ->  True
[1,1]   ->  True
[1,2,1] ->  True

Other Test Cases:

[1,2,1,2]      -> True
[3,4,3]        -> True
[10,5,10,5,10] -> True
[10,11]        -> True
[9,9,9,9,9]    -> True

[5,4,3,5,4,3]   -> False
[3,2,1,2,1,2]   -> False
[1,2,1,2,1,1,2] -> False
[2,2,3,3]       -> False
[2,3,3,2]       -> False

Example

Here is an example you can test your solution against, written in Python 3 (not golfed):

def is_alternating(array):
    for i in range(len(array)):
        if array[i] != array[i%2]:
            return False
    return True

Jelly, 4 bytes

ḣ2ṁ⁼

Try it online!

How it works

ḣ2ṁ⁼  Main link. Argument: A (array)

ḣ2    Head 2; truncate A after its second element. If A has two or less elements,
      this returns A itself.
  ṁ   Mold; cyclically repeat the elements of the previous result to create an
      array that has the same shape/length as A.
   ⁼  Test the result for equality with A.


Give everyone T-Shirts You're in charge of distributing T-Shirts to everyone. Simple enough, right? But remember, there are different sizes of T-Shirts, and you have to keep that in mind...

Challenge Specifications

There are N T-Shirt sizes. There are K people. Each person may wear any T-Shirt that is larger than them, but they can only wear a T-Shirt that is D sizes down. You want to figure out what the optimal configuration is, based on the cost of the system. It is guaranteed that everyone will be able to get a T-Shirt, so you must give everyone a T-Shirt.

The cost is calculated as such:
Start from 0 and add up.
For every person who receives a T-Shirt, add |S1 - S2|, where the person is size S1 and they are receiving a T-Shirt of size S2.

Input Specifications

The input starts with the integers N, K, and D. You can choose to not input N or K if you want. These can be given in an array, one on each line, space separated, or pretty much anything you want, but they must be given in this order. You must specify how you want input.

Then, the next part of the input is N integers representing how many T-Shirts of each size there are. For example, with N := 3, [1, 4, 2] means that there is 1 size 1 T-Shirt, 4 size 2 T-Shirts, and 2 size 3 T-Shirt. It is guaranteed that the sum of these numbers equals K. This can be taken as an array, an array contained at the end of the first part of input, an array joined to the end of the first part of the input, one on each line, space separated, or some other one that does not put you at a clear advantage. Again, please specify how you want input.

Then, the next part of the input is K integers representing the individual size of each person. This order matters. This can be taken as an array, an array contained at the end of the first part of the input, etc.

You can also choose to start with size-0.

Output Specifications

Output must consist of K + 1 integers. The first K of these represents the size of T-Shirt given to each person, and the last integer is the overall cost. This can be outputted as an array, space-separated integers, one on each line, etc.

Test Cases

Input:

3 10 1
3 5 2
1 1 1 2 2 2 2 2 3 3

Output:

1 1 1 2 2 2 2 2 3 3 0

Explanation:

This one's an easy case; each person gets the size of T-Shirt matching them, so the overall cost is 0.

Input:

2 10 0
5 5
1 1 1 1 1 1 2 2 2 2

Output:

1 1 1 1 1 2 2 2 2 2 1 # Or 2 1 1 1 1 1 2 2 2 2, or similar outputs

Explanation:

There are 5 size-1 shirts, which are given to 5 of 6 size-1 people. There are 5 size-2 shirts, 4 of which are given to the 4 size-2 people. There is one more size-1 person and one more size-2 shirt, so this assignment is made at a cost of 1.

Input:

7 20 2
5 0 5 0 5 0 5
3 5 7 9 3 5 7 9 3 5 7 9 3 5 7 9 3 5 7 9

Output:

1 3 5 7 1 3 5 7 1 3 5 7 1 3 5 7 1 3 5 7 40

Explanation:

At first glance, it may make sense to assign everyone the size of T-Shirt they need. However, then we get 5 size-9 people and 5 size-1 T-Shirts, and people can only wear shirts down 2 sizes, so we assign everyone a T-Shirt 2 sizes down, at a cost of 40.

This test case is also in place to address the possible confusion that you can output the shirt sizes sorted. This is not always the case, as shown in this test case.

This is a code-golf challenge, so the shortest valid submission by March 14th (Pi Day) wins!

Perl 6, 77 bytes

->$,\t,\p{flat(1..*Zxx t)[[p].&{@(.sort)=0..*;$_}].&{|$_,(p Z-$_)».abs.sum}}

Try it online!

Simply matches the n'th smallest T-Shirt to the person with the n'th smallest size.

I'm not absolutely sure if that is guaranteed to give the correct result for all possible inputs, but it works for the test-cases given in the task description.

Perl 6, 97 bytes

->\d,\t,\p{flat(1..*Zxx t).permutations.map({|$_,(p Z-$_)».&{$_>d??∞!!.abs}.sum}).min(*[*-1])}

Try it online!

Dumb brute-force solutions.
Takes around 15 minutes for the test-cases with 10 people, so the test-case with 20 people should only take, uh, millions of years... :D

(Memory usage should remain steady though, because permutations and map return lazy one-off sequences, and min also only needs to keep one element in memory.)

Both versions take three input arguments:

The number D.
The array for the T-Shirts.
The array for the people.


Create a square of increasing size by replicating the initial code Your assignment is to write a program of even length, that prints an ASCII-art square (described below), that increases its side length by 1 unit each time the original source code is pasted in the middle of the current code.

It is quite hard for me to define this task very well, so I'll give you an example:

Let's say your initial code was CODE and that it printed:

0

Then, insert CODE in the middle: your code becomes COCODEDE and it should print:

00
00

Re-insert CODE in the middle: your code becomes COCOCODEDEDE
and should print:

000
000
000

And so on. Your answer should theoretically work after any number of iterations, but I understand if, due to language performance limitations, it cannot run reasonably over a certain threshold.

Some rules:

You can use any printable ASCII (32-127) as the character to use for your square. Your choice needs  to be constant (You should use the same character for each iteration).
The initial output square must have side-length 1.
An ascii-art square is defined as a string with N lines (separated by N-1 linefeeds / newlines), and with each line containing N copies of the chosen character.
Your output isn't allowed to contain any extraneous whitespace, other than a trailing newline.
You can use the defaults for input and output (programs or functions are allowed, but snippets are not).
The middle of your code is defined as the point where the source code can be split in two parts such that the two are equal.
Your answers will be scored by the length of your original program, in bytes. The lowest byte count wins. In case there's a tie, the answer that was submitted earlier wins.
You can use this program to apply the insertions without having to do that by hand.

Pyth, 2 bytes

5

Try it online! Also Try it doubled, tripled!

How does that work?

\n is the command that prints its argument with a trailing newline, while returning it simultaneously. So, each time you make an insertion, you turn the integer literal 5 into a number containing N copies of 5 concatenated, and the leading newlines basically make sure it's printed the appropriate number of times, thus keeping it square.


Rotate An Integer Array with an O(n) algorithm Write a function that rotates an integer array by a given number k.
k elements from the end should move to the beginning of array, and all other elements should move to right to make the space.

The rotation should be done in-place.

Algorithm should not run in more than O(n), where n is the size of array.

Also a constant memory must be used to perform the operation.

For example,

if array is initialized with elements arr = {1, 2, 3, 4, 5, 6, 7, 8, 9}

rotate(arr, 3) will result the elements to be {7, 8, 9, 1, 2, 3, 4, 5, 6}

rotate(arr, 6) will result the {4, 5, 6, 7, 8, 9, 1, 2, 3}

C (104)
void reverse(int* a, int* b)
{
    while (--b > a) {
        *b ^= *a;
        *a ^= *b;
        *b ^= *a;
        ++a;
    }
}

void rotate(int *arr, int s_arr, int by)
{
    reverse(arr, arr+s_arr);
    reverse(arr, arr+by);
    reverse(arr+by, arr+s_arr);
}

Minified:
v(int*a,int*b){while(--b>a){*b^=*a;*a^=*b;*b^=*a++;}}r(int*a,int s,int y){v(a,a+s);v(a,a+y);v(a+y,a+s);}


Draw an ASCII Lightning Bolt Introduction

Partly inspired by this StackOverflow question, let's draw an ASCII Lightning Bolt.

Write a program that takes a positive Integer n via STDIN or command line and outputs the ASCII Lightning Bolt below.

Input

Positive Integer n representing the number of lightning zig-zag tiers to draw.

Example Output

n=1

__
\ \
 \ \
  \ \
   \/

n=2

__
\ \
 \ \
__\ \
\  __\
 \ \
  \ \
   \/

n=3

__
\ \
 \ \
__\ \
\  __\
 \ \
__\ \
\  __\
 \ \
  \ \
   \/

n=4

__
\ \
 \ \
__\ \
\  __\
 \ \
__\ \
\  __\
 \ \
__\ \
\  __\
 \ \
  \ \
   \/

.
.
.
etc

Additional notes

You may write a function that takes n as the only argument and
prints or returns the string.
Trailing spaces and new lines are okay.
No leading spaces except where appropriate for the designated
pattern.
Shortest code in bytes wins.

Java, 201 196 189 186 182 bytes

Obviously not the best, but it is in Java.

class I{public static void main(String[]a){System.out.print(("__\na a"+new String(new byte[new Byte(a[0])-1]).replace("\0","__a\\  __\\\n a")+"  a   \\/").replace("a","\\ \\\n"));}}


Write some Random English Your Goal:

Given an odd integer input n greater than 1, generate a random English word of length n. An English word is one in which the odd (1-based) indices are consonants and the even (1-based) indices are vowels, the vowels being aeiou.

Random

For the purposes of this challenge, you are to sample from the vowels and consonants uniformly, with replacement. In other words, each possible English word must be equally likely to appear as an output.

Example Inputs/Outputs

3 -> bab, tec, yiq
5 -> baron, nariz, linog
7 -> murovay, fanafim

Winner:

Winner is the Lowest Byte Count.

Upvote your Favorite one, Top 3 Upvoted will be Honorable Mentions :P

05AB1E, 14 11 bytes

-3 bytes thanks to Kevin Cruijssen

EžN¸žMšNèΩJ

Try it online!


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

Please post one tip per answer.

Use dup and add for large numbers

If you need to produce a big but reasonable number which is a multiple of 2 (and in some cases, even not a multiple), you can push half the number and end with  +* (dup and add) instead of pushing the whole number. The threshold for this is 8 and above.

As mentioned, sometimes you can double, then subtract one (threshold 27), and with multiples of higher 2 powers it can be repeated to gain greater numbers.

Try it online!


I give you Nth permutation, you give me N Input: a sequence of uppercase letters (ASCII [65;90]) which is the Nth* lexicographical permutation of the multiset of its characters

*permutations are numbered from 0 or 1 upwards

Output: base-10 integer N

Rulez

There might be duplicates (that's how this challenge differs from
this one)
The characters are ordered by their ASCII value
In case of an input of length less than or equal to 1, the input is the
first permutation and the result is 0 or 1 respectively
First permutation is that in which the leftmost character has the lowest
value, the rightmost character has the highest value, and the sequence
of characters between the first and the last character is the first
permutation of the multiset of its characters (recursive definition!)
Shortest entry wins

Example

Input AAB produces output 0
Input ABA produces output 1
Input BAA produces output 2

Input ZZZ produces output 0
Input DCBA produces output 23

EDIT

Extra kudos to the one who can come up with a solution which doesn't produce all permutations and then search for the input. That's some challenge.

Python 2, 69 bytes

Try it online

from itertools import*
lambda S:sorted(set(permutations(S))).index(S)


Fastest modular exponentiation The challenge is to write code in any open source, available on linux, language of your choice to perform modular exponentiation. The input will be two randomly chosen 2048 bit positive integers numbers x and y and a 2048 bit prime z.  Here is a sample snippet of python to compare to.

def pow_mod(x, y, z):
    n = 1
    while y:
        if y & 1:
            n = n * x % z
        y >>= 1
        x = x * x % z
    return n

The code should accept a file with each of the three numbers on separate lines and output the result to standard out.  You may not use any libraries for modular exponentiation of course.

The code that runs the fastest on average over 100 runs on my computer wins.

For those who want really accurate timing, the best way may be for the timing code to actually be in the code you provide and for your code to simply repeat 100 times (without cheating :) ). This avoids any problems with start up overheads.

Haskell

Though it's simple, it should be pretty fast if built with GHC:

{-# OPTIONS_GHC -O2 #-}
{-# LANGUAGE BangPatterns #-}

module Main where

import Data.Bits

seqI :: Integer -> Integer
seqI x = seq x x

seqB :: Bool -> Bool
seqB x = seq x x

getInteger :: IO Integer
getInteger = fmap (seqI . read) getLine

modExp' :: Integer -> Integer -> Integer -> Integer -> Integer
modExp' r b p m = let nextR = seqI $ mod (seqI $ r*b) m
                      nextB = seqI $ mod (seqI $ b*b) m
                      nextP = seqI $ shiftR  p 1
                      incl  = seqB $ testBit p 0
                      cont  = seqB $ nextP  /= 0
                  in  if incl
                         then if cont
                                 then modExp' nextR nextB nextP m
                                 else nextR
                         else if cont
                                 then modExp' r     nextB nextP m
                                 else r

modExp :: Integer -> Integer -> Integer -> Integer
{-# INLINE modExp #-}
modExp !b !p !m = modExp' 1 b p m

main = do
          b <- getInteger
          p <- getInteger
          m <- getInteger
          print $ modExp b p m

Prime modulus optimization

If the modulus is guaranteed to be a prime, but the exponent might be greater than or equal to the modulus, the last line should be changed to:

          print $ modExp b (mod p (m - 1)) m

Handling multiple inputs

If you'd like it to handle multiple inputs per run, add import System.IO under the other import and the following two lines just under the print line:

          isDone <- isEOF
          if isDone then return () else main

Running

Once it's compiled, it can be run as modexp < file.


Charlie, Oscar, Delta, Echo A big part of radio communication is the NATO Phonetic Alphabet, which encodes letters as words to make them easier to understand over comms. Your job, if you wish to accept it, is to print them one by one.

You must print this exact string to stdout:

A: Alfa
B: Bravo
C: Charlie
D: Delta
E: Echo
F: Foxtrot
G: Golf
H: Hotel
I: India
J: Juliet
K: Kilo
L: Lima
M: Mike
N: November
O: Oscar
P: Papa
Q: Quebec
R: Romeo
S: Sierra
T: Tango
U: Uniform
V: Victor
W: Whiskey
X: Xray
Y: Yankee
Z: Zulu

Rules:

Your program takes no input
Standard loopholes are Disallowed.
If there are any builtins in your language that turn letters to their NATO equivelants, you may not use them (I'm looking at you Mathematica).
You may have trailing spaces and one trailing newline.

Python 2, 189 186 bytes

i=65
for w in"lfa ravo harlie elta cho oxtrot olf otel ndia uliet ilo ima ike ovember scar apa uebec omeo ierra ango niform ictor hiskey ray ankee ulu".split():print'%c: %c'%(i,i)+w;i+=1

Try it online!

Previous: (this was cool, but I realised the simpler version could be made shorter by a byte)

w=''
i=65
for c in"lfAravOharliEeltAchOoxtroTolFoteLndiAulieTilOimAikEovembeRscaRapAuebeComeOierrAangOniforMictoRhiskeYraYankeEulU":
 w+=c.lower()
 if'_'>c:print'%c: %c'%(i,i)+w;w='';i+=1


Fire propagation simulator Suppose we have a matrix like this:

11111
12221
12321
12221
11111

This matrix represents a terrain, and each cell represents a portion of terrain. The number in each cell represents the time the portion of terrain needs to be completely burnt (in minutes, if a measurement unit is needed), according to its combustibility. If a fire starts at any given position (cell), that cell needs to be completely burnt before the fire propagates to the adjacent cells (horizontal and vertical only, not diagonal). So, if a fire is started at the center position, the fire needs:

11111        11111        11111        11011        10001        00000
12221  3 m.  12221  2 m.  12021  1 m.  11011  1 m.  00000  1 m.  00000
12321 -----> 12021 -----> 10001 -----> 00000 -----> 00000 -----> 00000
12221        12221        12021        11011        00000        00000
11111        11111        11111        11011        10001        00000

Explanation:

Fire starts at [2,2] (0-based), which has a burn time of 3.
After 3 minutes, [1,2],[2,1],[2,3],[3,2] start to burn.
After 2 minutes, those cells end burning and fire propagates to all adjacent cells, but [0,2],[2,0],[2,4],[0,4] need only 1 more minute to burn, so
After 1 minute, those cells are burnt and the cell propagates to their adjacent cells.
After 1 more minute, the rest of cells from step 3 end burning and fire propagates to their adjacent cells (that are already burnt, so nothing happens).
After 1 last minute, fire ends burning the whole terrain.

So the solution to that case is 8 minutes. If the fire starts in the top leftmost cell [0,0]:

11111     01111     00111     00011     00001     00000
12221  1  12221  1  02221  1  01221  1  00121  1  00011   1
12321 --> 12321 --> 12321 --> 02321 --> 01321 --> 00321  -->
12221     12221     12221     12221     02221     01221
11111     11111     11111     11111     11111     01111

00000     00000     00000     00000     00000
00000  1  00000  1  00000  1  00000  1  00000
00221 --> 00110 --> 00000 --> 00000 --> 00000
00221     00121     00020     00010     00000
00111     00011     00001     00000     00000

So now the total time is 10 minutes.

The challenge

Given a NxM matrix (N>0, M>0) of integer values that represent the time every cell needs to be completely consumed, write the shortest program/function that takes that matrix and a pair of integers with the position the fire starts in, and returns/prints the time needed for the fire to completely consume the whole terrain.

Every cell will have a positive (non-zero) burn time. You cannot assume a maximum value for the cells.
The matrix does not need to be square nor symmetric.
The matrix can be 0-indexed or 1-indexed, as you like.
The position can be given as a single parameter with a tuple of integers, two separate parameters of whatever other reasonable format.
The dimensions of the matrix cannot be specified as input parameters.
You do not need to output every intermediate step, just the amount of time asked. But I won't complain if the steps are visualized in any way.

Another example:

Fire starts at [1,1] (a '>' represents a minute):

4253   4253   4253   4153   4043   3033   2023    0001   0000
2213 > 2113 > 2013 > 1003 > 0002 > 0001 > 0000 >> 0000 > 0000
1211   1211   1211   1111   1001   0000   0000    0000   0000

Output: 9

This is code-golf, so may the shortest program for each language win!

Matlab, 235 257 190 182 178 bytes

Input: Matrix A, 1x2 vector p containing the starting coordinates.

function t=F(A,p)
[n,m]=size(A);x=2:n*m;x(mod(x,n)==1)=0;B=diag(x,1)+diag(n+1:n*m,n);k=sub2ind([n m],p(1),p(2));t=max(distances(digraph(bsxfun(@times,((B+B')~=0),A(:))'),k))+A(k)

Explanation:

Instead of simulating the the fire propagation, we can also understand this as a "find the longest shortest path" problem. The matrix is converted into a weighted directed graph. The weights of the paths to a single node correspond to the time to burn said node. E.g. for a matrix

5   7   7   10
5   2   2   10
4   5   2   6

we get the connected graph:

Where node 1 is the upper left matrix element and node 12 the lower right element. Given starting coordinates p, the shortest path to all other nodes is calculated. Then the length of the longest path of those shortest paths + the time to burn the initial node equals to the time to burn the whole matrix.

Ungolfed and commented version with sample starting values:

% some starting point
p = [3 2];
% some random 5x6 starting map, integers between 1:10
A = randi(10,5,6);

function t=F(A,p)
% dimensions of A
[n,m] = size(A);
% create adjacency matrix
x=2:n*m;
x(mod(x,n)==1)=0;
B = diag(x,1)+diag(n+1:n*m,n);
B = B+B';
B = bsxfun(@times,(B~=0),A(:))';
% make graph object with it
G = digraph(B);
% starting node
k = sub2ind([n m], p(1), p(2));
% calculate the shortest distance to all nodes from starting point
d = distances(G,k);
% the largest smallest distance will burn down last. Add burntime of initial point
t = max(d)+A(k);


Are the two sets equal {}is the empty set. You may use () or [] if you choose.

We aren't going to rigorously define "set", but sets all satisfy the following properties:

Sets follow the usual mathematical structure. Here are some important points:

Sets are not ordered.
No set contains itself.
Elements are either in a set or not, this is boolean. Therefore set elements cannot have multiplicities (i.e. an element cannot be in a set multiple times.)
Elements of a set are also sets and {} is the only primitive element.

Task

Write a program/function that determines whether two sets are equal.

Input

Two valid sets via stdin or function argument.  The input format is loose within reason.

Some valid inputs are:

{} {{}}
{{},{{}}} {{{{{},{{}}}}}}
{{},{{},{{}}}} {{{},{{}}},{{{{{},{{}}}}}}}

Invalid inputs:

{{} {}              Brackets will always be balanced.
{{},{}} {}          Set contains the same element twice

Output

A truthy value if the inputs are equal, falsy otherwise.

Test cases

Your submission should answer correctly for all valid inputs, not just for the test cases. These may be updated at any point.

Truthy:

{} {}
{{},{{}}} {{{}},{}}
{{},{{},{{{}},{}}}} {{{{},{{}}},{}},{}}

Falsy:

{} {{}}
{{},{{},{{{}},{}}}} {{{{}}},{},{{}}}
{{},{{}},{{{}}},{{},{{}}}} {}

Scoring

code-golf

Additional Rules

An additional rule has been added banning unordered iterable types altogether. They are too common and trivialize this challenge far too much. Feel free to leave answers that violate this in place, please just make an indication that they were made before the rule change.

CJam, 11 bytes
q']/"]$"*~=

Try it here.
CJam, 13 bytes
q~L{{j}%$}j:=

Try it here.


Computational Parity Party! The computational parity of an integer is defined as 1 if the integer has an odd number of set bits, and 0 otherwise. (src).
Input

You will receive one nonnegative integer that you will take the parity of. Optionally, you may take the size of the integer in bytes or bits as an argument, but you must specify this in your answer.

Output

You will output the computational parity of the input integer.

Rules

Standard loopholes apply, including but not limited to Abusing native number types to trivialize a problem.

Test cases
You may omit any input that cannot be represented with your language's built-in integer type.
0: 0
1: 1
3: 0
8: 1
13: 1
17: 0
40: 0
52: 1
100: 1
127: 1
365: 0
787: 1
2898: 0
6345: 0
9038: 1
10921: 1
16067: 1
4105748: 1
40766838: 0
1336441507: 1
4294967295: 0

Generated using this program.
The answer with the least amount of bytes in each language wins, which means that I will not be accepting an answer.
Bonus imaginary Internet points for an explanation.
Sandbox link (10k+)

JavaScript (ES6),  18  17 bytes
Similar to my answer to Is this number evil? except that the last iteration returns \$0\$, which saves a byte.

f=n=>n&&!f(n&~-n)

Try it online!

JavaScript (ES6), 30 bytes
Converts to binary, parses as base-3 and returns the parity.

n=>parseInt(n.toString(2),3)&1

Try it online!


Easy binary triangle Given as input a positive integer n>=1, output the first n rows of the following triangle:

                  1
                1 0 1
              0 0 1 0 0
            1 1 1 0 1 1 1
          0 0 0 0 1 0 0 0 0
        1 1 1 1 1 0 1 1 1 1 1
      0 0 0 0 0 0 1 0 0 0 0 0 0
    1 1 1 1 1 1 1 0 1 1 1 1 1 1 1
  0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1

The rows alternate between all zeroes and all ones, except the center column is flipped.

Test cases

Input: 3
Output:

    1
  1 0 1
0 0 1 0 0

Input: 10
Output:

                  1
                1 0 1
              0 0 1 0 0
            1 1 1 0 1 1 1
          0 0 0 0 1 0 0 0 0
        1 1 1 1 1 0 1 1 1 1 1
      0 0 0 0 0 0 1 0 0 0 0 0 0
    1 1 1 1 1 1 1 0 1 1 1 1 1 1 1
  0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1

Your code must work for any n<100. This is code-golf, hence the shortest code in bytes wins!

Trailing spaces / newlines and leading newlines are allowed!

Jelly, 7 bytes

Ṭ=Ḃµ€ŒB

Try it online!

-1 byte thanks to Erik the Outgolfer

Explanation

Ṭ=Ḃµ€ŒB  Main link
    €    For each element in (implicit range of) the input:
Ṭ        List 1s and 0s with 1s in the indices in the left argument (generates `[0, 0, ..., 1]`)
 =Ḃ      Is this equal to `(z % 2)` where `z` is the range number? (Every other row is flipped)
     ŒB  Reflect each row


Implementing bool() without any conditionals Title says it all. Given some input, turn it into a boolean value (0 or 1), without using conditional statements (e.x. == > < <= >= != ~=), or any function which uses conditional statements within its implementation, such as if, while and for. Your program must work with floating points, although you get more if it works with other items.

A general rule for determining whether bool(item) is False is if the item is empty ('' is an empty string, [] is an empty list.), or if the function used to turn an item of one type into another is given no input (in Python, str() returns '', list() returns [].)

Here are (some of) the different valid types. Your program is considered to work with one type if it works with one item in the following lists:

Integers, floating points, doubles, longs
Strings
Lists, tuples, arrays (bytearrays)
Dictionaries
Functions
Objects/Classes

Program score will be calculated like this: [# of characters]-(50*[# of types]). The program with the smallest score wins the challenge.

Python - 122 chars - 50*13 types = -528

def b(x=False):
 try:return[False][x]
 except IndexError:return True
 except:
  try:return b(len(x))
  except:return True

Works for the following built-in types (as listed in §3.2 The standard type hierarchy)

NotImplemented
Ellipsis
int
long
bool
string
unicode
tuple
list
bytearray
set
frozenset
dict


Domino Recurrence Generator Challenge
We once had a challenge to count domino tilings of m by n grid, and we all know that, for any fixed number of rows, the number of domino tilings by columns forms a linear recurrence. Then why not have a challenge to compute the linear recurrence?!
Let's define \$D_m(n)\$ as the number of domino tilings on a grid of \$m\$ rows and \$n\$ columns. Then the task is: given a single integer \$m \ge 1\$ as input, output the linear recurrence relation for \$D_m(n)\$.
If the relation has order \$k\$ (that is, \$D_m(n+k)\$ depends on \$k\$ previous terms), you need to output the coefficients \$a_i\$ of the recurrence relation
$$
D_m(n+k)=a_{k-1}D_m(n+k-1) + a_{k-2}D_m(n+k-2) + \cdots + a_0 D_m(n)
$$
in the order of \$a_0\$ to \$a_{k-1}\$ or the reverse. There are infinitely many correct such relations; you don't need to minimize the order of the relation. But, to ensure that the result is at least minimally useful, the order \$k\$ cannot exceed \$2^m\$ for any input value of \$m\$.
(Side note: An actual sequence is defined only if the initial \$k\$ terms are given along with the recurrence equation. That part is omitted for simplicity of output, and to give incentive to approaches not using the brute-forced terms.)
Note that, for odd \$m\$, every odd-column term will be zero, so you will get a recurrence different from the OEIS entries which strip away zeroes (e.g. 3 rows, 5 rows, 7 rows).
Standard code-golf rules apply. The shortest code in bytes wins.
Examples
Here are the representations from the OEIS, adjusted for odd \$m\$. Initial terms start at \$D_m(0)\$, and the coefficients are presented from \$a_{k-1}\$ to \$a_0\$. Again, your program only needs to output the coefficients. To empirically check the correctness of your output of length \$k\$, plug in the \$k\$ initial terms from the respective OEIS entry, and see if the next \$k\$ terms agree.
m = 1
Initial terms [1, 0]  # D(0) = 1, D(1) = 0
Coefficients  [0, 1]  # D(n+2) = D(n)

m = 2
Initial terms [1, 1]
Coefficients  [1, 1]

m = 3
Initial terms [1, 0, 3, 0]
Coefficients  [0, 4, 0, -1]  # D(n+4) = 4D(n+2) - D(n)

m = 4
Initial terms [1, 1, 5, 11]
Coefficients  [1, 5, 1, -1]

m = 5
Initial terms [1, 0, 8, 0, 95, 0, 1183, 0]
Coefficients  [0, 15, 0, -32, 0, 15, 0, -1]

m = 6
Initial terms [1, 1, 13, 41, 281, 1183, 6728, 31529]
Coefficients  [1, 20, 10, -38, -10, 20, -1, -1]

Possible approaches
There is at least one way to find the recurrence without brute forcing the tilings, outlined below:

Compute the transition matrix \$A\$ of \$2^m\$ states, so that the target sequence is in the form of \$D_m(n) = u^T A^n v\$ for some column vectors \$u,v\$.
Find the characteristic polynomial or minimal polynomial of \$A\$ as

$$x^k - a_{k-1}x^{k-1} - a_{k-2}x^{k-2} - \cdots - a_0 $$

Then the corresponding recurrence relation is

$$s_{n+k} = a_{k-1}s_{n+k-1} + a_{k-2}s_{n+k-2} + \cdots + a_0s_n$$
An example algorithm of computing the minimal polynomial of a matrix can be found on this pdf.
(Of course, you can just brute force the domino tilings for small \$n\$ and plug into a recurrence finder.)

APL (Dyalog Unicode), 72 bytes
{⍵=1:⍳2⋄(2*⌈⍵÷2)(⌷⌹⍉⍤↑)⍉L↑⍉↑,¨+.×\(L←2*⍵)⍴⊂∘.((0∊+)⍱1∊2|×≢¨⍤⊆⊣)⍨⍸1⍴⍨⍵⍴2}

Try it online! (uses a polyfill for ⍤ since TIO is not updated to 18.0 yet)
Requires ⎕pp←2 (implicit rounding of output) and ⎕IO←0 (0-indexing).
We compute a transition matrix, then use the approach listed in S. Białas and M.Białas to find the minimum polynomial and hence the recurrence relation.
Defining the Transition Matrix
Each possible binary fill of a column of \$m\$ cells is one state, so there are \$2^m\$ states.
For m=3, one example state (1 0 0) is
█
▒
▒

The first cell is filled (it is the right side of a horizontal domino sticking out from the previous column), but the second and third cells are empty. This could occur e.g. as the second column in the following tiling (n=4, 3×4 grid):
━━┃┃
┃┃┃┃
┃┃━━

When considering state transitions, we have to be careful to avoid double counting.
My approach is to require full horizontal dominos to be placed whenever possible, then vertical dominos can optionally be placed in the next state's column.
For example, if the current state is 1 0 0:
█
▒
▒

then we force horizontal dominos on the bottom two rows
█▒
━━
━━

so the next state would have to be 0 1 1:
▒
█
█

This rule guarantees the current column to be filled in completely. In addition, it avoids double-counting transitions because it never places vertical dominos in the current column.
Vertical dominos go in the next column. There is no space for vertical dominos in the past example. As an example where vertical dominos can be placed, take the current state to be 1 1 1:
█▒
█▒
█▒

One possibility would be to place no vertical dominos at all, so 1 1 1 → 0 0 0 is a valid state transition.
In addition, a vertical domino can be placed in either of two positions:
█┃        █▒
█┃   or   █┃
█▒        █┃

so 1 1 1 → 1 1 0 and 1 1 1 → 0 1 1 are valid state transitions.
Obtaining the Recurrence from the Transition Matrix.
The paper describes the approach well, but I modified it a little while golfing.
As given, the problem is to find coefficients \$a_i\$ for a given recurrence order \$k\$ such that, for all \$n\$¸
$$a_0 D_m(n) + a_1 D_m(n+1) + \cdots + a_{k-1}D_m(n+k-1) = D_m(n+k)$$
With regards to powers of the transition matrix \$A\$, this can be rewritten as finding coefficients $c_i$ such that
$$c_1 A^1 + c_2 A^2 + \cdots + c_k A^k = A^{k+1}$$
(the paper starts with \$A^0=I_L\$, but that is expensive in terms of bytes)
Let \$L=2*m\$ be the width (and height) of the transition matrix \$A\$. Denoting the entries of \$A^i\$ as \$a_{11}^{(i)}, a_{12}^{(i)}, \ldots a_{LL}^{(i)}\$, we can rewrite the recurrence as \$L^2\$ equations
$$
\begin{align*}
c_1 a_{11}^{(1)} + c_2 a_{11}^{(2)} + &\cdots + c_k a_{11}^{(k)} = a_{11}^{(k+1)} \\
c_1 a_{12}^{(1)} + c_2 a_{12}^{(2)} + &\cdots + c_k a_{12}^{(k)} = a_{12}^{(k+1)} \\
&\;\;\,\vdots \\
c_1 a_{LL}^{(1)} + c_2 a_{LL}^{(2)} + &\cdots + c_k a_{LL}^{(k)} = a_{LL}^{(k+1)}
\end{align*}
$$
Treating \$a_{hi}^{(j)}\$ as constants (since we know \$A\$), this is a system of \$L^2\$ equations in \$k\$ variables \$c_i\$.
Let \$B\$ be the augmented matrix for this massive system of equations for \$k=L\$. Solving the full \$B\$ would give a recurrence of order \$L=2^m\$, but we need a smaller recurrence.
To find a smaller recurrence, we simple use a smaller \$k\$. The bulk of the paper is in proving that the minimum possible \$k\$ is the rank of \$B\$. However, for this specific problem, the minimum \$k\$ is \$k_0=2^{\lceil \frac{m}{2} \rceil}\$ (Source --- floor since the row \$k\$ has \$m=k-1\$). Thus we can take the \$k_0 \times (k_0+1)\$ submatrix at the top left of \$B\$ and solve it to find the \$k_0\$ coefficients of a useful recurrence.
{⍵=1:⍳2⋄(2*⌈⍵÷2)(⌷⌹⍉⍤↑)⍉L↑⍉↑,¨+.×\(L←2*⍵)⍴⊂∘.((0∊+)⍱1∊2|×≢¨⍤⊆⊣)⍨⍸1⍴⍨⍵⍴2}
{...} ⍝ Dfn with right argument m
⍵=1:⍳2⋄ ⍝ Special case m=1: return [0 1]
⍝ Compute the transition matrix A:
 ⍸1⍴⍨⍵⍴2  ⍝ All 2^m states: cartesian m-th power of [0 1]
            ⍝ (m=1 yields a vector of scalars rather than vectors, which is why we need a special case for m=1)
 ∘.{...}⍨ ⍝ Outer product with itself (all current→next state pairs) using function:
  ⍱         ⍝ Neither of the following are true:
  (0∊+)       ⍝ 0→0 in mapping (invalid since we require a horizontal domino when the current state has a 0)
  1∊2|×≢¨⍤⊆⊣  ⍝ Some run of 1→1 has odd length (requires a half vertical domino, impossible)
⍝ Compute the minimal polynomial of A
 +.×\(L←2*⍵)⍴⊂ ⍝ Produce matrix powers of A: A, A*2, ... A*L, where L=2*m
 ↑,¨           ⍝ B: Ravel each (Vec A*k) and join into single (L×L) × L matrix
 ⍉L↑⍉          ⍝ B': Trim to first L rows (for numerical stability in later gauss-jordan elimination)
 (2*⌈⍵÷2) ⍝ Rank r
 ⌷⌹⍉⍤↑ ⍝ Compute recurrence coefficients α←first r entries of b˜÷B̃
  ⍉⍤↑   ⍝ B̃: columns 0 to r-1, inclusive, of B' (taller than B̃ in paper)
  ⌷     ⍝ b˜: r-th column of B' (taller than b˜ of paper)
  ⌹     ⍝ matrix divide b˜÷B̃ to get coefficients


Divide Two Numbers Using Long Division Your challenge is to divide two numbers using long division. The method we used to use in old days of school to divide two numbers.

Example here
You should NOT use / or any other division operator in your code.

Also, this is not ascii-art

Example:

Input  : 4 2 (4 divided by 2)

Output : 2 0 (here 2 is quotient and 0 is remainder)

Another example

Input  : 7182 15 (7182 divided by 15)

Output : 478 12 (7170 is quotient and 12 is remainder)

The answer with most up-votes after 24 hours wins because this is a popularity contest.

C

Not exactly a long division - this answer uses the method used in the real old days.

#include <stdio.h>
#include <stdlib.h>
int main() {
    int a,b;
    scanf("%d %d", &a, &b);
    int *p=calloc(b, sizeof(int));
    int *q=p;
    while(a--) {
        (*p)++;
        if(p-q<b-1) p++;
        else p-=b-1;
    }
    p=q;
    int r=0, i;
    for(i=0; i<b; i++) r+=p[i]-p[b-1];
    printf("%d %d\n", p[b-1], r);
    return 0;
}

Explanation:

Suppose you are given a number of sheep and you need to split them up into b number of groups. The method used here is to assign each sheep into a different group until the total number of groups reaches b, then start from the first group again. This repeats until there are no more sheep. Then, the quotient will be the number of sheep in the last group, and the remainder will be the sum of the differences between each group and the last group.

An illustration for 8/3:

       |Group 1 | Group 2 | Group 3
-------------------------------------
       | 1      | 2       | 3        // first sheep in group 1, second sheep in group 2, etc
       | 4      | 5       | 6
       | 7      | 8       |
-------------------------------------
total: | 3      | 3       | 2

So the quotient is 2 and the remainder is (3-2)+(3-2)=2.


Integer Division Loops Challenge

Given any positive integer supported by your language:

Take the input and divide it into two halves. For all divisions in this program, if the input is odd, round one half up and one half down (ex: 7 -> 3,4, not 7 -> 3.5,3.5).
Divide either number in half, then take the larger of these two new halves and add it back to the number that wasn’t split. Ex: 3,4 -> (1,2),4 -> 1,6 or 3,4 -> 3,(2,2) -> 5,2.
Repeat step 2 until you reach a set you have seen before. Ex: 5 -> 3,2 -> (1,2),2 -> 1,4 -> 1,(2,2) -> 3,2. Since we’ve seen 3,2 before, we may stop repeating. You may completely exhaust a stack in the process of doing this. Ex: 5 -> 3,2 -> (1,2),2 -> 1,4 -> (0,1),4 -> 0,5.
Output each pair in the loop (i.e. the above without the intermediate steps, from the first appearance of a pair until the second, but not including the second). Ex: 3,2 -> 1,4. If the input is included, don’t output a 0 with it - 5 -> 3,2 -> 1,4, not 0,5 -> 3,2 -> 1,4.
Repeat steps 1-4 by splitting the pairs differently.

I/O

Input is a positive integer larger than 1 and smaller than either the maximum integer supported by your language or the maximum integer that won’t crash the computer, whichever is smaller.

Output is the loops from above in any format you want (string, list, array, etc.). Trailing white space is allowed.

Do not output the same loop twice, nor different versions of the same loop. Ex: 2 -> 1,1 and 1,1 -> 2 are both valid loops, but they describe the same loop, beginning at different points on the loop. Likewise, two loops that are identical but go in the reverse order should not be outputted. Ex: 3 -> 1,2 -> 2,1 and 3 -> 2,1 -> 1,2 are the same loop, but they go in the opposite direction from each other.

You may use any delimiter to differentiate between the pairs, between each number in the pairs, and between each loop, provided that they are three distinct chars or strings. Above, I divided the numbers using commas, the pairs using ->’s, and the loops using boring instructions. In my examples below, I will use parentheses around each pair, commas between each number within a pair, and new lines between each loop.

Examples

Credit to @WheatWizard’s code for fixing up my examples list. As I said in an earlier draft, I was sure I was missing a few since I was doing it by hand, but boy was I missing some.

Input: 2
Output: (2)(1,1)

Input: 3
Output:

(3)(1,2)
(1,2)(2,1)
(3)(1,2)(2,1)

Input: 4
Output:

(4)(2,2)(1,3)
(1,3)(3,1)
(4)(2,2)(1,3)(3,1)
(4)(2,2)(3,1)(1,3)
(3,1)(1,3)
(4)(2,2)(3,1)

Input: 5

Output:

(5)(2,3)(1,4)
(1,4)(3,2)
(2,3)(1,4)(3,2)(4,1)
(5)(2,3)(1,4)(3,2)(4,1)
(2,3)(4,1)
(5)(2,3)(4,1)

Input: 6

Output:

(6)(3,3)(1,5)
(1,5)(4,2)(2,4)
(4,2)(2,4)
(1,5)(4,2)(5,1)(2,4)
(4,2)(5,1)(2,4)
(6)(3,3)(1,5)(4,2)(5,1)
(6)(3,3)(5,1)(2,4)(1,5)
(2,4)(1,5)(4,2)
(5,1)(2,4)(1,5)(4,2)
(2,4)(4,2)
(5,1)(2,4)(4,2)
(6)(3,3)(5,1)

Input: 7

Output:

(7)(3,4)(1,6)
(1,6)(4,3)(2,5)
(2,5)(5,2)
(3,4)(1,6)(4,3)(2,5)(5,2)(6,1)
(7)(3,4)(1,6)(4,3)(2,5)(5,2)(6,1)
(3,4)(1,6)(4,3)(6,1)
(7)(3,4)(1,6)(4,3)(6,1)
(7)(3,4)(5,2)(2,5)(1,6)
(2,5)(1,6)(4,3)
(3,4)(5,2)(2,5)(1,6)(4,3)(6,1)
(7)(3,4)(5,2)(2,5)(1,6)(4,3)(6,1)
(5,2)(2,5)
(3,4)(5,2)(6,1)
(7)(3,4)(5,2)(6,1)

Scoring

This is code-golf, so the lowest byte count wins.

This is my first challenge here, so any feedback would be greatly appreciated. Link to sandbox here.

Fun fact: I was bored one day and playing with random little pieces of pencil lead in this manner and eventually noticed that I could keep going in these types of loops. For some reason my first reaction was “hey, this would be a great challenge for code golf.”

Haskell, 227 203 bytes

17 bytes saved thanks to Οurous

(%)=div
u x|odd x=x%2+1|1>0=x%2
[0,b]!l=[b]!l
[b,0]!l=[b]!l
t!l|elem t l=[dropWhile(/=t)l]
t@[a,b]!l|q<-l++[t]=[a%2,u a+b]!q++[u b+a,b%2]!q
f x|q<-[x%2,u x]![[x]]=[a|(a,b)<-zip q[0..],notElem a$take b q]

Try it online!


Minimum number of changes required Given an array where each number represent a color. After iterating each item in the array (for each item in the iteration the pointer can also point to the second-item-to-the-right), and the two colors in the iteration is the same, do the following checking:

If there is a different color between the pointed colors, the colors will "dissolve" (which is not allowed).

eg.:  [1,2,1] is not allowed but [1,1,2,2] is allowed. Here is an explanation for the above test cases:

[1, 2, 1]
 ^     ^

We find that the two pointed items have the same color. We then realize that the color between the pointed items are different than the two same colors; this ensures a "dissolving".

The following is an explanation of the second example:

[1, 1, 2, 2]
 ^     ^

In this step, the atoms are different, so we don't perform the check.

[1, 1, 2, 2]
    ^     ^

In this step the atoms are still different. All colors do not "dissolve", ensuring a valid array.

We can change one color to another but the condition is if we change one color, then we have to change all of its occurrences in the array. The cost of changing color is the number of appearances of the color in the array.

eg.: if the array is [1,2,1,2,1,3,2] and we have decided to change 2 to 1, then our array will become [1,1,1,1,1,3,1] and the cost will be 3 (for changing three 2's to 1's)

We have to minimize the cost and make sure no color dissolves.

Test cases

[1,1,3,3,2,2] -> 0 (no changes are required to prevent dissolving)
[1,3,1,3,1] -> 2 (change all 3's to 1's costs 2)
[1,1,2,3,2,3]-> 2 (change color of all 2's to 3's OR change color of all 3's to 2's)
[1,2,2,2] -> 0 (This is valid; in the second iteration, the color between the pointed colors are equal to the pointed colors.)
[1,2,1,2,1,3,2] -> 3 (the 1's must be changed to make the array valid, and there's 3 of them)

Perl 5, 92 bytes

sub f{min map{$o=$_;map{$s="@_";$c=!/$o/*$s=~s,$o,$_,g;$s=~/(.) (.) \1/&&$1-$2?9e9:$c}@_}@_}

Try it online!

sub f{                        #ungolfed:
  min                         #minimum of the yielded list of numbers (from core module List::Util)
  map{                        #map: outer loop of f()'s input args
    $o=$_;                    #keep $o (outer) loop element
    map{                      #map: inner loop of f()'s input args
      $s="@_";                #$s string are input args (input chars) concatenated with no separation
      $c=!/$o/*$s=~s,$o,$_,g; #$c becomes 0 if inner and outer loop elements are equal
                              #otherwise $c becomes the number of changes on the input
                              #$s string when swapping $o with $_ (outer and inner loop variable)
      $s=~/(.) (.) \1/&&$1-$2 #check if $s after the swapping is valid: no three consecutive chars
                              #...should exists in $s where 1st and 3rd are equal but 2nd is not
        ? 9e9                 #yield big number 9e9 if $s is invalid to make sure it wont be the minimum
        : $c                  #yield the number of swaps if $s is valid
    }
    @_                       #input arg's
  }
  @_                         #input arg's, outer loop
}


Implement DES key expansion I wanted to make a challenge to do the full DES encryption algorithm, but that may be a bit too involved to get a ton of participation. This challenge is to simply generate the 16 48-bit subkeys used to encrypt data:

The algorithm is described well enough on wikipedia, and all relevant shift tables and such data are on this page.

Your task is to write a program or function that accepts 64 bits of input, and outputs the 16 48-bit keys. I am not picky about input or output formats, but hex coded is fairly standard.

You can check your results against the examples on this page, or this page

Shortest code wins.

GolfScript (175 chars)

I assume input and output in MSB-first upper-case hex.

For want of good test cases, I don't guarantee that this implementation is correct. I've worked to a test case which I derived from Rivest's simple test for implementations of DES: given his test input of 9474B8E8C73BCA7D I think that the expected output is

BE23F4265E76
63FD57CA5952
6DEDC3C5E33C
73E5BBF11EC8
FD8593D8923F
778A9F177EAC
3FB0963839F1
3E0CFEA3E837
41FFD1A34BCB
55FDE796B313
F3E5C3F70764
79C7A758ABCA
F1919F74F41D
3582F76B34EA
B758B6ACF92B
44FF4B3F4D29

To that caveat I must add another, which is that I use a lot of base conversion including some of strings with non-printable characters. As usual, I'll give the program in a couple of ASCII-safe formats. xxd output:

0000000: 312f 7b31 302c 2727 2a37 312c 3635 3e2b  1/{10,''*71,65>+
0000010: 3a5e 5c3f 3136 2b32 7b62 6173 657d 3a42  :^\?16+2{base}:B
0000020: 7e28 3b7e 7d25 607b 3d7d 2b5b 3536 5b5b  ~(;~}%`{=}+[56[[
0000030: 2d38 5d32 342a 372f 2e2b 2739 3939 1b37  -8]24*7/.+'999.7
0000040: 3717 275d 7a69 705b 5d2a 5b5d 2a7b 3124  7.']zip[]*[]*{1$
0000050: 2b7d 2f5d 2534 3932 3831 2032 427b 2129  +}/]%49281 2B{!)
0000060: 7b32 382f 7b28 2b7d 257e 2b7d 2a27 1d3c  {28/{(+}%~+}*'.<
0000070: f9df 2a9b 7079 2030 dea2 83df 3bca a82f  ..*.py 0....;../
0000080: 50ec 11f8 e55c 74d2 f104 b2ae 130e ac5c  P....\t........\
0000090: d627 27ff 3827 7b42 7d2f 7b31 243d 7d25  .''.8'{B}/{1$=}%
00000a0: 342f 7b32 425e 3d7d 256e 2b5c 7d2f 3b    4/{2B^=}%n+\}/;

Base-64 encoded:

MS97MTAsJycqNzEsNjU+KzpeXD8xNisye2Jhc2V9OkJ+KDt+fSVgez19K1s1NltbLThdMjQqNy8u
Kyc5OTkbNzcXJ116aXBbXSpbXSp7MSQrfS9dJTQ5MjgxIDJCeyEpezI4L3soK30lfit9KicdPPnf
KptweSAw3qKD3zvKqC9Q7BH45Vx00vEEsq4TDqxc1icn/zgne0J9L3sxJD19JTQvezJCXj19JW4r
XH0vOw==

And with the magic strings substituted with a printable (but longer) version using escape characters and some unnecessary line-breaks:

1/{10,''*71,65>+:^\?16+2{base}:B~(;~}%`{=}+
[56[[-8]24*7/.+'999\e77\027']zip[]*[]*{1$+}/]
%49281 2B{!){28/{(+}%~+}*
'\035<\371\337*\233py 0\336\242\203\337;\312\250/P\354\021\370\345\\t\322\361\004\262\256\023\016\254\\\326'
'\3778'{B}/{1$=}%4/{2B^=}%n+\}/;

This is a pretty literal translation. The vaguely interesting bits are:

Permutation PC1 turns out to have a lot of structure. If you take first differences, all but 6 of them are -8. The second line of the reformatted version reconstructs it from these differences in 39 characters. For comparison, representing it by base conversion would require 44 characters for the string literal; and representing a generic permutation of numbers 1 to 63 requires 36 base-256 digits (i.e. a 38-character string literal plus code to convert it).
49281 2B{!) ... } encodes the shift lengths. This is the most obvious place to attempt further optimisation.
Permutation PC2 doesn't seem to have any usable structure, so that's a straight double base conversion. (Not to be confused with a double bass conversion).


Is it a factor of a polynomial? A polynomial is divisible by a factor (x-n) if f(n)=0 for a function f.  Your job: to determine if a polynomial function f(x) is divisible by (x-n).

The input

The input is in the form of (x-n), (Polynomial).  Remember, if n is negative, (x-n) will be in the input form of (x+n).  For the polynomial, all exponents will be put in as ^.  Coefficients will be written next to the variable x.  An example polynomial could be 2x^2 + x^1.  There will be no spaces between anything. The term x will be inputed as x^1.  So what would "normally" look like (x - 1) will be (x^1-1).  The coefficients and powers will always be integers.  The coefficient one will be implicit if it is just x. I.e., x can be interpreted as 1x

The output

A boolean value.  Truthy, or Falsey.

Thanks to @AlexA. For helping me clarify this!

Examples

Input:(x^1-1),(x^1-1)
Output: True

Input: (x^1+2),(2x^2+4x^1+2)
Output: False

Input: (x^1+7),(x^2-49)
Output: True

Rules

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

Unfortunately, I don't know how to implement the snippet leaderboard.  If anyone knows how, feel free to edit the post.

Pyth - 39 bytes
This is a monstrous combination of regexp and eval. I like the approach, but will try to improve the implementation.
It uses the Polynomial Remainder Theorem.
K_sPe:z"-|\+"3!v.ssXPtw,\^\x,"**""*K"\*

Doesn't work online because of eval use.


Who was the biggest "Weekend Update" host during that time period? These are the hosts of the "Weekend Update" news segment on Saturday Night Live, with the years they hosted and their initials:

Chevy Chase         1975-1976  CC
Jane Curtain        1976-1980  JC
Dan Aykroyd         1977-1978  DA
Bill Murray         1978-1980  BM
Charles Rocket      1980-1981  CR
Gail Matthius       1981       GM
Brian Doyle-Murray  1981-1982  BD
Mary Gros           1981-1982  MG
Christine Ebersole  1982       CE
Brad Hall           1982-1984  BH
Christopher Guest   1984-1985  CG
Dennis Miller       1985-1991  DM
Kevin Nealon        1991-1994  KN
Norm MacDonald      1994-1997  NM
Colin Quinn         1998-2000  CQ
Jimmy Fallon        2000-2004  JF
Tina Fey            2000-2006  TF
Amy Poehler         2004-2008  AP
Seth Meyers         2006-2014  SM
Cecily Strong       2013-2014  CS
*Colin Jost         2014-pres  CJ
*Michael Che        2014-pres  MC

*At the time of this writing, present is 2017.

I got most of the years this website, but later ones I got from Wikipedia.

The task is simple. Given a range of years, output the initials of the person who was host during the most years in that time period. If there is a tie, output the initials of all the hosts that tied. Note that sometimes "Weekend Update" only has 1 host and sometimes it has 2.

For example, if the input is 1984-1985, output CG because he was the only person to host during both of those years.

Specifics

Input is flexible, but it will always consist of a start year and a later end year. Also you don't need to include the first two digits of the year: 95-05 is fine for 1995-2005.
Assume all ranges are inclusive: 1982-1984 means 1982,1983,1984.
For input, the earliest start year is 1975 and the latest end year is 2017

Examples

1983-1987 => DM (he hosted '85,'86,'87`)
1999-2001 => CQ JF TF [CQJFTF also ok] (all hosted during two of those years)
1975-2017 => SM (has 9 years!)
1990-2000 => KN NM (both have 4 years)
2013-2015 => SM CS CJ MC (all have 2 years)

Python 2, 291 bytes

def f(b,e):
 s=''.join('A AB BC BCD BD BDE EFGH GHJ J JK KL L L L L L LM M M MN N N N O O OPQ PQ PQ PQ PQR QR QRS RS RS S S S S ST STUV UV UV UV'.split()[b-1975:e-1974]);C=s.count;return''.join({'CJDBCGBMCBCDKNCJTASCCMCCAMRMDGEHGMNMQFFPMSJC'[ord(h)-65::22]for h in s if C(h)==max(map(C,s))})

Try it online!


General tips for representing large numbers Sometimes, while golfing, one needs to represent large number(s) in their code. Writing them as is can significantly increase the byte-count.

What general1 tips do you have for representing long numbers concisely in code?

Please post one tip per answer.

1With general, I mean tips that can be applied to more than a single language. For language-specific tips, post in their respective thread.

Look out for special numbers

Some languages have built-in functions for squares, exponentiation with base 2, n-th prime, factorial, or other procedures that can generate large numbers. Check if you number happens to fall into any of those categories.

And if it doesn't, it may happen that a larger number that does will fit for your purposes and can be used instead.


Do I have a twin with permutated remainders? We define \$R_n\$ as the list of remainders of the Euclidean division of \$n\$ by \$2\$, \$3\$, \$5\$ and \$7\$.
Given an integer \$n\ge0\$, you have to figure out if there exists an integer \$0<k<210\$ such that \$R_{n+k}\$ is a permutation of \$R_n\$.
Examples
The criterion is met for \$n=8\$, because:

we have \$R_8=(0,2,3,1)\$
for \$k=44\$, we have \$R_{n+k}=R_{52}=(0,1,2,3)\$, which is a permutation of \$R_8\$

The criterion is not met for \$n=48\$, because:

we have \$R_{48}=(0,0,3,6)\$
the smallest integer \$k>0\$ such that \$R_{n+k}\$ is a permutation of \$R_{48}\$ is \$k=210\$ (leading to \$R_{258}=(0,0,3,6)\$ as well)

Rules

You may either output a truthy value if \$k\$ exists and a falsy value otherwise, or two distinct and consistent values of your choice.
This is code-golf.

Hint

 Do you really need to compute \$k\$? Well, maybe. Or maybe not.

Test cases
Some values of \$n\$ for which \$k\$ exists:
3, 4, 5, 8, 30, 100, 200, 2019

Some values of \$n\$ for which \$k\$ does not exist:
0, 1, 2, 13, 19, 48, 210, 1999

R, 63 59 bytes

s=scan()%%c(2,3,5,7);i=which(s<c(0,2,3,5));any(s[i]-s[i-1])

Try it online!

-4 bytes thanks to Giuseppe

(The explanation contains a spoiler as to how to solve the problem without computing \$k\$.)

Explanation:
 Let \$s\$ be the list of remainders. Note the constraint that s[1]<2, s[2]<3, s[3]<5 and s[4]<7. By the Chinese Remainder Theorem, there exists a \$k\$ iff there is a permutation of \$s\$, distinct from \$s\$, which verifies the constraint. In practice, this will be verified if one of the following conditions is verified:

s[2]<2 and s[2]!=s[1]
s[3]<3 and s[3]!=s[2]
s[4]<5 and s[4]!=s[3]


I'm thinking of a number (Cop's Thread) Robber's Thread here

In this cops-and-robbers challenge cops will think of a positive integer.  They will then write a program or function that outputs one value when provided the number as input and another value for all other positive integer inputs.  Cops will then reveal the program in an answer keeping the number a secret.  Robbers can crack an answer by finding the number.

Here's the catch: this is not code-golf, instead your score will be the secret number with a lower score being better.  Obviously you cannot reveal your score while robbers are still trying to find it.  An answer that has not been cracked one week after its posting may have its score revealed and be marked safe.  Safe answers cannot be cracked.

It probably goes without saying but you should be able to score your answer.  That is you should know exactly what value is accepted by your decision machine.  Simply knowing that there is one is not enough.

Use of Cryptographic functions

Unlike most cops and robbers challenge which ask you not to use cryptographic functions, this challenge not only entirely allows them but encourages them.  You are free to create answers in any way as long as you are trying to win.  That being said, answers using other methods are also welcome here.  The goal of the challenge is to win, and as long as you don't cheat nothing is off the table.

Tampio, Cracked

m:n tulos on luvun funktio tulostettuna m:ään, missä luku on x:n kerrottuna kahdella seuraaja, kun x on luku m:stä luettuna
x:n funktio on luku sadalla kerrottuna sadalla salattuna, missä luku on x alempana sadan seuraajaa tai nolla
x:n seuraajan edeltäjä on x
x:n negatiivisena edeltäjä on x:n seuraaja negatiivisena
nollan edeltäjä on yksi negatiivisena
x salattuna y:llä on örkin edeltäjä, missä örkki on x:n seuraajan seuraaja jaettuna y:llä korotettuna kahteen
sata on kiven kolo, missä kivi on kallio katkaistuna maanjäristyksestä
kallio on yhteenlasku sovellettuna mannerlaatan jäseniin ja tulivuoren jäseniin
tulivuori on nolla lisättynä kallioon
mannerlaatta on yksi lisättynä mannerlaattaan
maanjäristys on kallion törmäys
a:n lisättynä b:hen kolo on yhteenlasku kutsuttuna a:lla ja b:n kololla
tyhjyyden kolo on nolla
x:n törmäys on x tutkittuna kahdellatoista, missä kaksitoista on 15 ynnä 6
x ynnä y on y vähennettynä x:stä

Run with:

python3 suomi.py file.suomi --io

The instructions for installing the interpreter are included in the Github page. Please tell if you have any difficulties running this.

   The program in pseudocode. The program performs very slowly because my interpreter is super inefficient. Also, I didn't use any opt-in optimizations available, which can reduce the evaluation time from several minutes to about 10 seconds.


Printing ascending ASCII, Robbers This is the robbers' thread. The cops' thread goes here.
In the cops thread, the task was to create a program that outputs printable ASCII characters in ascending order. The robbers task is to unscramble the code the cops used to produce this output.
The cracked code doesn't have to be identical, as long as it has the same length and any revealed characters are in the correct positions. The language must also be the same (version numbers can be different). The output must of course be identical. Cops can not use comments in their code, but robbers are free to use them.
The winner of the robbers thread will be the user who has cracked the
most submissions by January 7th 2016. If there's a tie, the user who has cracked submissions with the longest combined code will win.
The submission should be formatted like this:
Language, nn characters (including link to answer), Cop's username
Code:
alphaprinter

Output
abcdefghijklmnopqrstuvwxyz

Optional explanation and comments.
Leaderboard:
A crushing victory by Adnan!
Adnan: 7
Pietu1998: 3
Mitch Schwartz: 2
Quintopia: 2
Martin Büttner: 2
cat: 1
Dennis: 1
insertusernamehere: 1
isaacg: 1
jimmy23013: 1
MegaTom: 1
plannapus: 1
user81655: 1

Brainfuck, 48 bytes, Adnan
++++[>++++[>++++<-]<-]+++[>++++++++<-]>++[>+.<-]

Pretty straightforward, generating 64 and then 26. It might be a little red herring that
++++[>++++[>++++<-]<-]>>+

is a way to get 65, so you might try to do something like
++++[>++++[>++++<-]<-]>>+[>+++++>++<<-----]>>[<.+>-]

before noticing that it's a dead end.