text:
Curve Stitching
Curve stitching is the process of "stitching" together multiple straight lines in order to create a curve, like so:

For an explanation of curve stitching, visit this website.
We will be drawing our curve in the top left of the screen, as shown in the image above.
Given an integer n (via STDIN or a function parameter), being the number of lines to draw, and an integer p pixels, being the interval between the starting points, draw a straight line curve.
Horizontal/vertical lines are necessary, and should be part of the line count.

Example Outputs:
n = 25, p = 15

n = 20, p = 20

This is a code-golf challenge, so shortest code wins.

Oh yeah! D'oh...

The curve is in fact a parabola. I can't remember where I read that thoughl. If I was a pedant I would point out that it's not a "straight line curve" but an approximation of a curve built up from straight lines :-)

@Martin Yup, pixels.

@Martin The horizontal line shouldn't be necessary, because the border of the window will make up the lines.

@Martin Whoops! The program I used to create those images was somewhat rushed. It's no huge problem though, I added the images just to make sure that everyone understood the general look of the solution.

@Martin Okay, I will fix my code and redo the examples.

@Martin Actually, just gave this some more thought, it makes more sense to have the vertical and horizontal lines required.

@JamesWilliams Will you be changing your examples to include them (since it appears that they are not included currently)?

@steveverrill Don't you mean hyperbola instead of parabola?

Oh dayum I used to do this for fun when bored in class ... didn't know other people had done the exact same thing!

@flawr I mean a parabola. See http://math.stackexchange.com/q/551882/137034 and google. If you connect two coaxial circles in 3D with strings, you get a hyperboloid of revolution. Drawing one of those in 3D could be a whole other challenge....

what if n is 1 - do we draw a horizontal or vertical line?

@steveverrill Oh thanks for that link! I was tricked by the rotation, but this is really neat!

@NotthatCharles The axes go from 0 to (n-1)*p, so 5,10 draws (40,0),(30,10),(20,20),(10,30),(0,40). For n=1 all you would expect to see is a dot at the origin. At least, that is what my program produces.

The curve you get is given by x^(1/2) + y^(1/2) = const. I don't know if there's a name for it. It's similar to the astroid curve x^(2/3) + y^(2/3) = const obtained by using connecting segments of constant length rather than constant x-intercept plus y-intercept.

The harder followup challenge is to draw just the segments that make up the curve.

Mathematica, 55 51 50 47 64 68 bytes
f=Graphics[Line@Table[#2{{i-1,#+1},{0,i+1}},{i,#}],ImageSize->#*#2]&

Defines a function which yields the image as specified when called like
f[25,15]

Yielding

Edit: Had to add some characters to make sure that the second parameter was actually interpreted as pixels.
Edit: four more bytes to plot the horizontal lines.

Python - 74
Since the question doesn't specify units, axes scaling etc. I'm coming up with the following minimum solution:
import pylab
n,p=input()
for i in range(n):pylab.plot([0,i*p],[(i-n)*p,0])

Disregarding units and axis scaling, the minimum solution saves four characters by omitting *p ;). also, are you sure you're not adding a horizontal and/or vertical line? those are not in the example outputs. finally, I noticed in mine, that it's shorter to offset the first coordinate horizontally instead of the second one (because you can save the - and the parentheses)

(The question does specify units as pixels now, btw.)

Bash+Imagemagick+xview, 124 bytes
for((;i<$1;));{
s+=" -draw 'line $[i*$2],0 0,$[($1-i++)*$2]'"
}
eval convert -size $[$1*$2]x$[$1*$2] xc:$s png:-|xview stdin

Output for ./curvestitch.sh 25 15:

Yay for overflowing the maximum command line length if you're not careful. Nice one

APL (dzaima/APL), 26 bytes
{P5.G.ln↓⍉↑⍵×⍺∘-@3⍳¨⍺1 1⍺}

-2 bytes from Adam using magic
Requires ⎕IO←0. (0-indexing)
Explanation
{P5.G.ln↓⍉↑⍵×⍺∘-@3⍳¨⍺1 1⍺}
 P5.G.ln                   Create lines using the following sets of four points:
                    ⍺1 1⍺  Array [n,1,1,n]
                  ⍳¨       generate range 0..n for each
                           [0..n,0,0,0..n]
                @3         to the third element,
             ⍺∘-           subtract it from n.(reversing the last range)
                           [0..n,0,0,n..0]
           ⍵×              scale all items by p
          ↑                mix , creating columns of coordinates.
        ↓⍉                 transpose, and convert to lists of two points

APL (dzaima/APL), 28 bytes
{P5.G.ln↓⍉↑(⍵×⍳⍺)⍬⍬(⍵×⍺-⍳⍺)}

Anonymous function which takes n and p as left and right arguments, and displays the pattern, given an adequately sized canvas.
Full Program here.
Made with a lot of advice and golfing from dzaima.
Test Cases
25, 15

20, 20

6,72

Java + Processing, 62 bytes
The original function I made for this question.
void c(int n,int p){for(int i=1;i<n;)line(p*i,0,0,p*(n-i++));}

Does {P5.G.ln↓⍉↑⍵×⍺-@3⍳¨⍺1 1⍺} work?

@Adám IncorrectArgsError: @ can't be called dyadically

OK, but then you have the choice between {P5.G.ln↓⍉↑⍵×⍺∘-@3⍳¨⍺1 1⍺} and {P5.G.ln↓⍉↑⍵×(⍳⍺)⍬⍬(⍺-⍳⍺)}

@Adám Added an explanation, hope it's correct.

Almost: ⍵× is a scaling applied to everything, not just item 3.

Basic 7.0, Commodore 128, 60 58 bytes
0inputn,p:gR1:s=n*p:do:dR1,s,0to0,n:s=s-p:n=n+p:loOwHs>=0

Watch a video of it running:

Unfortunately, INPUT command hasn't an abbreviation :(

Perl, 121 130 bytes
The input is via STDIN. The values are comma separated.
EDIT: We have new rules. I'm not sure why, but the first two pixels are invisible and I had to add an offset...
use Tk;<>=~/,/;$c=tkinit->Canvas(-width=>$w=$`*$'-$',-height=>$w)->pack;$c->createLine(2,2+$_*$',2+$w-$_*$',2)for 0..~-$`;MainLoop

Here are some tests:
25x15:

6x72:

BBC Basic, 58 ascii characters, tokenised filesize 49
INPUTn,p:p*=2FORi=1TOn:MOVEi*p-p,974DRAW0,974-(n-i)*p:NEXT

Download emulator at http://www.bbcbasic.co.uk/bbcwin/bbcwin.html
p*=2 is needed because in the default mode BBC Basic maps a logical square of 2x2 to a single physical pixel.
BBC Basic has the origin at the bottom left corner of the screen, with y coorinates going up. On my machine the default window has an upper y coordinate of 974 (yours may be different.) 7 characters could be saved if it was permitted to plot in the bottom left corner of the screen. Adding MODE16 after the first : will resize the window so that the upper y coordinate is guaranteed to be 799.

This is fast becoming a dangerous golfing language. CJam who?

Java 8, 143 bytes
import java.awt.*;n->p->new Frame(){{add(new Panel(){public void paint(Graphics g){for(int m=0;m<n;)g.drawLine(0,m*p,n*p-++m*p,0);}});show();}}

Output for \$n=25, p=15\$:

Output for \$n=5, p=50\$:

Explanation:
import java.awt.*;            // Required import for almost everything
n->p->                        // Method with two integer parameters & Frame return-type
  new Frame(){                //  Create the Frame
   {                          //   In an inner code-block:
     add(new Panel(){         //    Add a Panel we can draw on:
       public void paint(Graphics g){
                              //     Overwrite its paint method:
         for(int m=0;m<n;)    //      Loop `m` in the range [0,n):
           g.drawLine(        //       Draw a line:
             0,m*p,           //        Starting at x=0, y=m*p
             n*p-++m*p,0);}});//        to x=n*p-(m+1)*p, y=0
     show();}};               //    And afterwards show the Frame

I think it specifies that vertical and horizontal lines are necessary where it says "Horizontal/vertical lines are necessary, and should be part of the line count." (or am I misunderstanding you?)

@thedefault. Fixed. And it turned out even 2 bytes shorter. :) Thanks again for noticing.

I don't know java, but where in the code do you specify the output pixels?  When I look at your 2 examples, they seem to be 305 & 176 pixels across, which is less than 2515 & 550.  Or is this just a side-effect of the up-/downloading?

@DominicvanEssen The width/height is actually $(n-1)\times p$, so 360 for the first test case and 200 for the second. But if the pictures shows something different it's probably an issue of automatic cropping when making a screenshot, uploading it to imgur, or showing it at stackexchange. I don't see it mentioning pixels in particular in the drawLine method (it uses Graphics coordinate system, but no idea what it uses by default). Tbh, I have no idea why my screenshots appear smaller than some other answers for the $n=25,p=15$ test case, but the calculations are correct with n & p..

Ah, I kind-of assumed that the screenshot/upload/imgur/SE chain was to blame!  So if your graphs are the correct sizes on your computer, I take it that the 'graphics' coordinates are defined as 1 coordinate = 1 pixel, which is quite convenient here!

Html + JavaScript 155 157 183
Edit: learnig what stuff I can cut without functionality loss
Edit 2: as suggested by @Optimizer
<canvas id='c'/><script>
p=prompt,s=p(l=p(t=c.getContext("2d")));for(c.width=c.height=y=s*l,x=0;l--;x-=s)t.moveTo(0,y-=s),t.lineTo(-x,0);t.stroke()
</script>

Fiddle First input number of lines, second input pixel interval
Ungolfed Fiddle

l=p(s=p(t=c.getContext("2d")))

@Optimizer I think I need to set width and height before getting the context

Nope, this works : http://jsfiddle.net/6ke43m7c/10/

R, 100 bytes
function(n,p,P=p*n*1.08){bmp(,P,P)
par(mar=!1:4)
plot.new()
segments((1:n-1)/n,1,0,1:n/n)
dev.off()}

Saves output to bitmap file 'Rplot001.bmp'.
There are some 'wasted' pixels at the top & on the left (so the curve is in the top left corner but not touching the edge).
This seems to be within the spec, but could be removed for +13 bytes.
Commented code:
curve_stitch=
function(n,p,                   # n = number of lines, p = pixels between starting points
 P=p*n*1.08){                   # P = pixel dimensions of final plot.
                                # (R expands axes by 4% at each end by default, so to
                                # ensure that the curve itself is p*n pixels, we need
                                # to expand the output by +8%
 bmp(,P,P)                      # open bitmap output to default filename, with dimensions PxP
 par(mar=!1:4)                  # remove margins by setting all to zero
 plot.new()                     # define new plot (default data range from 0 to 1)
 segments((1:n-1)/n,1,0,1:n/n)  # plot lines within range from 0 to 1
 dev.off()                      # close bitmap output to save file
 }

Sample output:
curve_stitch(10,10)

curve_stitch(5,50)

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Detect Duplicate Questions
Detect Duplicate Questions
Once upon a time, there was a golfing site. It had a problem: people would post similar or identical questions again and again. You have been chosen selected forced conscripted blackmailed requested to automate the process of deciding whether a question is a duplicate of an existing one, by whatever means necessary (see Rules).
Input
Your program must accept a single URL as input. It may assume that this leads to a question on codegolf.stackexchange.com.
Output
Search the site for similar questions. If you think that the input question is a duplicate of an existing question (or vice versa), output the other question's URL. You may output multiple URLs, separated by new lines. At the end of your output, output end (on a separate line).
Scoring

If a question that you output was indeed marked as a duplicate of the input question (or vice versa), you score 4 points. This is a "correct guess".
For each false positive (aka "incorrect guess"), you lose 2 points.
For each question that was actually a duplicate but does not appear in your output (aka "missing guess"), lose 1 point.

The highest score after handling 32 input questions wins. These 32 questions are a "round". At the beginning of each round, the scores will be reset to 0. One round will be run every few days, and the leaderboard updated after each round.
Rules

If questions A and C are both closed as duplicates of B, A will count as a duplicate of C and vice versa.
At the start of each round, your program may not possess any data about any questions (i.e. no hardcoding), except on how to parse the website.
However, you may keep data in external files during a round.
No data may be kept between rounds.
Your output must have a trailing new line.
You may not use any data from the website except search results and the URL, title, tags and text of a question, with or without formatting. For example, you may not use the text "marked as duplicate by foo, bar..." that appears on duplicate questions.
You may retrieve this data directly from the site, via data.SE or via the API.
Each submission must have a name.
Each submission must have clear version numbering.
If a submission does not produce output after a time limit (to be decided; please state how long your submission takes) it will be killed and lose 8 points.

Isn't 1 minute subjective ? Network connections and crawling will lead to a huge number of web requests. It might easily take more than 1 minute for everyone :)

@Optimizer Are you suggesting I increase it to 2 minutes? 4?

I think we cannot come to that number directly, you might have to write an example program yourself (or use the first answer) to determine the correct threshold time.

@Optimizer I think I'll use the first few answers (but no more than 8 minutes or so)

Instead of scraping the site, you should go through the API, and specify which fields may be used.

@Gilles I'm not familiar with the API - is 'post name', 'post body', 'post tags' enough?

It would be so funny if this question was a duplicate.. oh the irony xD

can I use a search engine instead of the site's search?

@Mhmd No; you may use the API though, I will add rules about that

@Gilles I've added rules for the API; you may now use the site itself, the API or data.SE

@professorfish You could really use some test cases, here you go.
This data all came from Data.SE, so it should be reliable. Feel free to make me look silly and prove me wrong.
This question has
http://codegolf.stackexchange.com/q/37737
has no duplicates.
This question
http://codegolf.stackexchange.com/q/12348
has this http://codegolf.stackexchange.com/q/10465
This question
http://codegolf.stackexchange.com/q/12498
has these http://codegolf.stackexchange.com/q/20006
http://codegolf.stackexchange.com/q/242

Are we penalized for claiming the same question is duplicate twice?

@PenutReaper Question 20006 has since been deleted.

Python 3
I am giving this entry the name The Differ.
Code:
import urllib.request, gzip, re, json, difflib, sys
API_URL = "https://api.stackexchange.com/"
qurl = input()
qid = int(re.search("\d+",qurl).group(0))
def request(url,wrapper=False,**params):
    params.setdefault("filter","withbody")
    params.setdefault("site","codegolf")
    url = API_URL + url + "?"+"&".join([str(k)+"="+str(v) for k,v in params.items()])
    compressed_response = urllib.request.urlopen(url)
    response = gzip.decompress(compressed_response.read()).decode("utf8")
    response_object = json.loads(response)
    if wrapper:
        return response_object
    else:
        return response_object["items"]
question = request("questions/%s"%qurl)[0]
tags = ";".join(question["tags"])
title = question["title"]
escaped = title.replace(" ","%20")
related = request("similar",title=escaped,pagesize=100)
hasmore = False
length = sys.maxsize
for tag in question["tags"]:
    result = request("search",tagged=tag,
                     wrapper=True,
                     filter="!-*f(6rc.cI8O",
                     pagesize=100)
    if result["total"] < length:
        length = result["total"]
        related.extend(result["items"])
        hasmore = result["has_more"]
        besttag = tag
related.extend(best)
if length < 1500:
    for page in itertools.count(2):
        if not hasmore:
            break
        response = request("search",
                           tagged=besttag,
                           page=page,
                           pagesize=100,
                           filter="!-*f(6rc.cI8O",
                           wrapper=True)
        hasmore = response["has_more"]
        related.extend(result["items"])
matcher = difflib.SequenceMatcher(None, question["body"], None)
titlematcher = difflib.SequenceMatcher(None, question["title"], None)
seen = set()
seen.add(question["question_id"])
for possible in related:
    matcher.set_seq2(possible["body"])
    titlematcher.set_seq2(possible["title"])
    score = matcher.ratio()+titlematcher.ratio()
    qid = possible["question_id"]
    if score > .85 and qid not in seen:
        print(qid)
        seen.add(qid)
print("end")

The filter "!-*f(6rc.cI8O" included the total parameter on the global wrapper object and the body parameter on questions.
This entry makes two API requests plus one per tag on the question plus one per hundred questions in its least used tag. If it hits an api throttle (which it doesn't check for), it will raise an urllib.error.HTTPError: HTTP Error 400: Bad Request

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Reorganize By Arrows
Lets say I was writing something, and I accidentally wrote it in the wrong box:
+-------+--------+
| Verbs | Nouns  |
+-------+--------+
| Truck |        |
| eat   | Banana |
|       | Car    |
+-------+--------+

So I, being lazy, merely draw an arrow to the space it should be:
+-------+--------+
| Verbs | Nouns  |
+-------+--------+
|[Truck]--->     |
| eat   | Banana |
|       | Car    |
+-------+--------+

Your job is to make it look pretty - turn it into this:
+-------+--------+
| Verbs | Nouns  |
+-------+--------+
|       | Truck  |
| eat   | Banana |
|       | Car    |
+-------+--------+

Rules

Phrases or words are surrounded by brackets ([...])
Multiline entries are denoted as [...] (multiline removed), newline, [...]--...-->. So the arrow always comes out of the bottom right bracket

For example:
+-----------+----------+
|   Verbs   |  Nouns   |
+-----------+----------+
|           |          |
|[is a noun]->         |
| eat       | Banana   |
|           | Car      |
+-----------+----------+

Turns into:
+-----------+----------+
|   Verbs   |  Nouns   |
+-----------+----------+
|           |          |
|           | is a noun|
| eat       | Banana   |
|           | Car      |
+-----------+----------+

Boxes are bounded by pluses ("+"), and it should be assumed that arrows will not pass over a plus
There will always be room at the end of an arrow for the word or phrase to fit
Order matters - the word must appear where the arrow points to, though vertical alignment is not important
Arrows can turn by 90 degrees at a time, but only between "/" and "\" (see below)

For example:
    +-----------+----------+
    |   Verbs   |  Nouns   |
    +-----------+----------+
    | [Truck]--\|          |
  /------------/|        <--\
  | | eat       | Banana   ||
  | |  /--\     | Car      ||
  | +--|--|-----+----------+|
  \----/  \-----------------/

The Competition
Any input is acceptable (text file, STDIN, etc.)
any readable output is acceptable (text file, STDOUT, etc)
Here are some more examples:
This is code golf, so shortest code wins!
Some test cases:
   +--------+----------+-------------+
   | Colors |  Foods   |  Countries  |
   +--------+----------+-------------+
   | red    | pizza    | Switzerland |
 /-->     /---->       |             |
 | |[kale]/ | hot dogs | Brazil      |
 | |     <----------------------\    |
 | | orange |[yellow]\ | [green]/    |
 | +--------+--------|-+-------------+
 \-------------------/

/------------------------------------------\
|                                          |
|  +------------------+----------+-------+ |
|  | frog             |          |       | |
|  | forge            | dog      | eagle | |
|  | foundation       | diligent | ease  | |
|  |[Brother]--\      | down     | elf   | |
|  |           |      |[egg]--\  |[fort]---/
\---->         |      |       |  |       |
   |           \-\    |       \----->    |
   +-------------|----+----------+       |
   |   Boy       \-->            |       |
   |   Bull                      |       |
   |   Browser                   |       |
   +-----------------------------+-------+

             /--------------------------------------\
             |                     /---------------\|
/------------|---------------------/               ||
|            |               /---------------\     ||
|  +---------|-+-----------+-|------+--------|+    ||
\---->       | |  clarinet | \>     | [drums]/|    ||
   | [viola]\\--->         |        +---------+    ||
   |        \----->        |        |         |/---/|
   +-----------+ [violin]\ |        | [cello]--/    |
   |        <------------/ |        +---------+     |
   |           +-----------+      <----------\|     |
   |           |           |        |  [tuba]/|     |
   |           | [piano]\  |        |         |     |
   |        <-----------/  |        |         |     |
   |           +-----------+--------+         |     |
   |           |                    |[trumpet]------/
   | [flute]----->                  |         |
   |           |     saxaphone      |         |
   +-----------+--------------------+---------+

This is a nice challenge, it just seems bloody hard!

I guess you can also use | to make everything prettier.

In the last example, [Clarinet] isn't going anywhere, can we not assume that anything inside square brackets is going to move?

While attempting to write box identification, I've noted that it's possible for it to be ambiguous how many boxes there are if you have enough arrows crossing a boundary, for example, How many boxes are there in this layout http://pastebin.com/xyBjTAwK ? Can we have some guarantee that this won't occur, or an explanation of expected behaviour for the situation.

@VisualMelon You can assume that won't happen. There will never be a case where 2 pluses are in the next row/column and not be connected. Also, about the brackets, that was a flaw on my part. You can assume that anything in brackets moves.

What is the policy on trailing spaces/line breaks in the output?

All I ask is that it outputs a table that looks like the original table, except with the values moves. In other words, as long as it looks like a table (e.g. no random line breaks), I don't care about things I can't see (e.g. trailing spaces/line breaks)

Regarding "Order matters", what do you expect for the second test case entry "Brother"? Can you qualify the requirements for positioning of moved items (my current implementation is working on the assumption that each box has multiple rows, each with a single item in it, because there is no guarantee that 3 multi line items won't be pointing to 3 consecutive rows; now I'm thinking that I can't treat each box as a single column?). Can you please also clarify what qualifies as an item (i.e. non-whitespace text with any of -|>< omitted). Thanks

On the order, if the top of the item is put right where the arrow is pointing, then it should be in the right place. For example, "Brother" would go to the right of "Boy". You can assume that the arrow is pointing to the first row of the destination of a multirow item. On what qualifies an item - Anything surrounded by brackets (even ><|^ and whitespace) is considered part of the item. If there are brackets above it without an arrow coming out, then it is part of a multiline item.

I like this, but there's a couple of things putting me off answering. 1.There's supposed to be enough space, but it seems the order you do the moves matters. If you move KALE before YELLOW there's no problem, but if you move YELLOW before KALE you risk overwriting part of the arrow for KALE 2.multiline moves seem complicated. Also it's not clear where the line should go to. In [A   ][CELLO] the arrow leaves from the lower row, but if it is pasted into place with the lower row lined up with the arrow head it overwrites the top of the box. And if it's posted one line lower, it overwrites VIOLA

perhaps I should get rid of multiline?

To make it easier can we assume that if we put the word exactly where the arrow points (be it word starts there for arrow pointing right or word ends there for arrow pointing left), there'll be enough room in the box? When moving yellow, if you start the word right there, it'll override the box boundary.

@steveverrill: overwriting arrows isn't a problem I think, you just have to keep track of them separately, eg you can dup the input and write into the duplicate

I would be for @Claudiu proposition, I've all but given up trying to complete the task to the current spec, because there are too many things that aren't strictly defined, and I don't want to fill these comments up with dozens of questions.

Ok, multinine removed and "yellow" fixed, you can assume that words will fit on the line.

I think there's an ambiguous case. Say the input is this. You can't know whether there's a box in the middle (choice 1 ) or whether there isn't (choice 2 ). Can I just assume choice 2 would be a valid output?

@Claudiu both of those are correct. In the case of an ambiguity like that, you can just choose one of them.

Python, 700 681 676 667 characters
Not fully golfed yet, but wanted to put up an answer.
import os
D=map(list,os.read(0,9999).split('\n'))
Z=Q=[-1,0,1,0,-1]
J=''.join
def T(y,x,d,_):c=D[y][x];D[y][x]=' ';d={'\\':3-d,'/':1-d}.get(c,d)%4;j=(y+Q[d],x+Q[d+1],d,c=='>');return c in'<>'and j or T(*j)
def F(y,x,d):
 if y<Y or x<L:
    if D[y][x]=='+':
     if J(D[y]).find('+',x+1)+1:F(y,x+1,1)
     if any((l[x:]+[''])[0]=='+'for l in D[y+1:]):F(y+1,x,2)
    else:D[y][x]='--||'[d];F(y+Q[d],x+Q[d+1],d)
i=0
for l in D:
 I=l.index
 if'+'in l:
    if Z:P,K,L,Z=i,I('+'),J(l).rfind('+'),0
    Y=i
 while'['in l:
    s,e=map(I,'[]');y,x,_,R=T(i,e+1,1,1);W=l[s+1:e]
    if R:D[y][x:x+e-s-1]=W
    else:D[y][x-e+s+2:x+1]=W
    l[s:e+1]=' '*(e-s+1)
 i+=1
F(P,K+1,1);F(P+1,K,2)
for l in D:print J(l)

Strategy:
I turn the input into a matrix. Then I scan it line by line, finding [s. For every [, I find the matching ], then I call the trace function T with the spot immediately to the right of the ]. The trace function follows the line, replacing the path with ' 's as it goes, and returns where the word should go. Then I erase the word in the old location and put the word in the new location.
Finally, I call F, which recursively reconstructs the boxes.
Tests:
reorg_test1... True
Input:
+-------+--------+
| Verbs | Nouns  |
+-------+--------+
|[Truck]--->     |
| eat   | Banana |
|       | Car    |
+-------+--------+

Output:
+-------+--------+
| Verbs | Nouns  |
+-------+--------+
|       |   Truck|
| eat   | Banana |
|       | Car    |
+-------+--------+

reorg_test2... True
Input:
+-----------+----------+
|   Verbs   |  Nouns   |
+-----------+----------+
|           |          |
|[is a noun]->         |
| eat       | Banana   |
|           | Car      |
+-----------+----------+

Output:
+-----------+----------+
|   Verbs   |  Nouns   |
+-----------+----------+
|           |          |
|           | is a noun|
| eat       | Banana   |
|           | Car      |
+-----------+----------+

reorg_test3... True
Input:
    +-----------+----------+
    |   Verbs   |  Nouns   |
    +-----------+----------+
    | [Truck]--\|          |
  /------------/|        <--\
  | | eat       | Banana   ||
  | |  /--\     | Car      ||
  | +--|--|-----+----------+|
  \----/  \-----------------/

Output:
    +-----------+----------+
    |   Verbs   |  Nouns   |
    +-----------+----------+
    |           |          |
    |           |   Truck  |
    | eat       | Banana   |
    |           | Car      |
    +-----------+----------+

reorg_test4... True
Input:
   +--------+----------+-------------+
   | Colors |  Foods   |  Countries  |
   +--------+----------+-------------+
   | red    | pizza    | Switzerland |
 /-->     /---->       |             |
 | |[kale]/ | hot dogs | Brazil      |
 | |     <----------------------\    |
 | | orange |[yellow]\ | [green]/    |
 | +--------+--------|-+-------------+
 \-------------------/

Output:
   +--------+----------+-------------+
   | Colors |  Foods   |  Countries  |
   +--------+----------+-------------+
   | red    | pizza    | Switzerland |
   | yellow |   kale   |             |
   |        | hot dogs | Brazil      |
   |green   |          |             |
   | orange |          |             |
   +--------+----------+-------------+

reorg_test5... True
Input:
/------------------------------------------\
|                                          |
|  +------------------+----------+-------+ |
|  | frog             |          |       | |
|  | forge            | dog      | eagle | |
|  | foundation       | diligent | ease  | |
|  |[Brother]--\      | down     | elf   | |
|  |           |      |[egg]--\  |[fort]---/
\---->         |      |       |  |       |
   |           \-\    |       \----->    |
   +-------------|----+----------+       |
   |   Boy       \-->            |       |
   |   Bull                      |       |
   |   Browser                   |       |
   +-----------------------------+-------+

Output:

   +------------------+----------+-------+
   | frog             |          |       |
   | forge            | dog      | eagle |
   | foundation       | diligent | ease  |
   |                  | down     | elf   |
   |                  |          |       |
   |  fort            |          |       |
   |                  |          |   egg |
   +------------------+----------+       |
   |   Boy           Brother     |       |
   |   Bull                      |       |
   |   Browser                   |       |
   +-----------------------------+-------+

reorg_test6... True
Input:
             /--------------------------------------\
             |                     /---------------\|
/------------|---------------------/               ||
|            |               /---------------\     ||
|  +---------|-+-----------+-|------+--------|+    ||
\---->       | |  clarinet | \>     | [drums]/|    ||
   | [viola]\\--->         |        +---------+    ||
   |        \----->        |        |         |/---/|
   +-----------+ [violin]\ |        | [cello]--/    |
   |        <------------/ |        +---------+     |
   |           +-----------+      <----------\|     |
   |           |           |        |  [tuba]/|     |
   |           | [piano]\  |        |         |     |
   |        <-----------/  |        |         |     |
   |           +-----------+--------+         |     |
   |           |                    |[trumpet]------/
   | [flute]----->                  |         |
   |           |     saxaphone      |         |
   +-----------+--------------------+---------+

Output:

   +-----------+-----------+--------+---------+
   |  cello    |  clarinet |   drums|         |
   |           |  trumpet  |        +---------+
   |           |   viola   |        |         |
   +-----------+           |        |         |
   |  violin   |           |        +---------+
   |           +-----------+  tuba  |         |
   |           |           |        |         |
   |           |           |        |         |
   |   piano   |           |        |         |
   |           +-----------+--------+         |
   |           |                    |         |
   |           |  flute             |         |
   |           |     saxaphone      |         |
   +-----------+--------------------+---------+

Python3, 584 bytes:
E=enumerate
U=lambda b,x,y:0<=x<len(b)and 0<=y<len(b[0])
def f(b):
 q=[(x,y,'','',0,1)for x,r in E(b)for y,l in E(r)if'['==l]
 while q:
  x,y,w,l,X,Y=q.pop(0)
  if(u:=b[x][y]).isalpha():w+=u
  if u=='/':X,Y=[-X,-Y][::-1]
  if u=='\\':X,Y=[X,Y][::-1]
  if u in'><':
   for i,a in E([w,w[::-1]][u=='<']):b[x][y+Y*i]=a
   continue
  q+=[(x+X,y+Y,w,u,X,Y)]
  b[x][y]=' '
  if'-'==u and U(b,x+1,y)and U(b,x-1,y)and' 'not in(Q:={b[x-1][y],b[x+1][y]})and{'|','+'}&Q:b[x][y]='|'
  if'|'==u and U(b,x,y-1)and U(b,x,y+1)and' 'not in(Q:={b[x][y+1],b[x][y-1]})and{'-','+'}&Q:b[x][y]='-'
 return b

Try it online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Radioactive Quines
A radioactive quine is a quine-like program that has an even number of characters and, when run, outputs itself with exactly half of its characters removed.
The output itself may be a radioactive quine, so the program can "decay" multiple times.
It could be said that the half-life of a radioactive quine is one run, up to a certain number of runs (decays).
Example
The Python 2 program (28 characters)
1234;print'print\'abcdefg\''

is a radioactive quine with 2 decay steps because when it is run it outputs
print'abcdefg'

which is the original program with these 14 characters removed: 1234;print'\\'.
When print'abcdefg' is run in turn it outputs abcdefg which is print'abcdefg' with the 7 characters print'' removed.
The program abcdefg is not a radioactive quine so the cycle has come to an end.
Challenge
Write a radioactive quine in 1024 characters or less that has the most decay cycles.
The 1024 character limit means that the maximum number of decay cycles possible is 10 since the
1024 → 512 → 256 → 128 → 64 → 32 → 16 → 8 → 4 → 2 → 1 decay pattern would be optimal.
The example above has 2 decay cycles.
Details

Just like normal quines, radioactive quines may not take input or read their own source.
All output must go to stdout or your language's closest alternative.
You may use any characters. It is not limited to ASCII.
The characters in a radioactive quine that are removed may be removed from any indices (but the remaining characters may not be rearranged). So radquine could decay into radq or uine or rdui or rain, etc.
Note that only a program with an even number of characters can possibly be a radioactive quine.
It's fine if the final output of the decay cycle (abcdefg in the example) has an even number of characters. It doesn't matter what happens when this output is run as a program.

Winning
The winner will be the submission with the most decay cycles.
Update: Since trivial answers are possible I'm following yasen's advice and saying that in case of ties, the starting radioactive quine with the most unique characters wins. (Naturally 1024 is the limit here.)
In the rare chance there is still a tie, the highest voted answer wins.

It may be a good idea to rank the answers by amount of distinct characters in case of a tie in the decay cycles.

@yasen Great idea. I've added that rule.

Great, now I got the Radioactive cover by Lindsey Stirling and Pentatonix stuck in my head. At least it's not Rebecca Black or Justin Bieber. Welcome to the new age, I guess...

CJam, 10 cycles, 1023 unique characters
"39c'LS 0¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂăĄąĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıĲĳĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňŉŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƀƁƂƃƄƅƆƇƈƉƊƋƌƍƎƏƐƑƒƓƔƕƖƗƘƙƚƛƜƝƞƟƠơƢƣƤƥƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽƾƿǀǁǂǃǄǅǆǇǈǉǊǋǌǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰǱǲǳǴǵǶǷǸǹǺǻǼǽǾǿȀȁȂȃȄȅȆȇȈȉȊȋȌȍȎȏȐȑȒȓȔȕȖȗȘșȚțȜȝȞȟȠȡȢȣȤȥȦȧȨȩȪȫȬȭȮȯȰȱȲȳȴȵȶȷȸȹȺȻȼȽȾȿɀɁɂɃɄɅɆɇɈɉɊɋɌɍɎɏɐɑɒɓɔɕɖɗɘəɚɛɜɝɞɟɠɡɢɣɤɥɦɧɨɩɪɫɬɭɮɯɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿʀʁʂʃʄʅʆʇʈ̴̵̶̷̸̯̰̱̲̳̹̺̻̼͇͈͉͍͎͓͔͕͖͙͚̽̾̿̀́͂̓̈́͆͊͋͌͐͑͒͗͛ͣͤͥͦͧͨͩͪͫͬͭͮͯ͘͜͟͢͝͞͠͡ͅͰͱͲͳʹ͵Ͷͷ͸͹ͺͻͼͽ;Ϳ΀΁΂΃΄΅Ά·ΈΉΊ΋Ό΍ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ΢ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώϏϐϑϒϓϔϕϖϗϘϙϚϛϜϝϞϟϠϡϢϣϤϥϦϧϨϩϪϫϬϭϮϯϰϱϲϳϴϵ϶ϷϸϹϺϻϼϽϾϿЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖֽ־ֿ׀ׁׂ׃ׅׄ׆ׇ׈׉׊׋׌׍׎׏אבגדהוזחטיךכלםמןנסעףפץצקרשת׫׬׭׮ׯװױײ׳״׵׶׷׸׹׺׻׼׽׾׿؀؁؂؃؄؅؆؇؈؉؊؋،؍؎؏ؘؙؚؐؑؒؓؔؕؖؗ؛؝؞؟ؠءآأؤࡋࡌࡍࡎࡏࡐࡑࡒࡓࡔࡕࡖࡗࡘ࡙࡚࡛࡜࡝࡞࡟ࡠࡡࡢࡣࡤࡥࡦࡧࡨࡩࡪ࡫࡬࡭࡮࡯ࡰࡱࡲ૙૚૛૜૝૞૟ૠ൧൨ྲྀླྌྊྉྈྒ೨ഥദ೾೯ംഢ೼೻೺ബೳഇഄਗ਼ગઘੰ੡ੴઔ੮੭੬ઞ੥ઌੜ੤੯੣ઑ੧એ੢੹ੳ੶ߌࠉࠊߢߓߦࠆߠߟߞࠐߗ߾ߎߖߡߕࠃߙࠁߔ߫ߥߨԾջռՔՅ՘ոՒՑՐւՉհՀՈՓՇյՋճՆ՝՗՚ʰ˭ˮˆʷˊ˪˄˃˂˴ʻˢʲʺ˅ʹ˧ʽ˥ʸˏˉˌ"_`8)<\654f-T$,7+Y/W*A;>

Output
"39c'LS 0¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂăĄąĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıĲĳĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňŉŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƀƁƂƃƄƅƆƇƈ̴̵̶̷̸̯̰̱̲̳̹̺̻̼͇͈͉͍͎͓͔͕͖͙͚̽̾̿̀́͂̓̈́͆͊͋͌͐͑͒͗͛ͣͤͥͦͧͨͩͪͫͬͭͮͯ͘͜͟͢͝͞͠͡ͅͰͱͲͳʹ͵Ͷͷ͸͹ͺͻͼͽ;Ϳ΀΁΂΃΄΅Ά·ΈΉΊ΋Ό΍ΎΏΐΑΒΓΔΕΖֽ־ֿ׀ׁׂ׃ׅׄ׆ׇ׈׉׊׋׌׍׎׏אבגדהוזחטיךכלםמןנסעףפࡋࡌࡍࡎࡏࡐࡑࡒ૙૚೨ഥ೾೼೻೺ഄਗ਼ગઘੰ੡ੴઔ੮੭੬ઞ੥੹੶ߌࠉࠊߢߓߦࠆߠߟߞࠐߗ߾ߎߖߡߕࠃߙࠁߔ߫ߥߨԾջռՔՅ՘ոՒՑՐւՉհՀՈՓՇյՋճՆ՝՗՚ʰ˭ˮˆʷˊ˪˄˃˂˴ʻˢʲʺ˅ʹ˧ʽ˥ʸˏˉˌ"_`8)<\654f-T$,7+Y/W*A;>
"39c'LS 0¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂăĄąĆćĈ̴̵̶̷̸ֽ̯̰̱̲̳̹̺̻̼͇͈͉͍͎͓͔͕͖̽̾̿̀́͂̓̈́͆͊͋͌͐͑͒ͅ־ֿ׀ׁׂ׃ׄࡋࡌਗ਼ગੰ੮੭੬੶ߌࠉࠊߢߓߦࠆߠߟߞࠐߗ߫ߨԾջռՔՅ՘ոՒՑՐւՉհՀՈՓՇյՋճՆ՝՗՚ʰ˭ˮˆʷˊ˪˄˃˂˴ʻˢʲʺ˅ʹ˧ʽ˥ʸˏˉˌ"_`8)<\654f-T$,7+Y/W*A;>
"39c'LS 0¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈ̴̵̶ֽ̯̰̱̲̳־ߌࠉߢߠߟߞߨԾջռՔՅ՘ոՒՑՐւՉ՝՚ʰ˭ˮˆʷˊ˪˄˃˂˴ʻˢʲʺ˅ʹ˧ʽ˥ʸˏˉˌ"_`8)<\654f-T$,7+Y/W*A;>
"39c'LS 0¡¢£¤¥¦§¨̯̰ԾջՔՒՑՐ՚ʰ˭ˮˆʷˊ˪˄˃˂˴ʻˏˌ"_`8)<\654f-T$,7+Y/W*A;>
"39c'LS 0¡¢ʰ˭ˆ˄˃˂ˌ"_`8)<\654f-A>
"39c'LS 0"_8654>
39c'LS 0
'L 0
L0
0

How it works

`8)< returns the first 9 characters of the string with double quote.
654f- decreases each character by 654.
T$, returns the string length on the top of the stack.
7+Y/W*> returns appropriate number of characters from the end of the decoded string.
_`8)<\654f-A> is a simplified version without calculating the number of characters.
_8654> does nothing useful.
39c is the character '.

The string in each program ends with the output without "39c'LS 0, with each character value increased by 654. And each string is a substring of the one in the previous program, because it is the substring if both of them are decoded.
The only character used twice is the double quote (").
Non-ascii characters cannot appear in blocks directly without a string in CJam. And there are no comment characters. So I think 1024 in CJam is impossible. It might be possible in GolfScript. And it should be easier in languages like Sclipting. But I'm too lazy to do that.
It can be generated with the following program:
{9>654f+}:U;
{"\"39c'LS 0"\+}:V;
{
  _,24-,'¡f+
  \U+
  V
  "\"_`8)<\654f-T$,7+Y/W*A;>"+
}:T;

"\"39c'LS 0\"_8654>"
U"¡¢"\+V"\"_`8)<\654f-A>"+
TTTTT

CJam, 10 cycles, all printable ascii
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''']_" !#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJK";

How it works
In the first time it prints 512 's. Then it works just like Dennis's answer.

dude. u win -_-

I demand an explanation for the latest code! :)

@Optimizer Updated.

CJam, 10 cycles
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

CJam, 10 cycles, 876 unique characters
"\"''''''''\""'""'BCD'µϨ¶'·ϩ¸'¹Ϫº'»ϫ¼'½Ϭ¾'¿ϭÀ'ÁϮÂ'ÃϯÄ'ÅϰÆ'ÇϱÈ'ÉϲÊ'ËϳÌ'ÍϴÎ'ÏϵÐ'Ñ϶Ò'ÓϷÔ'ÕϸÖ'×ϹØ'ÙϺÚ'ÛϻÜ'ÝϼÞ'ßϽà'áϾâ'ãϿä'åЀæ'çЁè'éЂê'ëЃì'íЄî'ïЅð'ñІò'óЇô'õЈö'÷Љø'ùЊú'ûЋü'ýЌþ'ÿЍĀ'āЎĂ'ăЏĄ'ąАĆ'ćБĈ'ĉВĊ'ċГČ'čДĎ'ďЕĐ'đЖĒ'ēЗĔ'ĕИĖ'ėЙĘ'ęКĚ'ěЛĜ'ĝМĞ'ğНĠ'ġОĢ'ģПĤ'ŃЯń'ţпŤ'ťрŦ'ŧсŨ'ũтŪ'ūуŬ'ŭфŮ'ůхŰ'űцŲ'ųчŴ'ŵшŶ'ŷщŸ'Źъź'Żыż'Žьž'ſэƀ'ƁюƂ'ƃяƄ'ƅѐƆ'Ƈёƈ'ƉђƊ'Ƌѓƌ'ƍєƎ'ƏѕƐ'Ƒіƒ'ƓїƔ'ƕјƖ'ƗљƘ'ƙњƚ'ƛћƜ'Ɲќƞ'ƟѝƠ'ơўƢ'ƣџƤ'ƥѠƦ'Ƨѡƨ'ƩѢƪ'ƫѣƬ'ƭѤƮ'Ưѥư'ƱѦƲ'Ƴѧƴ'ƵѨƶ'ƷѩƸ'ƹѪƺ'ƻѫƼ'ƽѬƾ'ƿѭǀ'ǁѮǂ'ǃѯǄ'ǅѰǆ'Ǉѱǈ'ǉѲǊ'ǋѳǌ'ǍѴǎ'Ǐѵǐ'ǑѶǒ'Ǔѷǔ'ǕѸǖ'Ǘѹǘ'ǙѺǚ'ĥРĦ'ħСĨ]Ǜѻǜ_ǝѼǞ\\Ǥ\"ǥҀǦ썐īУĬ썑ĭФĮ썒ĩТĪ썓Ņаņ썔Ňбň썕ŉвŊ썖ŋгŌ썗ōдŎ썘ŏеŐ썙őжŒ썚œзŔ썛ŕиŖ썜ŗйŘ썝řкŚ썞śлŜ썟ŝмŞ썠şнŠ썡šоŢ썢įХİ썣ıЦĲ썤ĳЧĴ썥ĵШĶ썦ķЩĸ썧ĹЪĺ써ĻЫļ썩ĽЬľ썪ĿЭŀ썫ŁЮł썬ǟѽǠ썭ǡѾǢ썮ǧҁǨ썯ǩ҂Ǫ썰ǫ҃Ǭ썱ǭ҄Ǯ썲ǯ҅ǰ썳Ǳ҆ǲ썴ǳ҇Ǵ썵ǵ҈Ƕ썶Ƿ҉Ǹ썷ǹҊǺ썸ǻҋǼ썹ǽҌǾ썺ǿҍȀ썻ȁҎȂ썼ȃҏȄ썽ȅҐȆ썾ȇґȈ썿ȉҒȊ쎀ȋғȌ쎁ȍҔȎ쎂ȏҕȐ쎃ȑҖȒ쎄ȓҗȔ쎅ȕҘȖ쎆ȗҙȘ쎇șҚȚ쎈țқȜ쎉ȝҜȞ쎊ȟҝȠ쎋ȡҞȢ쎌ȣҟȤ쎍ȥҠȦ쎎ȧҡȨ쎏ȩҢȪ쎐ȫңȬ쎑ȭҤȮ쎒ȯҥȰ쎓ȱҦȲ쎔ȳҧȴ쎕ȵҨȶ쎖ȷҩȸ쎗ȹҪȺ쎘Ȼҫȼ쎙ȽҬȾ쎚ȿҭɀ쎛ɁҮɂ쎜ɃүɄ쎝ɅҰɆ쎞ɇұɈ쎟ɉҲɊ쎠ɋҳɌ쎡ɍҴɎ쎢ɏҵɐ쎣ɑҶɒ쎤ɓҷɔ쎥ɕҸɖ쎦ɗҹɘ쎧əҺɚ쎨ɛһɜ쎩ɝҼɞ쎪ɟҽɠ쎫ɡҾɢ쎬ɣҿɤ쎭ɥӀɦ쎮ɧӁɨ쎯ɩӂɪ쎰ɫӃɬ쎱ɭӄɮ쎲ɯӅɰ쎳ɱӆɲ쎴ɳӇɴ쎵ɵӈɶ쎶ɷӉɸ쎷ɹӊɺ쎸ɻӋɼ쎹ɽӌɾ쎺ɿӍʀ쎻ʁӎʂ쎼ʃӏʄ쎽ʅӐʆ쎾ʇӑʈ쎿ʉӒʊ쏀ʋӓʌ쏁ʍӔʎ쏂ʏӕʐ쏃ʑӖʒ쏄ʓӗʔ쏅ʕӘʖ쏆ʗәʘ쏇ʙӚʚ쏈ʛӛʜ쏉ʝӜʞ쏊ʟʠʡ\\Ӟ\"ʢʣӟ;"2%'""Y%a"

Try it online.
How it works

"xyzw" pushes the string xyzw.
"xyzw"2% pushes the string xz.
"xyzw"; pushes nothing.
]_ duplicates the entire stack.
'x pushes the character x.

Example run
$ C=$(cat decay); while ((${#C} > 1)); do echo $C; C=$(cjam <(echo $C)); done; echo $C
"\"''''''''\""'""'BCD'µϨ¶'·ϩ¸'¹Ϫº'»ϫ¼'½Ϭ¾'¿ϭÀ'ÁϮÂ'ÃϯÄ'ÅϰÆ'ÇϱÈ'ÉϲÊ'ËϳÌ'ÍϴÎ'ÏϵÐ'Ñ϶Ò'ÓϷÔ'ÕϸÖ'×ϹØ'ÙϺÚ'ÛϻÜ'ÝϼÞ'ßϽà'áϾâ'ãϿä'åЀæ'çЁè'éЂê'ëЃì'íЄî'ïЅð'ñІò'óЇô'õЈö'÷Љø'ùЊú'ûЋü'ýЌþ'ÿЍĀ'āЎĂ'ăЏĄ'ąАĆ'ćБĈ'ĉВĊ'ċГČ'čДĎ'ďЕĐ'đЖĒ'ēЗĔ'ĕИĖ'ėЙĘ'ęКĚ'ěЛĜ'ĝМĞ'ğНĠ'ġОĢ'ģПĤ'ŃЯń'ţпŤ'ťрŦ'ŧсŨ'ũтŪ'ūуŬ'ŭфŮ'ůхŰ'űцŲ'ųчŴ'ŵшŶ'ŷщŸ'Źъź'Żыż'Žьž'ſэƀ'ƁюƂ'ƃяƄ'ƅѐƆ'Ƈёƈ'ƉђƊ'Ƌѓƌ'ƍєƎ'ƏѕƐ'Ƒіƒ'ƓїƔ'ƕјƖ'ƗљƘ'ƙњƚ'ƛћƜ'Ɲќƞ'ƟѝƠ'ơўƢ'ƣџƤ'ƥѠƦ'Ƨѡƨ'ƩѢƪ'ƫѣƬ'ƭѤƮ'Ưѥư'ƱѦƲ'Ƴѧƴ'ƵѨƶ'ƷѩƸ'ƹѪƺ'ƻѫƼ'ƽѬƾ'ƿѭǀ'ǁѮǂ'ǃѯǄ'ǅѰǆ'Ǉѱǈ'ǉѲǊ'ǋѳǌ'ǍѴǎ'Ǐѵǐ'ǑѶǒ'Ǔѷǔ'ǕѸǖ'Ǘѹǘ'ǙѺǚ'ĥРĦ'ħСĨ]Ǜѻǜ_ǝѼǞ\\Ǥ\"ǥҀǦ썐īУĬ썑ĭФĮ썒ĩТĪ썓Ņаņ썔Ňбň썕ŉвŊ썖ŋгŌ썗ōдŎ썘ŏеŐ썙őжŒ썚œзŔ썛ŕиŖ썜ŗйŘ썝řкŚ썞śлŜ썟ŝмŞ썠şнŠ썡šоŢ썢įХİ썣ıЦĲ썤ĳЧĴ썥ĵШĶ썦ķЩĸ썧ĹЪĺ써ĻЫļ썩ĽЬľ썪ĿЭŀ썫ŁЮł썬ǟѽǠ썭ǡѾǢ썮ǧҁǨ썯ǩ҂Ǫ썰ǫ҃Ǭ썱ǭ҄Ǯ썲ǯ҅ǰ썳Ǳ҆ǲ썴ǳ҇Ǵ썵ǵǶ썶ǷǸ썷ǹҊǺ썸ǻҋǼ썹ǽҌǾ썺ǿҍȀ썻ȁҎȂ썼ȃҏȄ썽ȅҐȆ썾ȇґȈ썿ȉҒȊ쎀ȋғȌ쎁ȍҔȎ쎂ȏҕȐ쎃ȑҖȒ쎄ȓҗȔ쎅ȕҘȖ쎆ȗҙȘ쎇șҚȚ쎈țқȜ쎉ȝҜȞ쎊ȟҝȠ쎋ȡҞȢ쎌ȣҟȤ쎍ȥҠȦ쎎ȧҡȨ쎏ȩҢȪ쎐ȫңȬ쎑ȭҤȮ쎒ȯҥȰ쎓ȱҦȲ쎔ȳҧȴ쎕ȵҨȶ쎖ȷҩȸ쎗ȹҪȺ쎘Ȼҫȼ쎙ȽҬȾ쎚ȿҭɀ쎛ɁҮɂ쎜ɃүɄ쎝ɅҰɆ쎞ɇұɈ쎟ɉҲɊ쎠ɋҳɌ쎡ɍҴɎ쎢ɏҵɐ쎣ɑҶɒ쎤ɓҷɔ쎥ɕҸɖ쎦ɗҹɘ쎧əҺɚ쎨ɛһɜ쎩ɝҼɞ쎪ɟҽɠ쎫ɡҾɢ쎬ɣҿɤ쎭ɥӀɦ쎮ɧӁɨ쎯ɩӂɪ쎰ɫӃɬ쎱ɭӄɮ쎲ɯӅɰ쎳ɱӆɲ쎴ɳӇɴ쎵ɵӈɶ쎶ɷӉɸ쎷ɹӊɺ쎸ɻӋɼ쎹ɽӌɾ쎺ɿӍʀ쎻ʁӎʂ쎼ʃӏʄ쎽ʅӐʆ쎾ʇӑʈ쎿ʉӒʊ쏀ʋӓʌ쏁ʍӔʎ쏂ʏӕʐ쏃ʑӖʒ쏄ʓӗʔ쏅ʕӘʖ쏆ʗәʘ쏇ʙӚʚ쏈ʛӛʜ쏉ʝӜʞ쏊ʟʠʡ\\Ӟ\"ʢʣӟ;"2%'""Y%a"
"''''''''""'C'Ϩ'ϩ'Ϫ'ϫ'Ϭ'ϭ'Ϯ'ϯ'ϰ'ϱ'ϲ'ϳ'ϴ'ϵ'϶'Ϸ'ϸ'Ϲ'Ϻ'ϻ'ϼ'Ͻ'Ͼ'Ͽ'Ѐ'Ё'Ђ'Ѓ'Є'Ѕ'І'Ї'Ј'Љ'Њ'Ћ'Ќ'Ѝ'Ў'Џ'А'Б'В'Г'Д'Е'Ж'З'И'Й'К'Л'М'Н'О'П'Я'п'р'с'т'у'ф'х'ц'ч'ш'щ'ъ'ы'ь'э'ю'я'ѐ'ё'ђ'ѓ'є'ѕ'і'ї'ј'љ'њ'ћ'ќ'ѝ'ў'џ'Ѡ'ѡ'Ѣ'ѣ'Ѥ'ѥ'Ѧ'ѧ'Ѩ'ѩ'Ѫ'ѫ'Ѭ'ѭ'Ѯ'ѯ'Ѱ'ѱ'Ѳ'ѳ'Ѵ'ѵ'Ѷ'ѷ'Ѹ'ѹ'Ѻ'Р'С]ѻ_Ѽ\"Ҁ썐У썑Ф썒Т썓а썔б썕в썖г썗д썘е썙ж썚з썛и썜й썝к썞л썟м썠н썡о썢Х썣Ц썤Ч썥Ш썦Щ썧Ъ써Ы썩Ь썪Э썫Ю썬ѽ썭Ѿ썮ҁ썯҂썰썱썲썳썴҇썵썶썷Ҋ썸ҋ썹Ҍ썺ҍ썻Ҏ썼ҏ썽Ґ썾ґ썿Ғ쎀ғ쎁Ҕ쎂ҕ쎃Җ쎄җ쎅Ҙ쎆ҙ쎇Қ쎈қ쎉Ҝ쎊ҝ쎋Ҟ쎌ҟ쎍Ҡ쎎ҡ쎏Ң쎐ң쎑Ҥ쎒ҥ쎓Ҧ쎔ҧ쎕Ҩ쎖ҩ쎗Ҫ쎘ҫ쎙Ҭ쎚ҭ쎛Ү쎜ү쎝Ұ쎞ұ쎟Ҳ쎠ҳ쎡Ҵ쎢ҵ쎣Ҷ쎤ҷ쎥Ҹ쎦ҹ쎧Һ쎨һ쎩Ҽ쎪ҽ쎫Ҿ쎬ҿ쎭Ӏ쎮Ӂ쎯ӂ쎰Ӄ쎱ӄ쎲Ӆ쎳ӆ쎴Ӈ쎵ӈ쎶Ӊ쎷ӊ쎸Ӌ쎹ӌ쎺Ӎ쎻ӎ쎼ӏ쎽Ӑ쎾ӑ쎿Ӓ쏀ӓ쏁Ӕ쏂ӕ쏃Ӗ쏄ӗ쏅Ә쏆ә쏇Ӛ쏈ӛ쏉Ӝ쏊ʠ\"ʣ;"Y%a
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''']_"썐썑썒썓썔썕썖썗썘썙썚썛썜썝썞썟썠썡썢썣썤썥썦썧써썩썪썫썬썭썮썯썰썱썲썳썴썵썶썷썸썹썺썻썼썽썾썿쎀쎁쎂쎃쎄쎅쎆쎇쎈쎉쎊쎋쎌쎍쎎쎏쎐쎑쎒쎓쎔쎕쎖쎗쎘쎙쎚쎛쎜쎝쎞쎟쎠쎡쎢쎣쎤쎥쎦쎧쎨쎩쎪쎫쎬쎭쎮쎯쎰쎱쎲쎳쎴쎵쎶쎷쎸쎹쎺쎻쎼쎽쎾쎿쏀쏁쏂쏃쏄쏅쏆쏇쏈쏉쏊";
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''
''''''''''''''''
''''''''
''''
''
'

Oh well... Well played , everybody. gg

Marbelous, 10 cycles
3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333334

There are 1023 3's and then one 4. This will print 511 3's (since 33 is the hexadecimal ascii value of 3) and one 4 (since 3 is the hexadecimal ascii value of 4). This keeps going until we are left with:
34

which prints 4 and is not a valid Marbelous program.
Another solution, using 22 distinct characters:
01333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333334
23
45
67
89
AB
CD
EF
AA
AA
AA
AA
AA
AA
AA
AA
ab
:ab
}0
\/3333

In this one I've defined a function that takes one input and prints two 3's. I then feed 16 inputs to it, which prints the number 3 32 times. This all consists of 64 characters. , then there are 959 3's and one 4. This all reduces to 511 3's and one 4. This then continues like the solution above. Since I can print two 3's by adding just 3 characters (any literal plus a newline), I can add a bunch more useless devices to the ab function to use more distinct characters. As long as 511 of the characters I use stay 3's and one a 4.

CJam, 10 Cycles, 947 Unique characters
I think I am getting a hang of it now. A sweet tricky approach to the problem brings be 937 unique characters and still space for more.
"\"['''''''''''''''']_\""`'`'''`"\"\\\"0123456789\\\";\"\"@ABCDEFGHIJKLMNOPQRSTUV\";"`'`'''`"\"WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~®¯°±²³´\";"`'`"\"µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂăĄąĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪ\";"`"īĬĭĮįİıĲĳĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňŉŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƀƁƂƃƄƅƆƇƈƉƊƋƌƍƎƏƐƑƒƓƔƕƖƗƘƙƚƛƜƝƞƟƠơƢƣƤƥƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽƾƿǀǁǂǃǄǅǆǇǈǉǊǋǌǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰǱǲǳǴǵǶǷǸǹǺǻǼǽǾǿȀȁȂȃȄȅȆȇȈȉȊȋȌȍȎȏȐȑȒȓȔȕȖȗȘșȚțȜȝȞ"`';"ȟȠȡȢȣȤȥȦȧȨȩȪȫȬȭȮȯȰȱȲȳȴȵȶȷȸȹȺȻȼȽȾȿɀɁɂɃɄɅɆɇɈɉɊɋɌɍɎɏɐɑɒɓɔɕɖɗɘəɚɛɜɝɞɟɠɡɢɣɤɥɦɧɨɩɪɫɬɭɮɯɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿʀʁʂʃʄʅʆʇʈʉʊʋʌʍʎʏʐʑʒʓʔʕʖʗʘʙʚʛʜʝʞʟʠʡʢʣʤʥʦʧʨʩʪʫʬʭʮʯʰʱʲʳʴʵʶʷʸʹʺʻʼʽʾʿˀˁ˂˃˄˅ˆˇˈˉˊˋˌˍˎˏːˑ˒˓˔˕˖˗˘˙˚˛˜˝˞˟ˠˡˢˣˤ˥˦˧˨˩˪˫ˬ˭ˮ˯˰˱˲˳˴˵˶˷˸˹˺˻˼˽˾˿̴̵̶̷̸̡̢̧̨̛̖̗̘̙̜̝̞̟̠̣̤̥̦̩̪̫̬̭̮̯̰̱̲̳̹̺̻̼͇͈͉͍͎͓͔͕͖͙͚̀́̂̃̄̅̆̇̈̉̊̋̌̍̎̏̐̑̒̓̔̽̾̿̀́͂̓̈́͆͊͋͌͐͑͒͗͛ͣͤͥͦͧͨͩͪͫͬͭͮͯ̕̚͘͜͟͢͝͞͠͡ͅͰͱͲͳʹ͵Ͷͷ͸͹ͺͻͼͽ;Ϳ΀΁΂΃΄΅Ά·ΈΉΊ΋Ό΍ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ΢ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώϏϐϑϒϓϔϕϖϗϘϙϚϛϜϝϞϟϠϡϢϣϤϥϦϧϨϩϪϫϬϭϮϯϰϱϲϳϴϵ϶ϷϸϹϺϻϼϽϾϿЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ";

Here is the output of all the cycles starting from initial state
"\"['''''''''''''''']_\""`'`'''`"\"\\\"0123456789\\\";\"\"@ABCDEFGHIJKLMNOPQRSTUV\";"`'`'''`"\"WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~®¯°±²³´\";"`'`"\"µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂăĄąĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪ\";"`"īĬĭĮįİıĲĳĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňŉŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƀƁƂƃƄƅƆƇƈƉƊƋƌƍƎƏƐƑƒƓƔƕƖƗƘƙƚƛƜƝƞƟƠơƢƣƤƥƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽƾƿǀǁǂǃǄǅǆǇǈǉǊǋǌǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰǱǲǳǴǵǶǷǸǹǺǻǼǽǾǿȀȁȂȃȄȅȆȇȈȉȊȋȌȍȎȏȐȑȒȓȔȕȖȗȘșȚțȜȝȞ"`';"ȟȠȡȢȣȤȥȦȧȨȩȪȫȬȭȮȯȰȱȲȳȴȵȶȷȸȹȺȻȼȽȾȿɀɁɂɃɄɅɆɇɈɉɊɋɌɍɎɏɐɑɒɓɔɕɖɗɘəɚɛɜɝɞɟɠɡɢɣɤɥɦɧɨɩɪɫɬɭɮɯɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿʀʁʂʃʄʅʆʇʈʉʊʋʌʍʎʏʐʑʒʓʔʕʖʗʘʙʚʛʜʝʞʟʠʡʢʣʤʥʦʧʨʩʪʫʬʭʮʯʰʱʲʳʴʵʶʷʸʹʺʻʼʽʾʿˀˁ˂˃˄˅ˆˇˈˉˊˋˌˍˎˏːˑ˒˓˔˕˖˗˘˙˚˛˜˝˞˟ˠˡˢˣˤ˥˦˧˨˩˪˫ˬ˭ˮ˯˰˱˲˳˴˵˶˷˸˹˺˻˼˽˾˿̴̵̶̷̸̡̢̧̨̛̖̗̘̙̜̝̞̟̠̣̤̥̦̩̪̫̬̭̮̯̰̱̲̳̹̺̻̼͇͈͉͍͎͓͔͕͖͙͚̀́̂̃̄̅̆̇̈̉̊̋̌̍̎̏̐̑̒̓̔̽̾̿̀́͂̓̈́͆͊͋͌͐͑͒͗͛ͣͤͥͦͧͨͩͪͫͬͭͮͯ̕̚͘͜͟͢͝͞͠͡ͅͰͱͲͳʹ͵Ͷͷ͸͹ͺͻͼͽ;Ϳ΀΁΂΃΄΅Ά·ΈΉΊ΋Ό΍ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ΢ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώϏϐϑϒϓϔϕϖϗϘϙϚϛϜϝϞϟϠϡϢϣϤϥϦϧϨϩϪϫϬϭϮϯϰϱϲϳϴϵ϶ϷϸϹϺϻϼϽϾϿЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ";
"\"['''''''''''''''']_\""`'`"\"\\\"0123456789\\\";\"\"@ABCDEFGHIJKLMNOPQRSTUV\";"`'`"\"WXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~®¯°±²³´\";"`"\"µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂăĄąĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪ\";""īĬĭĮįİıĲĳĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňŉŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƀƁƂƃƄƅƆƇƈƉƊƋƌƍƎƏƐƑƒƓƔƕƖƗƘƙƚƛƜƝƞƟƠơƢƣƤƥƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽƾƿǀǁǂǃǄǅǆǇǈǉǊǋǌǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰǱǲǳǴǵǶǷǸǹǺǻǼǽǾǿȀȁȂȃȄȅȆȇȈȉȊȋȌȍȎȏȐȑȒȓȔȕȖȗȘșȚțȜȝȞ";
"\"['''''''''''''''']_\""`"\"\\\"0123456789\\\";\"\"@ABCDEFGHIJKLMNOPQRSTUV\";"`"\"WXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~®¯°±²³´\";""µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂăĄąĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪ";
"\"['''''''''''''''']_\"""\"\\\"0123456789\\\";\"\"@ABCDEFGHIJKLMNOPQRSTUV\";""WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~®¯°±²³´";
"['''''''''''''''']_""\"0123456789\";""@ABCDEFGHIJKLMNOPQRSTUV";
['''''''''''''''']_"0123456789";
''''''''''''''''
''''''''
''''
''
'

As you can see, in each iteration, the right half of the line is a single string appended with ;, thus it gets removed while evaluating.
Try it online

Your newest version is not a radioactive quine anymore; it introduces new characters.

@Dennis -  Ah, updating

APL, 10 cycles
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''01'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

That is 511 's, characters 01, and then 511's
Explaintion
In APL, ' are NOT escaped as \' but ''. Yes, double quote marks!!
Proof of correctness
Suppose there are x quote marks on the left side of 01, and x is odd.
Then, number of quote marks on the left side of 01 in the output = (x-1)/2
Similarly, for x quote marks on the right, there is (x-1)/2 quote marks on the right in the output
So, for a program of length L, which has L/2-1 quote marks on each side, the output contains:

((L/2-1)-1)/2 = L/4-1 quote marks on the left
2 characters 01
and L/4-1 quote marks on the right

which gives a total of L/2 characters in the output.
Note that because x is a power of 2 minus 1, (x-1)/2 = ((2^n-1)-1)/2 = 2^(n-1)-1 is still a power of 2 minus 1 and odd if n>1
When n = 1, there are 0 quote marks on each side, so the output is 01, which evaluates to 1.

Once upon a time APL was the world's finest write-only language because five minutes after writing a program not even the author could explain to you what it did, or how.  Today we have languages such as CJam which have eclipsed it in terms of sheer obfuscatory power, but it's good to see that there's still life in the old dog. Well played, sir! :-)

@BobJarvis: I believe Iverson created APL as an example implementation of his notation, which was intended to be a math-like notation for vector operations. I think that's a laudable goal, and still laudable today; you could condense a lot of python programs (particularly those heavy on list comprehensions) into APL transformations. Perhaps it is better to imagine reading APL in size 36 font, as you would an integral, rather than as a line of 12 pixel code.

@PhilH : gee - I kinda thought it was an attempt to produce a Turing-complete implementation of ancient Egyptian hieroglyphics. :-)

authors: Bob Jarvis - Слава Україні


text:
Sort some apples!
Problem
Imagine 7 buckets lined up in a row. Each bucket can contain at most 2 apples.
There are 13 apples labeled 1 through 13. They are distributed among the 7
buckets. For example,
{5,4}, {8,10}, {2,9}, {13,3}, {11,7}, {6,0}, {12,1}

Where 0 represents the empty space. The order in which the apples appear within
each bucket is not relevant (e.g. {5,4} is equivalent to {4,5}).
You can move any apple from one bucket to an adjacent bucket, provided there is
room in the destination bucket for another apple. Each move is described by the
number of the apple you wish to move (which is unambiguous because there is only one empty space). For example, applying the move
7

to the arrangement above would result in
{5,4}, {8,10}, {2,9}, {13,3}, {11,0}, {6,7}, {12,1}

Objective
Write a program that reads an arrangement from STDIN and sorts it into the
following arrangement
{1,2}, {3,4}, {5,6}, {7,8}, {9,10}, {11,12}, {13,0}

using as few moves as possible. Again, the order in which the apples appear
within each bucket is not relevant. The order of the buckets does matter. It should output the moves used to sort each arrangement seperated by commas. For example,
13, 7, 6, ...

Your score is equal to the sum of the number of moves required to solve the following arrangements:
{8, 2}, {11, 13}, {3, 12}, {6, 10}, {4, 0}, {1, 7}, {9, 5}
{3, 1}, {6, 9}, {7, 8}, {2, 11}, {10, 5}, {13, 4}, {12, 0}
{0, 2}, {4, 13}, {1, 10}, {11, 6}, {7, 12}, {8, 5}, {9, 3}
{6, 9}, {2, 10}, {7, 4}, {1, 8}, {12, 0}, {5, 11}, {3, 13}
{4, 5}, {10, 3}, {6, 9}, {8, 13}, {0, 2}, {1, 7}, {12, 11}
{4, 2}, {10, 5}, {0, 7}, {9, 8}, {3, 13}, {1, 11}, {6, 12}
{9, 3}, {5, 4}, {0, 6}, {1, 7}, {12, 11}, {10, 2}, {8, 13}
{3, 4}, {10, 9}, {8, 12}, {2, 6}, {5, 1}, {11, 13}, {7, 0}
{10, 0}, {12, 2}, {3, 5}, {9, 11}, {1, 13}, {4, 8}, {7, 6}
{6, 1}, {3, 5}, {11, 12}, {2, 10}, {7, 4}, {13, 8}, {0, 9}

Yes, each of these arrangements has a solution.
Rules

Your solution must run in polynomial time in the number of buckets per move. The point is to use clever heuristics.
All algorithms must be deterministic.
In the event of a tie, the shortest byte count wins.

What's the point of denoting the destination when there is only one space you can move an apple to?

What if my brute-force solution runs in a reasonable amount of time? There are only 700M states - easily enumerable in the matter of minutes. Define "reasonable amount of time".

@JanDvorak Per "What's the point" - good call. That hadn't occurred to me. I'm defining reasonable here to be less than the amount of time required to brute force the solution ;)

Does your definition of "reasonable" mean we should first implement the brute-force solution, then anything that's faster counts?

Is final order of bucket important?

@JanDvorak Do you have any suggestions for how I could define a time limit that would prevent brute forcing a solution? Because this is about the best I've been able to think up.

@AMK Could you clarify? I don't understand your question. The order of the buckets is relevant.

@Orby This problem is still possible to solve optimally while staying faster than bruteforce. Not sure how much, but even a trivial heuristic for A* counts as faster than brute-force.

@Orby he means, is it allowed to have the buckets reordered as long as the correct apples are together?

I see, no the buckets cannot be reordered. I've clarified this in the question now.

@JanDvorak I certainly don't know how difficult it will be to solve optimally. I know that, in general, finding the shortest path in a pebble motion problem is NP-hard. I don't know if this particular one is. If it comes to it, it would be interesting to see some code golfed A* implementations.

@Orby you didn't specify the theoretical complexity of our algorithms, only they be faster than bruteforce

@JanDvorak I reiterate: Do you have any suggestions? This is not my area of expertise.

If you want golfed A*, keep it as is. I think they'll be fast enough - and golfing A* should be fun. A suggestion for future challenges would be (optimise x while keeping your theoretical complexity at O(f n)).

@JanDvorak Do you think polynomial time would be a reasonable constraint?

Please visit our sandbox the next time, where we can help smooth out your challenge before it's posted.

@JanDvorak Will do

@Orby depends on the challenge. Also note that you need an infinite family of inputs if you want to judge asymptotic complexity. Here, the generalisation is obvious, but I think a linear time per move would be really limiting.

Let us continue this discussion in chat.

Can input be in some other format?

@proudhaskeller So long as it isn't dramatically different, e.g. changing curly braces to brackets or adding extra brackets around the expression is fine. And make sure you specify the format in your solution.

@Orby: It's worth pointing out that finding the optimal solution is NP hard. A simple bubble sort runs in O(n^2) and hence would be admissible as a solution.

@COTO Indeed. I was actually thinking of submitting it as a reference implementation.

@Orby damn. I thought I'd make it my contestant. Go ahead...

@JanDvorak Don't let me stop you :)

@Orby: You stipulate the algorithm must sort the list "using as few moves as possible" and in polynomial time, but you acknowledge that the problem of sorting the list using as few moves as possible is NP hard and hence can't (consistently) be solved in polynomial time. This leaves only the possibility of sorting the test lists in the fewest number of moves "by accident" (i.e. writing an algorithm in P that happens to realize the optimum for the test cases). Or when you say "as few moves as possible", do you mean "where rank is determined by fewest number of moves made"?

@COTO When I say, "as few moves as possible", I mean that the intention is to minimize the number of moves utilized. I realize that an optimum algorithm can't possibly execute in polynomial time.

C, 426 448
This sorts apples one at a time from 1 to 13 similar to yasen's method, except whenever it has an opportunity to move a larger number up or a smaller number down, it will take it. Sadly, this only improves performance on the first test problem, but its a small improvement. I made a mistake when running the test problems. It seems I've simply reimplemented yasen's method.
#1: 62    #6: 40
#2: 32    #7: 38
#3: 46    #8: 50
#4: 50    #9: 54
#5: 40    #10: 36

It takes input without braces or commas, e.g.
8 2 11 13 3 12 6 10 4 0 1 7 9 5

Here is the golfed code coming in at 423 bytes counting a few unnecessary newlines (could probably be golfed more, but I expect this score to be beaten):
#define N 7
#define F(x,y) for(y=0;y<N*2;y++)if(A[y]==x)break;
#define S(x,y) x=x^y,y=x^y,x=x^y;
#define C(x,y) ((A[x*2]==y)||(A[x*2+1]==y))
A[N*2],i,j,d,t,b,a,n,s,v,u,w,g;main(){for(;i<N*2;i++)scanf("%d",A+i);g=1;while
(!v){F(0,i);b=i/2;F(g,u);w=u/2;d=b<w?1:-1;n=(b+d)*2;a=(b+d)*2+1;if(A[n]>A[a])
S(n,a);t=d-1?a:n;printf("%d,",A[t]);S(A[i],A[t]);while(C((g-1)/2,g))g++;v=1;for
(j=0;j<N*2;j++)if(!C(j/2,(j+1)%(N*2)))v=0;}}

And the ungolfed code, which also prints the score:
#include <stdio.h>
#include <stdlib.h>

#define N 7

int apples[N*2];

int find(int apple)
{
    int i;
    for (i = 0; i < N*2; i++) {
        if (apples[i] == apple)
            return i;
    }
}

void swap(int i, int j)
{
    int temp;
    temp = apples[i];
    apples[i] = apples[j];
    apples[j] = temp;
}

int contains(int bucket, int apple)
{
    if ((apples[bucket * 2] == apple) || (apples[bucket * 2 + 1] == apple))
        return 1;
    return 0;
}

int is_solved()
{
    int i, j;
    for (i = 0; i < N * 2; i++) {
        j = (i + 1) % (N * 2);
        if (!contains(i / 2, j))
            return 0;
    }
    return 1;
}

int main()
{
    int i, j, dir, bucket, max, min, score;
    int target_i, target_bucket, target;

    /* Read the arrangement */
    for (i = 0; i < N*2; i++) {
        scanf("%d ", apples + i);
    }

    target = 1;
    while (1) {

        i = find(0);
        bucket = i / 2;
        target_i = find(target);
        target_bucket = target_i / 2;

        /* Change the direction of the sort if neccesary */
        if (bucket < target_bucket) dir = 1;
        else dir = -1;

        /* Find the biggest and smallest apple in the next bucket */
        if (apples[(bucket + dir) * 2] < apples[(bucket + dir) * 2 + 1]) {
            min = (bucket + dir) * 2;
            max = (bucket + dir) * 2 + 1;
        } else {
            min = (bucket + dir) * 2 + 1;
            max = (bucket + dir) * 2;
        }

        /* If we're going right, move the smallest apple. Otherwise move the
           biggest apple */
        if (dir == 1) {
            printf("%d, ", apples[min]);
            swap(i, min);
            score++;
        } else {
            printf("%d, ", apples[max]);
            swap(i, max);
            score++;
        }

        /* Find the next apple to sort */
        while (contains((target - 1) / 2, target))
            target++;

        /* If we've solved it then quit */
        if (is_solved())
            break;
    }
    printf("\n");
    printf("%d\n", score);
}

Score: 448
My idea is to sort them consecutively, starting with 1. This gives us the nice property that when we want to move the space to the previous/next basket, we know exactly which of the two apples there we have to move - the max/min one, respectively. Here is the test breakdown:
#1: 62     #6: 40
#2: 32     #7: 38
#3: 46     #8: 50
#4: 50     #9: 54
#5: 40    #10: 36

Total score: 448 moves

The code can be golfed a lot more, but better quality of the code will motivate additional answers.
C++ (501 bytes)
#include <cstdio>
#define S(a,b) a=a^b,b=a^b,a=a^b;
int n=14,a[14],i,j,c,g,p,q;
int l(int x){for(j=0;j<n;++j)if(a[j]==x)return j;}
int sw(int d){
    p=l(0);q=p+d;
    if(a[q]*d>a[q^1]*d)q^=1;
    printf("%d,", a[q]);
    S(a[q],a[p])
}
int main(){
    for(;j<n;scanf("%d", a+j),j++);
    for(;++i<n;){
        c=l(i)/2;g=(i-1)/2;
        if(c-g){
            while(l(0)/2+1<c)sw(2);
            while(l(0)/2>=c)sw(-2);
            while(l(i)/2>g){sw(2);if(l(i)/2>g){sw(-2);sw(-2);}}
        }
    }
}

Further improvements may be switching to C and trying to lower the score by starting from the large values downwards (and them eventually combining both solutions).

A substring of your code already forms a C program. Specifically, it could work in C by simply deleting the first line.

@feersum You're right. At the beginning, I had more C++ specific code, but after that with the switch to C in mind, it seems I got rid of it.

Could you specify that you've changed the input format in your solution to make it more clear to those who try to verify it?

Python 3 - 121
This implements a depth-first searching with increasing depth until it finds a solution. It uses a dictionary to store visited states so that it doesn't visit them again unless with a higher depth window. When deciding which states to check, it uses the number of misplaced elements as a heuristic, and only visits the best states possible. Note that since the order of the elements within their bucket does not matter, it always maintains an ordering within the buckets. This makes it easier to check if an element is misplaced.
The input is an array of ints, with the first int being the number of buckets.
So for instance, for #8 (this one takes a very long time to run on my machine, the others finish in seconds):
c:\python33\python.exe apples.py 7 3 4 10 9 8 12 2 6 5 1 11 13 7 0

Here are the results on the test set:
 #1: 12,
 #2: 12,
 #3: 12,
 #4: 12,
 #5: 11,
 #6: 11,
 #7: 10,
 #8: 14,
 #9: 13,
 #10: 14
Here is the code:
import sys

BUCKETS = int(sys.argv[1])

# cleans a state up so it is in order
def compressState(someState):
  for i in range(BUCKETS):
    if(someState[2*i] > someState[2*i + 1]):
      temp = someState[2*i]
      someState[2*i] = someState[2*i + 1]
      someState[2*i + 1] = temp
  return someState

state = compressState([int(x) for x in sys.argv[2:]])
print('Starting to solve', state)
WINNINGSTATE = [x for x in range(1, BUCKETS*2 - 1)]
WINNINGSTATE.append(0)
WINNINGSTATE.append(BUCKETS*2 - 1)
maxDepth = 1
winningMoves = []
triedStates = {}

# does a depth-first search
def doSearch(curState, depthLimit):
  if(curState == WINNINGSTATE):
    return True
  if(depthLimit == 0):
    return False
  myMoves = getMoves(curState)
  statesToVisit = []
  for move in myMoves:
    newState = applyMove(curState, move)
    tns = tuple(newState)
    # do not visit a state again unless it is at a higher depth (more chances to win from it)
    if(not ((tns in triedStates) and (triedStates[tns] >= depthLimit))):
      triedStates[tns] = depthLimit
      statesToVisit.append((move, newState[:], stateScore(newState)))
  statesToVisit.sort(key=lambda stateAndScore: stateAndScore[2])
  for stv in statesToVisit:
    if(stv[2] > statesToVisit[0][2]):
      continue
    if(doSearch(stv[1], depthLimit - 1)):
      winningMoves.insert(0, stv[0])
      return True
  return False

# gets the moves you can make from a given state
def getMoves(someState):
  # the only not-allowed moves involve the bucket with the 0
  allowedMoves = []
  for i in range(BUCKETS):
    if((someState[2*i] != 0) and (someState[2*i + 1] != 0)):
      allowedMoves.append(someState[2*i])
      allowedMoves.append(someState[2*i + 1])
  return allowedMoves

# applies a move to a given state, returns a fresh copy of the new state
def applyMove(someState, aMove):
  newState = someState[:]
  for i in range(BUCKETS*2):
    if(newState[i] == 0):
      zIndex = i
    if(newState[i] == aMove):
      mIndex = i
  if(mIndex % 2 == 0):
    newState[mIndex] = 0
  else:
    newState[mIndex] = newState[mIndex-1]
    newState[mIndex-1] = 0
  newState[zIndex] = aMove
  if((zIndex % 2 == 0) and (newState[zIndex] > newState[zIndex+1])):
    newState[zIndex] = newState[zIndex+1]
    newState[zIndex+1] = aMove
  return newState

# a heuristic for how far this state is from being sorted
def stateScore(someState):
  return sum([1 if someState[i] != WINNINGSTATE[i] else 0 for i in range(BUCKETS*2)])

# go!
while(True):
  triedStates[tuple(state)] = maxDepth
  print('Trying depth', maxDepth)
  if(doSearch(state, maxDepth)):
    print('winning moves are: ', winningMoves)
    break
  maxDepth += 1

I've upvoted this because it is useful to see optimal solutions, but notice that this does not run in polynomial time in the number of buckets per move as required by the question. I don't believe that any algorithm which produces an optimal solution (in general) can run in polynomial time.

For the first test problem, your program generates 10, 8, 1, 12, 6, 7, 11, 3, 5, 13, 4, 9, which is not a valid solution. I think you may have misunderstood the question. Notice the question states that "You can move any apple from one bucket to an adjacent bucket" i.e. the bucket to the right or left of it (not an arbitrary bucket).

Oh, I totally missed the adjacency restriction! After I posted this I had a nagging suspicion that the running time restriction was violated too. I wasn't 100% sure as I was writing it, because the dynamic programming element of avoiding repeated states confused me. Thanks for the upvote even though this fails on two counts; this is a fun puzzle and I'll see if I can come up with a better, valid answer.


text:
Unnecessary Text Abbreviations
Introduction
I can't stand text abbreviations, mainly because for the most part I have no idea what most of them mean. Of course, cut backs need to be made, so if they are necessary to fit the text in the character limit, I'll allow them.
Challenge
You have to write a program that takes passage of text and determines whether text abbreviations are required to fit the passage in the 140 character limit (as used by Twitter).
The passage can be read from a plaintext file, supplied via system arguments or input by a user. You may not hardcode it.
Determining
Your program needs to replace all abbreviations (Note: Don't, can't, won't etc. are allowed) found in the passage and replace them with full words. If the expanded passage fits within 140 characters, then abbreviations are unneccessary. Otherwise, abbreviations are necessary. Any unknown abbreviations should be treated as standard words.
The output should be boolean (True if necessary or False otherwise) but if the passage was longer than 140 characters in the first place, then Tl;dr should be printed.
Abbreviations
All abbreviations required are detailed here. You decide how you parse the information. You may store the list in a local file of any name, providing that the list is taken from the provided URL.
Abbreviations should be defined as all in capital letters (eg. LOL, LMFAO, OP not lol, lmfao, op).
Note: In several cases, the abbreviation is not the standard format (abbreviation -> meaning) and sometimes has multiple meanings, words and/or spellings. Ignore all of these cases. For clarification, all abbreviations that you need to worry about should be single word.
Ignore all non alphabetic abbreviations (e.g. Ignore <3,99). Abbreviations that start with an alphabetic character can be parsed (e.g. Do not ignore A/S/L,L8).
Test cases (taken from random tweets)
1: Returns true

IDG people who MSG U and still lag even THO U reply straight away like how did U become that busy in 5 secs that U can't communicate LOL CYA

2: Returns false

If your role models are celebrities; Athletes, Actors, Singers, Politicians, etc then you need a life coach. ASAP.

3: Returns Tl;dr

For your information: we technically live about 80 milliseconds in the past because that's how long it takes our brains to process information.

Winning Criteria
The shortest code wins.
Based upon the alt-text of xkcd 1083
Thanks to Ingo Bürk, here's a JSON file of the list

What about or in that list? There is at least one entry where the or is part of the acronym (2B or not 2B) and one where it lists two variations of the acronym (ZMG or ZOMG). There is also KFY -or- K4Y (with the dashes). The acronyms LBR and LGR have single entry (acronym and explanation combined with and). I think I've found a winner: THX or TX or THKS. Other problematic ones: AS, RTM or RTFM (both of which come with two different explanations)

I can't stand text abbreviations +1, no need to read the rest...

By the way, the limit for SMS is usually 160 characters.

So just to make sure, we are free to choose any format for the "dictionary" file that we want?

If anyone wants to use it, here is a JSON file containing the dictionary from the website.

How do we handle abbreviations like "2" - where it could mean the number "2", "to", "two", or "too"?

Ignore all non-alphabetic abbreviations. This includes numbers such as 2 and 8.

Can't we just ignore all the oddities with or and and? This isn't supposed to be a useful program, and for the golfing part, it's really quite tedious to sort all of these different cases out (there's or, -or-, and, slahes, commas, alternatives in parentheses and explanations instead of verbatim meanings). How about we just pretend those were the verbatim abbreviations and meanings? Then the only ambiguity is that some abbreviations are contained in others: e.g. there's LOL and LOL WUSS. If I expand LOL I can't expand LOL WUSS any more. How do we handle these?

ECMAScript 6 + HTML (117 123 144)
Using HTML to store the dictionary. Try it online (with any ECMAScript 6 browser such as Firefox).
d=eval(d.innerHTML),t=r=prompt(l=140);for(k in d)r=r.replace(RegExp(k,'g'),d[k])
alert(t.length>l?'Tl;dr':r.length>l)

I'm just blatantly ignoring the currently open questions to this challenge, hoping it won't render my solution incorrect. YOLO #abbreviations
Explanation
The dictionary has been filtered according to the rules (ignoring abbreviations starting with non-alphanumeric character, ignoring multi word abbreviations, only considering uppercase abbreviations, using first replacement if there are options).
To save bytes in the code, the dictionary has also been transformed such that the key is already a regular expression with word boundary match to deal with punctuation.
Then the actual code becomes a matter of reading the tweet, doing all the replacements and checking for the length.
The script used for preparation can be found here. It is based upon the JSON file I have extracted from the website.

Edit #1: Thanks to Optimizer for golfing it down for a win of 21 bytes
Edit #2: Another 6 bytes thanks to Optimizer's tip of using eval.

This is shorter - 123 characters:
alert(t.length>l?'Tl;dr':r.length>l)```
And if you can use `eval` instead of `JSON.parse`, even shorter

@Optimizer Ah, I forgot about Object.keys. I don't know why I thought extracting length would be shorter. Inlining l=140 is a neat trick. Thanks for the 21 bytes. :)

Wow, that's nice! What's the 140 in the prompt text though?

@BetaDecay It just creates the variable with value 140 . Doing it inside the prompt is only to save another bytes because it requires no additional , or ;.

Yeah, because prompt's argument is the text to be shown in the popup. That's okay though as its not against the rules

@Optimizer Just now saw the edit. eval saves another 6 bytes. You're the man :) Although I was considering not taking advantage of this just because it's eval. My body almost didn't let me do it.

PPCG is all about overcoming your mental and physical fears ;)


text:
Crack the code to the combination lock
Given a standard combination lock like the one in the picture. The way to unlock it is to align the 4 numbers in the code on the combination line. After years of loyal service you have been fired from the lock factory and have decided to exact revenge by not jumbling up the locks before you send them off, thus leaving every lock with the combination to unlock it on the combination line.

You also know that by looking at the order of the numbers in the other lines it is possible to work out what numbers must be on the combination line (and therefore the combination to unlock it is).
If every line on the lock is given a number starting from line 0 for the combination line (the line which unlocks the lock) to line 9. For example, if the numbers on line 4 are 5336, then the combination to unlock it would be 1992.
Unfortunately the locks have already been packaged and your view of each lock is obscured, so you can only see numbers on different lines of the lock.
The Challenge
Given 4 pairs of digits, where the first digit of the integer represents the line number and the second digit represents the the number which appears on that line, work out the combination to the lock.
For example if you input:
57 23 99 45

Then it should output:
2101

Or
25 78 63 15

and
3174

Assume the input will always be 4 positive integers in the form `25 64 72 18.
This is code-golf, so the shortest programs in number of bytes wins.
Also this is my first question, so any feedback is appreciated.

I think you need to clarify the input. You say "Given 4 pairs of integers" and then give an example 57 23 99 45. That's not four pairs of integers: it's four integers. And some answers are assuming they get that as a string, whereas others are assuming that it comes ready-parsed as 4 ints.

I disagree, the fact that it said four pairs of integers made the format of the input clear, 57 is the integer pair 5 and 7, not the integer 57.  My first assumption was that the line was 57 and the combination was 23.

How about "pairs of digits?" That would be much more clear and precise (and also works with leading 0s).

Technically, the correct term would be permutation lock. Most "combination locks" are actually permutation locks, because the order of the digits makes a difference.

Technically yes it is correct, but I don't think makes for a catchy title.

I agree, I just wanted to point that out.

CJam, 9 8 bytes
ea9fbAf%

Reads the digit pairs as command-line arguments. To try the code online, change ea to lS/ to read from simulated STDIN.
Example run
$ cjam <(echo ea9fbAf%) 57 23 99 45; echo
2101
$ cjam <(echo ea9fbAf%) 25 78 63 15; echo
3174

How it works
The character code of the digit d is 48 + d. Thus, considering the two-digit string xy a base 9 number yields 9 * (48 + x) + (48 + y) = 10 * (48 + x) + y - x ≡ y - x (mod 10).
ea       " Push the array of command-line arguments.                                      ";
  9fb    " Mapped base 9 conversion; replace each string 'xy' with (9 * ord(x) + ord(y)). ";
     Af% " Take the results modulo 10.                                                    ";

Dammit, you can't let anyone else win, no ? :P

I don't think we'll get a better CJam answer than this

What just happened there?

As many bytes of code as there are bytes of (meaningful) input. Crazy.

Very clever!  Though I'm not quite sure how 99 can be read as a base 9 number - I guess each digit is taken mod 9 before interpretation?  Interestingly dc seems to do something similar, so I'm borrowing this trick for my (longer) answer, if thats OK?

@DigitalTrauma: Sure, go ahead. The string "99" is actually interpreted as the array [57 57] by b; "xy"9b is implemented as 9 * ord(x) + ord(y). I should add that to my answer.

CJam is compact enough that you can probably generate the answers to most of these questions with brute force.  Just try all the possible programs of increasing length up to maybe 10,000 steps.

10,000 barely covers all 2-character programs if we restrict possible solutions to printable ASCII.

CJam, 13 12 11 characters
Thanks to user23013, its now down to 11 characters :)
4{Ar:--A%}*

Explanations:
4{       }*     "Run the code block 4 times";
   r            "Read the next input token (whitespace separated)";
    :-          "Subtract 2nd number from the first treating r as a 2 numbered string";
  A   -         "Subtract the result of above from 10";
       A%       "Take modulus of 10 and store it on stack";

Try it online
I know it can be golfed more. But this is my first real attempt on CJam and I am limited by experience :)

Alternatively, the other methods to do the same thing in 1 extra character:
l~]{_A/-A%}/     // My previous solution

or
4{ri_A/-A%}*     // As pointed out by Ingo

or
ea{i_A/-A%}/     // If input is passed through command line

I was waiting for this. Well, next week...

The first three characters could alternatively be l~]. I feel like parsing the input should be possible with less than three, but I've never used CJam before :/

4{ri_A/-A%}* is one byte shorter.

Ah, or what you made from my earlier comment. Well now there are two 12 byte solutions! :)

Or 4{Ar:--A%}*.

Now if only CJam also allowed non-matched }s similar to ]. I love the purity of CJam here – the code does exactly the steps logically involved without hiding them in built-in commands. It's very satisfying.

Golfscript (14 13)
Try it online here
It's pretty much the same as Optimizer's solution, but in a different language. It's hard to approach it in a different way because the problem is fairly simple, so the tie definitely goes to Optimizer, whose entry was earlier anyway.
~]{.10:^/-^%}/

For the same number of bytes you can do
~]{.10/- 10%}/

No pre defined variable with value 10 in Golfscript ?

@Optimizer Unfortunately, no. Too bad, because having the input on the stack already would be the advantage over CJam.

Yeah, it can be 10 characters in CJam (with input on stack) or 11 in Golfscript (with pre defined variable)

I could have 12 in Golfscript as well if only I didn't have to leave the space in - 10.

heh, even the shortest of languages have their short comings :P

But the standard input on the stack should be a string.

@Optimizer In fact there is a predefined string of character 10... But there is no easy way to use it.

@user23013 You're right. I'll fix it.

C 64 63 56 or 61
If the input can be piped from file
main(a){while(scanf("%d",&a)>0)putchar(48+(a-a/10)%10);}

If the input should be typed to stdin
i;main(a){for(;i++-4;putchar(48+(a-a/10)%10))scanf("%d",&a);}

Reads the four numbers in a loop and then processes each by subtracting the first digit from the value and printing the result modulo 10.
Savings thanks to various comments below and also using putchar instead of printf

Cool. You can save a comma by putting the scanf outside the for() like this a,i;main(){for(;i++-4;printf("%d",(a-a/10)%10))scanf("%d",&a);}

You could also save 2 bytes by using a*.9 instead of a-a/10

@steveverrill Like it.  So focussed on putting everything in the for loop that I missed that

@AcidShout Sorry - it doesn't work. For example 78 * .9 = 70.2, while 78 - 78/10 = 71.   Also using .9 promotes the argument to a double so I can't take the mod.

You could save a few bytes by using a while loop and declaring a as an argument of main: main(a){while(scanf("%d",&a)>0)printf("%d",(a-a/10)%10);}

@Dennis On my system at least, scanf continues waiting for input so the program does not terminate, although I agree that it gives the right output first.  Feels like cheating though, which is why I had to add the loop counter.

Did you type in the numbers or pipe them? With piped input, scanf should return -1 (EOF), causing the program to terminate.

Typed, according to input spec as I read it.  Good point though.  If the OP allows it that would save several characters.  I'll certainly remember that for future challenges too.

GNU dc, 14 bytes
Borrowing @Dennis's clever base 9 trick:
9i[?A%nd]dxxxx

Input integers read from STDIN, one per line.
Explanation:
9i                # Set input radix to 9
  [     ]         # push a macro, defined thus:
   ?              #   read number from STDIN and push
    A             #   push literal 10
     %            #   calculate number mod 10
      n           #   print, with no newline
       d          #   duplicate macro
         d        # duplicate macro
          xxxx    # execute the macro 4 times

Output:
$ for i in 57 23 99 45; do echo $i; done | dc ./combolock.dc
2101$
$ for i in 25 78 63 15; do echo $i; done | dc ./combolock.dc
3174$
$

Previous Answer, 18 bytes:
Because I thought I could get closer to the "golfing" languages with this (but didn't):
[A?A~--A%n]dddxxxx

You can save a byte: 9i[?A%nd]dxxxx

@Dennis - Fantastic! Now I'm neck-and-neck with golfscript and APL!

Python 3 , 64
Straightforward.
print(''.join([(i-i//10)%10 for i in map(int,input().split())]))

It can be shorter if I'm allowed to print, say, [2, 1, 0, 1] instead (46):
print([i%10-i//10 for i in map(int,input().split())])

You can save some by taking str((i-i//10)%10) directly instead of using a second map().  I started with generators too for mine, but found that an actual for loop ended up being shorter.

Yup, thanks for that!

Why are you using list-comprehensions? Use genexps to save 2 characters: print(''.join((i-i//10)%10for i in map(int,input().split()))). Also if spaces are allowd in the output you can avoid join and use tuple-unpacking: print(*((i-i//10)%10for i in map(int,input().split()))).

I guess you're right.

C, 92
#define a(n) ,(10+v[n][1]-*v[n])%10
main(int c,char**v){printf("%d%d%d%d"a(1)a(2)a(3)a(4));}

Input from commandline. Subtracts the first ASCII code of each argument from the second, adds 10 and takes modulo 10.
I think this is the first time I've written a printf with four %s and no comma (the comma is in the  #define.)

#define f scanf("%c%c ",&a,&b);putchar(48+(9*a+b)%10) followed by a,b;main(){f;f;f;f;} would be 18 bytes shorter.

@Dennis that's a great improvement, but it's basically a completely different program. I think if anyone posts it, it should be you, not me. I'm not sure if the space in scanf is necessary, given that scanf is supposed to parse whitespace only as a separator. Alchymist has an even better idea in C. But it looks like you've already won it with your Cjam answer.

Yeah, I started by noticing that the space after a(n) can be omitted, then I noticed that putting printf("%d%,...) around your macro would save a few bytes and finally I got a little carried away... -- The space is needed since %c reads a character, any character, so on the second run it would store 32 in a. -- Beating CJam with C should prove to be hard. printf() is already as long as  my answer...

Java - 203 bytes
Just because there has to be a Java entry, I saw a nice opportunity to give this code golfing a chance (first submission ever).
class M{public static void main(String[] a){String r="";for(int i=0;i<4;i++){int l=Byte.valueOf(a[i].substring(1));int f=Byte.valueOf(a[i].substring(0,1));r+=(l-f<0)?l-f+10:l-f;}System.out.print(r);}}

If there's room for some improvements, I'd glad to know about them ;-)

You can search [tips] and get various tips about golfing to get you started :)

Cool, thanks! Checking out some tips helped me shaving off 13 bytes :)

Lua - 46 characters
while''do a,b=io.read(1,1,1)print((b-a)%10)end

Reads three characters at a time (grant me the small mercy of inputing a space at the end), and eventhough a and b are string-y... b-a MAGICALUALY allows them to conceive a healthy baby integer. Does the wrap-around check while printing.

Could you provide an example data input/output, can't seem to get it to run on Ideone

@Harry12345 Ah, sorry about that. Anarchy Golf is setting my mind on how I implement stdinput. I could probably code it better, but meh, lua is terrible. I posted an example of me running the program.

JavaScript ES6 – 53 43 bytes
f=n=>n.replace(/.. ?/g,a=>(1+a[1]-a[0])%10)

Fairly straightforward function, uses regex to get the numbers. Try it out at http://jsfiddle.net/efc93986/1/. If functions are not allowed, a standalone program at 52 bytes:
alert(prompt().replace(/.. ?/g,a=>(1+a[1]-a[0])%10))

As ES6 currently only works on Firefox, the following code works on any modern browser, at 70 bytes:
alert(prompt().replace(/.. ?/g,function(a){return(1+a[1]-a[0])%10}))

I love your 1+.

The question says to assume valid input, so you can use ...? instead of /\d+ ?. The space after return can be omitted. Also, since no specific I/O was specified, you should be able to use a function.

a-a[0] instead of 1+a[1]-a[0] should work as well.

Python 2 - 33 bytes
for i in input():print(i-i/10)%10

Accepts comma-delimited user input.
E.g. Input:
29,26, 31, 88

Output:
7
4
8
0

If output is required to exactly match the example then it is much longer. 47 bytes:
print"%d"*4%tuple((i-i/10)%10 for i in input())

input() doesn't work in my Python 2 interpreter.

@SohamChowdhury did you use commas?

Oh, no, I didn't. It works now.
On a side note, I think you need to take space-delimited input per the spec.

I agree, input should be space de-limited

APL, 14
10|{--/⍎¨⍕⍵}¨⎕

Explaination
⎕ takes input from screen. Space-separated values are parsed as an array.
{...}¨ for each number, feed it into function.
⍎¨⍕⍵ takes the argument, create an array of its digits.
--/ calculates units minus tens.
10| mod 10.

This may be 14 characters, but it is 24 bytes.

@IngoBürk http://codegolf.stackexchange.com/questions/2078/the-alphabet-in-programming-languages/2127#2127

but for code golf we count in UTF-8, not some special charset. That'd just be a loophole and could be abused very easily.

@IngoBürk As per http://meta.codegolf.stackexchange.com/a/961/6972 answers can be encoded in any encoding unless the OP states otherwise. There is indeed an IBM codepage for APL characters which is a single-byte mapping, which is exactly what Dyalog used to use before Unicode 3.0. If you insist on Unicode, what if I invent a new language that uses non-Unicode characters? How would you count bytes for that?

I could've sworn the default was UTF-8. 14 bytes it is, then.

Haskell 60 58
main=interact$show.map((\x->mod(x-x`div`10)10).read).words

Single character digits, a real nemesis in Haskell golfing.

J - 20 15
The non-verb form (as statement instead of function definition) it's 5 characters shorter:
10|-~/|:10#.inv

The verb form which is a nice train:
10|[:-~/[:|:10#.inv]

This verb used on the example inputs:
   10|-~/|:10#.inv 57 23 99 45
2 1 0 1
   10|-~/|:10#.inv 25 78 63 15
3 1 7 4

rotd =: 10|[:-~/[:|:10#.inv] NB. verb form

   rotd 25 78 63 15
3 1 7 4
   rotd 57 23 99 45
2 1 0 1

Perl: 38 40
print abs($_-int$_/10)%10for split" ",<>

Output:
% perl code.pl
57 23 99 45
2101

25 78 63 15
3174

Underscores are markdown syntax, so your code got a little messed up. To prevent this, indent code with four spaces. 2. abs isn't necessary; x - x/10 cannot be negative. 3. If you use the flags -040pe (usually counted as 5 bytes) to iterate over space-delimited input, you  can shorten your code to $_=($_-int$_/10)%10. 4. If you prefer to avoid command-line flags, you can still save a few bytes by setting $/=$; and removing the call to split.

Ruby, 35 bytes
$*.map{|n|a,b=n.bytes;$><<(b-a)%10}

Explanation
Input is taken as command line arguments. String#bytes returns an Array of Integers (ASCII character codes). Only the difference between the last and first character code is of importance, not the Integers themselves.

C++ 118
int main()
{
int a,b,c;
for(int i=0; i<4; i++)
{
cin>>a;
b=a/10;
a=a%10;
c=a-b;
if(c<0)c+=10;
cout<<c;
}
}

Not sure about other compilers, but GCC requires #include<iostream> and std:: before cin and cout. 2. You don't need the conditional if you omit a=a%10. 3. You don't need the variables b and c, the linefeeds and (with a few modification) the brackets around the for loop.

@SeanD: Please don't approve edits that modify code. In this particular case, the edit made the answer invalid. It also removed the first line, which should be present in all answers.

(CC @TeunPronk)

@Dennis usually answers on this site don't include preprocessor lines. I omitted the lines #include<iostream>and using namespace std;

I know there not usually included in the byte count, but I think they should be present in the answer.

C# & LinqPad: 104
Util.ReadLine<string>("").Split(' ').Select(s =>(s[1]-s[0])).Aggregate("",(r,a)=>r+(a<0?10+a:a)).Dump();

PHP - 90 characters
Thought I'd give code golf a try so here it is, my first attempt - can probably be golfed more.
<?php $a=array(57,23,99,45);foreach($a as$b){echo abs(substr($b,0,1)-substr($b,1,1)%10);}

58 characters (courtesy of Ismael Miguel)
for($i=0,$a=$_GET[n];$i<8;)echo abs($a[$i++]-$a[$i++]);

Access file using
file.php?n=57239945

Try this code: <? for($i=0;$i<4;)echo abs($_GET[n][$i]%10); which is 44 chars long. Access from a browser using file.php?n[]=xx&n[]=yy&n[]=xy&n[]=yx. (untested code)

Good idea using $_GET but it displays 57%10 and I need (5-7)%10

Try this one: <? for($i=0,$a=$_GET[n];$i<4;++$i)echo abs($a[$i][0]-$a[$i++][1]%10);. Sadly, it's 65 bytes long. (forgot the $i increment on the last one) Or you could try <? for($i=0;$i<8;)echo abs($_GET[n][$i++]-$_GET[n][$i++]%10); and access the browser using file.php?n[]=x&n[]=y&n[]=x&n[]=y&n[]=x&n[]=y&n[]=x&n[]=y, being 61 bytes long.

Yeah the second ones works, need to do $_GET['n'] tho. Have edited my answer.

Well, it isn't required. It simply issues a warning. That is fine for this website. But try this one: <? for($i=0,$a=$_GET[n];$i<8;)echo abs($a[$i++]-$a[$i++]);. The %10 is useless and this one simply looks better. Also, you can access it using file.php?n[]=xyxyxyxy. This solution is 58 bytes long.

Good work! Think I'm going to need to practice some more

No one is perfect, I'm not perfect. As you could see, I made some mistakes on the way. If you are worried about warnings, you can replace $a=$_GET[n] with @$a=$_GET[n].

Python 3, 60
for x in input().split():print(-eval('-'.join(x))%10,end='')

Input and output exactly as specified, although it doesn't print a trailing newline.  Two interesting tricks here: 1) replacing two calls to int() with one call to eval(), and 2) using join() to get a-b, then negating it for b-a as required.  Fortunately Python's modulo operator gives positive values even if the first argument is negative!

Why was this downvoted? It works perfectly fine. (Btw, the eval('-'.join(x)) trick is brilliant.)

@flornquake Thanks!

authors: Займись Собой