Python 2 / Python 3 - 128

n=int(input())
s="Isf  tthhies ,b oIs sq ufiitn.d"
print(["not "*any([n%a<1for a in range(2,n)])+"prime",s[::2]+s[1::2]][1/2>0])

Identifies prime numbers with Python 2, get's you into trouble with Python 3.

Bonus

__help__ = """In the forloop I'm setting the values i to n.
To be a "notPrimes", it's n % i == 0 if: 1 < i, i < n. (We
do tests i<1/2 i==1, too). Then, prints resulting, prime text.
In case i==n: quit. Just if it aborts: try."""

# read integer from command line
n=int(input())

try:

    # primes = True
    notPrimes = False

    # try each i to n
    for i in range(n):

        # ignore 0 or 1
        if i < 1 / 2 or i == 1:
            continue

        # test divisibility
        if n % i == 0:
            notPrimes = True

    # print result
    if notPrimes:
        print("not prime")
    else:
        print("prime")

except:

    # if program aborts: print help and error code
    print(__help__ [::7])

Try it with Python 2 or Python 3! (In contrast to the golf version above the roles changed: Python 3 is the prime number identifier. Python 2 contains the Easter egg.)

Please, excuse my bad English in the help text! ;)

And I do use the word "quit". But somehow I need to describe when my program terminates. ;)


JavaScript (ES6), 121 bytes
f=(s,j=2,o,m=s.match(`(.{${j}})(.*\\1){${(j-1)}}`))=>m?f(s,j+1,s.split(m[1]).map((e,i)=>e+(m[1][i]||'')).join``):o?f(o):s

Recursively matches the pattern:
(.{2})(.*\1){1}  //2 characters, repeated 1 time
(.{3})(.*\1){2}  //3 characters, repeated 2 times
(.{4})(.*\1){3}  //4 characters, repeated 3 times
etc.

… until the pattern isn't found.  (This guarantees that the longest string is handled first.)
It then performs the "communistic transformations" on the last-found pattern, by splitting on the match, and joining on each of the match's characters.  (map is used for this purpose.  Too bad join doesn't take a callback.)
It finally recurses on this new string until it is no longer communistic.
Test cases:

f=(s,j=2,o,m=s.match(`(.{${j}})(.*\\1){${(j-1)}}`))=>m?f(s,j+1,s.split(m[1]).map((e,i)=>e+(m[1][i]||'')).join``):o?f(o):s

console.log(f('123'));  //123
console.log(f('111'));  //111
console.log(f('1111')); //11
console.log(f('ABAB')); //AB
console.log(f('111111111')); //111
console.log(f('asdasdasd')); //asd
console.log(f('10/10')); //1/0
console.log(f('100/100+100')); //1/0+0
console.log(f('   +   +   ')); // +
console.log(f('Hello, hello, dear fellow!')); //Heo hl, dear flow!
console.log(f('11122333/11122333/11122333')); //132/23


Python 2, 338 326 323 321 310 306 297 293 290 289 280 279 266 264 259 237 230 229 226 223 222 220 219 217 (260 238 231 228 225 223 221 220 218 with 0 exit status)

exec'''s=raw_input()
S=[M-s.rfind(c,0,M)for M,c in enumerate(s)]
k=0
j=x=%s
while k<=M+x:
 if S[k]>j<W[j]or S[k]==W[j]:
    k+=1;j+=1;T+=[j]
    if j-L>x:print s[k-j:k];z
 else:j=T[j]
'''*2%('-1;T=[0];W=S;L=M',0)
print'No!'

The algorithm is a variation of KMP, using an index-based test for character matching. The basic idea is that if we get a mismatch at position X[i] then we can fall back to the next possible place for a match according to the longest suffix of X[:i] that is isomorphic to a prefix of X.

Working from left to right, we assign each character an index equal to the distance to the most recent previous occurrence of that character, or if there is no previous occurrence then we take the length of the current string prefix. For example:

MISSISSIPPI
12313213913

To test whether two characters match, we compare indices, adjusting appropriately for indices that are greater than the length of the current (sub)string.

The KMP algorithm becomes a little simplified since we cannot get a mismatch on the first character.

This program outputs the first match if one exists. I use a runtime error to exit in the event of a match, but the code can be easily modified to exit cleanly at the cost of some bytes.

Note: For computing indices, we can use str.rfind (as opposed to my earlier approach using a dictionary) and still have linear complexity, assuming that str.rfind starts searching from the end (which seems the only sane implementation choice) -- for each character in the alphabet, we never have to traverse the same part of the string twice, so there is an upper bound of (size of alphabet) * (size of string) comparisons.

Since the code got fairly obfuscated in the course of golfing, here is an earlier (293 byte) solution that's a bit easier to read:

e=lambda a:a>i<W[i]or a==W[i]
exec('s=raw_input();S=[];p={};M=i=0\nfor c in s:S+=[M-p.get(c,-1)];p[c]=M;M+=1\nW=S;L=M;'*2)[:-9]
T=[0]*L
k=1
while~k+L:
 if e(W[k]):i+=1;k+=1;T[k]=i
 else:i=T[i]
m=i=0
while m+i<M:
 if e(S[m+i]):
    if~-L==i:print s[m:m+L];z
    i+=1
 else:m+=i-T[i];i=T[i]
print'No!'

The e function tests equivalence of characters. The exec statement assigns indices and does some variable initialisations. The first loop processes X for fall back values, and the second loop does the string search.

Update: Here is a version that exits cleanly, at the cost of one byte:

r='No!'
exec'''s=raw_input()
S=[M-s.rfind(c,0,M)for M,c in enumerate(s)]
k=0
j=x=%s
while k<=M+x:
 if S[k]>j<W[j]or S[k]==W[j]:
    k+=1;j+=1;T+=[j]
    if j-L>x:r=k=s[k-j:k]
 else:j=T[j]
'''*2%('-1;T=[0];W=S;L=M',0)
print r


J, 1 byte

Courtesy of ngn

{

Try it online!

'tis called Catalogue…


Python 3, 155, 126, 124, 123, 120 116, 113 bytes

Yes! First python answer!
Saved 21 bytes due to a suggestion by Dominic van Essen to remove the for loop!
Saved 8 bytes because I realized I could use t*=True/False instead of t+=[True/False].
Saved another 2 bytes right after I finished editing because I realized t could simply be set to the same value as i and l!
Saved 1 byte based off Danis's python 2 comment.
Saved another 3 bytes based off Tipping Octopus's comment.
Saved another 4 bytes due to Tipping Octopus again!
Saved another 3 bytes thanks to Dominic's suggestion to remove the t variable.
New Answer
x=input()
n=int(x)
i=l=2
while~-n:
 if n%i:i+=1
 else:n//=i;l+=1;j=iter(x);l*=2*all(c in j for c in str(i))
print(l>4)

How it works
The while loop computes the prime factors of the input. If a prime factor is found, it checks if it is a subsequence of the input. l is multiplied by whether or not this is True. This takes advantage of the fact that python's True and False values act like 1s and 0s when you multiply by them. This means that instead of appending True/False to t and checking whether all(t) is True like in my old answer, I can just multiply l by 2*True/False and check its value in the print statement. The print statement prints True if l>4.
Try it online!
Old Answer
x=n=int(input())
l=[]
i=2
while i<=n:
 if n%i:i+=1
 else:n/=i;l+=[i]
t=[]
for p in l:i=iter(str(x));t+=[all(c in i for c in str(p))]
print(all(t)*len(l)>1)

Try it online!


JavaScript (ES7),  182  181 bytes

f=(n,[x,y]=[2,1],a=[...Array(4e3)].map((_,n)=>[1,-1].map(s=>(i&1?-s:s)*(i+s*n-(n>0?n:-n)>>1),i=n**.5|0,n-=i*++i)))=>n--?f(n,a.find(([X,Y],j)=>(i=j,(x-X)*(y-Y))**2==4),a,a[i]=[]):i+1

Try it online!

How?

A slightly modified version of my answer to the The Path Of The Wildebeest is definitely shorter (and faster) than that. But I wanted to try a different approach. Incidentally, I think it might be easier to implement this method in some esolangs.

Algorithm:

Initialization: we build the full list of coordinates for the first 4000 squares of the spiral, which is enough to process all moves of the knight before it gets trapped (the highest reached square being \$3199\$).
We look for the first square \$(X,Y)\$ such that:

$$((x-X)\times(y-Y))^2=4$$

where \$(x,y)\$ are the current coordinates of the knight.

The above condition is true only if \$|x-X|=1\$ and \$|y-Y|=2\$, or \$|x-X|=2\$ and \$|y-Y|=1\$, which covers all possible knight moves.
We set \$(x,y)=(X,Y)\$ and invalidate the entry in the list so that it's not picked a second time.
We either restart at step 2 or return the last index that was found if we're done.

Node.js, 155 bytes

n=>(g=(x,y)=>n--?g(Buffer('QHUbcdWJ').map(m=c=>g[i=4*((x+=c%6-2)*x>(y+=c%7-2)*y?x:y)**2,i-=(x>y||-1)*(i**.5+x+y)]|i>m||(H=x,V=y,m=i))|H,V,g[m]=1):m+1)(1,2)

Try it online!


Shortest script that gives the time passed since a Unix timestamp

J , 165

;' '&,@":&.>@((#~([:*&>{."1))@((;:' decades years weeks days hours minutes seconds')(],.([}.~[:-1=])&.>)<"0@(_ 10 52 7 24 60 60&#:)@(-~([:".@}:[:2!:0'date +%s'"_))))

Can probably be golfed more. Uses a shell call to date for getting the current unix epoch time, since Unix epoch is unavailable in J.

Example run:

;' '&,@":&.>@((#~([:*&>{."1))@((;:' decades years weeks days hours minutes seconds')(],.([}.~[:-1=])&.>)<"0@(_ 10 52 7 24 60 60&#:)@(-~([:".@}:[:2!:0'date +%s'"_)))) 0
4 decades 4 years 41 weeks 3 days 12 hours 54 minutes 1 second


APL (Dyalog Extended), 33 32 bytes

-1 byte thanks to Bubbler.

Anonymous infix lambda. Takes count as left argument and string as right argument.

{('\b',⊃¨⍵⊆⍨≠⍵)⎕R(1⌽')(',⍵)⍣⍺⊢⍵}

Try it online!

{…} "dfn"; number is ⍺ and text is ⍵:

 ⊢⍵ on the text:

 ⍣⍺ repeat given number of times

 (…)⎕R(…) PCRE Replace:

  ')(',⍵ the text prefixed by ")("

  1⌽ cyclically rotated one step left (puts ")" at end)

  … with:

  ≠⍵ The mask of non-spaces in the text

  ⍵⊆⍨ characters runs in the text corresponding to runs of 1s in that

  ⊃¨ first character of each

 '\b', prepend PCRE for word boundary


Recreate a simplified version of the card game L.L.A.M.A

Python 3.8 (pre-release), 401 \$\cdots\$ 347 345 bytes

from random import*
d=[*range(7)]*8
shuffle(d)
p=[[d.pop()for i in[1]*6]for j in[1]*4]
o=[*range(1,7)]+['l']
h=[]
s=d.pop()
def g(a):p[n].remove(a);h.append(s);print(f"{n+1}-{o[a]}")
n=3
while all(p):
 n=-~n%4
 if s in p[n]:g(s)
 elif(t:=-~s%7)in p[n]:g(t);s=t
 else:
  if not d:d=h;h=[];shuffle(d)
  p[n]+=[d.pop()];print(f"{n+1}-d")
print(n+1)

Try it online!

Prints player-card for each move.
player is 1 to 4.
card is 1 to 6 or l for llama or d for draw.
Simply prints winner's number at the end.


APL (Dyalog), 34 bytes

Anonymous prefix function expecting integer in range 0–100. Assumes ⎕IO (Index Origin) to be 0, which is default on many systems.

{'#-|'[⊖⍉⍣s⊢10 10⍴100↑⍵⍴1+s←50≥⍵]}

Try it online!

{…} lambda; ⍵ is argument:

 '#-|[…] index the string with the following array:

 50≥⍵ 1 if 50 is greater than or equal to argument, else 0

 s← store in s (for small)

 1+ increment

 ⍵⍴ cyclically reshape to argument-length

 100↑ take the first hundred of that, padding with zeros

 10 10⍴ reshape to ten rows and ten columns

 ⊢ yield that (separates s from 10 10)

 ⍉⍣s transpose if small

 ⊖ flip upside-down


Build an adding machine using NAND logic gates

31 gates

[created in Logisim]

The standard XOR-gate can be built with four NANDs. Tapping the first NAND provides us with a fairly compact half-adder with inverted carry:
hadder(A,B) => (sum, iCarry):

X = A^B

sum = (A^X)^(B^X)
iCarry = X

These can be combined into a 9-gate full adder:
fadder(A,B,C) => (sum, carry):

DD1 = hadder(A,B)
DD2 = hadder(DD1.sum, C)

sum = DD2.sum
carry = DD1.iCarry ^ DD2.iCarry

These combined yield a naive 36-gate four-bit adder. Not bad.
Now, we inline all modules and perform these optimizations:
delete gates with no output (only the final gate)
0^x => 1                    (one gate, twice)
1^(1^x) => 0                (two gates, once)

for a grand total of 31 gates.

Note that the count of splits and NAND-gates are intimately connected: Each 2-input NAND (larger are explicitly forbidden) takes two inputs and produces one output. Each 2-way split (let's assume larger splits are forbidden) takes one input and produces two outputs. Also, there are no unused outputs or floating inputs (let's assume constants are not allowed). If there are N more inputs than outputs, there must be N more NANDs than splits.
Thus, a 31-NAND 8=>4 module will neccessarily have 27 2-way splits.
Here are the split cardinalities for the above adder just in case larger splits are allowed:
18x wire (no split)
  4x output
  14x XOR 2nd stage
16x 2-way split
  8x input
  6x H2 input
  2x last bit XOR 1st stage
4x  3-way split
  4x XOR 1st stage
1x  4-way split
  1x 1st bit XOR 1st stage; if constants are alloweed; this is a three-way split


Ruby, 107

I expected this would be a much shorter program.

gets
loop{a,b,k=gets.split.map &:to_i
puts"Case ##{$.-1}: #{[*0...a].product([*0...b]).count{|x,y|x&y<k}}"}

Explanation

The first line of input can be ignored.
$. is the last read line number.
[*0...x] is a quick way to turn the Range into an Array. It uses the splat operator (*). Note that the Range is an exclusive one (... instead of ..).
Array#count takes a block. It will only count the elements for which the block returns a truthy value.


Python

A fractal Christmas tree using the turtle package:

n = input()*1.

from turtle import *
speed("fastest")
left(90)
forward(3*n)
color("orange", "yellow")
begin_fill()
left(126)
for i in range(5):
    forward(n/5)
    right(144)
    forward(n/5)
    left(72)
end_fill()
right(126)

color("dark green")
backward(n*4.8)
def tree(d, s):
    if d <= 0: return
    forward(s)
    tree(d-1, s*.8)
    right(120)
    tree(d-3, s*.5)
    right(120)
    tree(d-3, s*.5)
    right(120)
    backward(s)
tree(15, n)
backward(n/2)

import time
time.sleep(60)

n is the size parameter, the shown tree is for n=50.  Takes a minute or two to draw.


MATLAB
Try it online
function tf=Intercept(p,a)
X=@(t,a,v,x).5*a*t.^2+v.*t+x;
t=0;
while 1

    a1=(0:0.01:1)';
    a2=1-a1;
    theta2=-360:360;

    x1=X(t,a(1),0,p(1));
    y1=X(t,a(2),0,p(2));
    theta1=atan(y1/x1)*180/pi;
    T=(t-abs(theta1)/180-abs(theta2-theta1)./180);
    T(T<0)=0;
    x2=0.5*a1.^2*cosd(theta1).*T.^2+0.5*a2.^2*cosd(theta2).*T.^2+a1.*a2*cosd(theta1).*T.^2+a1.*cosd(theta1)*T.*abs(theta2-theta1)/180;
    y2=0.5*a1.^2*sind(theta1).*T.^2+0.5*a2.^2*sind(theta2).*T.^2+a1.*a2*sind(theta1).*T.^2+a1.*sind(theta1)*T.*abs(theta2-theta1)/180;
    x=x1-x2;
    y=y1-y2;
    vx=a(1)*t-(a1*cosd(theta1)*T+a2*cosd(theta2).*T);
    vy=a(2)*t-(a1*sind(theta1)*T+a2*sind(theta2).*T);
    V=sqrt(vx.^2+vy.^2);
    D=sqrt(x.^2+y.^2);

    [ida1,idtheta2]=find(D<1&V<1,1);

    if ~isempty(idtheta2)
        a1=a1(ida1);
        theta2=theta2(idtheta2);
        break
    end

    t=t+0.01;

end
if length(theta2) > 1
    return
end
tf=t;
t1=abs(theta1/180);
t3=abs(theta2-theta1)/180;
t3=t3-0*(t3>1);
t2=a1.*(tf-t1-t3);
t4=tf-t3-t2-t1;
x1=a(1)/2*tf^2+p(1);
y1=a(2)/2*tf^2+p(2);
v1=a*tf;
x2=cosd(theta1)/2.*t2.^2+cosd(theta1).*t2.*(t3+t4)+cosd(theta2)./2.*t4.^2;
y2=sind(theta1)/2.*t2.^2+sind(theta1).*t2.*(t3+t4)+sind(theta2)./2.*t4.^2;
v2=[cosd(theta1)*t2+cosd(theta2)*t4;sind(theta1)*t2+sind(theta2)*t4];
V=vecnorm(v1'-v2);
P=vecnorm([x1;y1]-[x2;y2]);
cmds=[theta1,t1,t2,theta2-theta1,t3,t4,tf];
fprintf('Turn %.2f degrees in %.2f seconds\nAccelerate for %.2f seconds\nTurn %.2f degrees in %.2f seconds\nAccelerate for %.2f seconds\nMission Time: %.2f seconds\n\n',cmds);
fprintf('x1=%.2f, x2=%.2f\ny1=%.2f, y2=%.2f\nv1=[%.2f %.2f], v2=[%.2f %.2f]\nV=%.2f\nD=%.2f\n',x1,x2,y1,y2,v1,v2,V,P);

Explanation:
My methodology is to start by assuming the total mission length \$t\$ starting from 0 (in the case where we already fit the parameters at \$t\$=0) and apply a standard mission profile. The mission has 4 stages:

turn towards where the target will be at time \$t\$
accelerate towards the target
turn to an angle that will cancel velocities so that we are within parameters by time \$t\$
accelerate for the remaining time

Using this profile, there are 4 time values to be concerned about. \$t_1\$ is the first turn, \$t_2\$ is the first burn, \$t_3\$ is the second turn, and \$t_4\$ is the last burn. \$t_1\$ is known since the initial angle can be easily calculated. \$t_2\$ and \$t_4\$ are calculated as percentages \$a_1\$ and \$a_2\$ of \$(t_2+t_4)\$, in order to reduce them to \$a_1(t_2+t_4)\$ and \$(1-a_1)(t_2+t_4)\$, thus making both values a function of \$a_1\$. \$t_3\$ is a function of the second turn angle \$\theta_2\$. The next thing is to calculate the x and y positions and velocities at time \$t\$ as a function of \$a_1\$ and the second angle \$\theta_2\$, the only other unknown. I know that these are limited to a specific range of 0:1 and -360:360  respectively, so I calculate all possible positions as a function of \$a_1\$ and \$\theta_2\$ and find the first one that fits the criteria. If none fit, then \$t\$ is increased by 0.01 and the process is repeated. This method takes advantage of the vectorized computing capabilities of MATLAB. And honestly, it's probably the first code golf challenge where MATLAB is more ideal.
I also have some test code that has all of the test cases already, and times it as well according to your scoring criteria. Since the output of the program is the total mission time, and tic/toc calculates time since tic was called at time toc, this calculates the score as well.
% % Test Intercept*
*edited so that toc comes after the function call, so that time is calculated after the function finishes and not before. Oversight on my part.
tic
(Intercept([10,0], [0,0])*toc)^2;

tic
(Intercept([6,-3], [0,0.5])*toc)^2

tic
(Intercept([-2,8], [0.1,-0.2])*toc)^2

tic
(Intercept([5,5], [0.3,0.3])*toc)^2

tic
(Intercept([15,18], [0.1, 0.3])*toc)^2

tic
(Intercept([20,5], [0.2,-0.2])*toc)^2


Test if a given number is a Vampire Number

Python - 188 chars

Doesn't do Pseudovampire numbers
from itertools import*
n=input()
a=[]
for i in map("".join,permutations(`n`)):x,y=int(i[::2]),int(i[::-2]);a+=[(x,y)]*(x*y==n)
print n,a and"=%s*%s"%min(a)or"is not a Vampire Number"


Haskell, 169 148 bytes

init.tail.fst.([]%)
p:k="(,"
l%('(':r)|(y,x:s)<-[]%r,m<-y:l=last$m%(p:s):[(p:p:(l>>k)++x:foldl(\r x->x++[' '|x>k,r>k]++r)[x]m,s)|x<',']
l%r=lex r!!0

Try it online! Takes the tuple as a string. init.tail.fst.([]%) is the anonymous main function. Bind it to e.g. f and use like f "(3,(14,1),4,7)", which yields "(,,,)3((,)14 1)4 7".

Why is the input not provided as a Haskell tuple, you ask? Because Haskell is strongly typed, a tuple (1,2) has type (Int,Int)1 and a tuple (1,(2,3)) has type (Int,(Int,Int)). Thus a function which accepts the first kind of tuple can not be applied to the second kind, and especially there can be no function which takes an arbitrary tuple2.

Explanation:

p:k="(," is a short way to assign p to '(' and k to ",".
(%) is the recursive parsing and converting function. The first argument is a list of already parsed tuple entries, the second argument is the remainder of the original string. Each call returns a tuple of the current converted tuple (as a string and enclosed in brackets) and the remainder of the string.

l%('(':r) If the string starts with an opening bracket, we need to parse a new tuple entry.
(y,x:s)<-[]%r We recursively apply % and get a tuple entry y and the remaining string splitted into the next character x and the rest of the string s.
m<-y:l We add the new entry y to the current list of already found entries l and call the result m.
The next character x is now either a comma , or a closing bracket ). The last$ <B> :[ <A> |x<','] is just a shorter way of writing if x == ')' then <A> else <B>.
So if a , is next, we need to recursively parse the next entry: m%(p:s) We prepend an opening bracket in order to end up in the right case and pass the list of already found entries m.
If otherwise x == ')', we finished the current tuple and need to do the required transformation: (p:p:(l>>k)++x:foldl(\r x->x++[' '|x>k,r>k]++r)[x]m,s)

p:p:(l>>k)++x: If we have found n entries, then m has n elements and y, the list before adding the most recently found element, has n-1 entries. This comes in handy as we need n-1 , for an n element tuple and l>>k works on lists as "concatenate the list k with itself as many times as y has elements". Thus this first part yields some string like "((,,,)".
foldl(\r x->x++[' '|x>k,r>k]++r)[x]m concatenates the elements of m (in reverse order, because by adding new entries to the front m itself was constructed in reverse order) while adding only spaces in between two elements if they are both numbers: [' '|x>k,r>k] we check if the current entries x and r are numbers by lexicographically comparing them to "," - if they are not numbers, they are already a tuple representation enclosed in brackets, and '(' < ',' holds.

If the pattern match l%('(':r) right at the beginning fails, then we end up on the last line: l%r=lex r!!0. This means we need to parse a number and return the number and the remainder of the string. Luckily there is the lex function which does exactly that (It parses the next valid Haskell token, not just numbers). However the resulting tuple is wrapped into a list, so we use !!0 to get the first element of the list.

init.tail.fst.([]%) is the main function which takes a string and applies % with an empty list to it. E.g. for an input "(1,2)", , applying ([]%) yields ("((,)1 2)",""), so the outer tuple and brackets need to be removed. fst gets the first element of the tuple, tail removes the closing bracket and init the opening one.

Edit: Many thanks to @Ørjan Johansen for golfing a total of 21 bytes!

1 Actually, the type is (Num t1, Num t) => (t, t1), but that's a diferent story.

2 Ignoring polymorphic functions like id, which cannot actually work with their input.


Bacon's cipher: An Intro to Steganography

Python 3, 216 211 231 225 207 bytes

This is a solution that uses normal text and Markdown-style italics for its two typefaces. And it encodes everything in the carrier message except the spaces.
Edit: Had to fix the code so that the result would print correctly and added examples below the code.
Edit: Edited the code to previously worse uppercase/lowercase solution, due to problems in printing the italics correctly.
def g(s,c):
 c=c.lower();w=[h.upper()for h in s if h.isalpha()];t=''.join("{:05b}".format(ord(i)-65)for i in w);r='';j=m=0
 while t[j:]:a=c[m];x=a!=" ";r+=[a,a.upper()][x*int(t[j])];j+=x;m+=1
 return r+c[m:]

Examples
>>> g('HELLOWORLD', 'The quick brown fox jumps over the lazy dogs, gamboling in the fields
where the shepherds keep watch')
'thE QUicK broWn FOx JuMPs OVEr ThE LazY DOgS, gaMbOlINg in THe fields where the shepherds keep watch'

Ungolfed:
def bacon(message, carrier):
    # Lowers the case of the carrier message
    carrier = carrier.lower()
    # Removing all non-alphabetic characters and making the rest uppercase
    words = ""
    for char in message:
        if char.isalpha():
            words += char.upper()
    # Encoding the message
    binary = ""
    for letter in words:
        encode = ord(letter) - 65
        binary += "{:05b}".format(encode)
    # Encoding the carrier message
    result = ""
    bin_index = 0
    char_index = 0
    while bin_index < len(binary):
        letter = carrier[char_index]
        # If letter isn't a space and it needs to be encoded
        if letter != " " and int(binary[bin_index]):
            letter = letter.upper()
        result += type + letter + type
        # The encoding only proceeds if letter wasn't a space
        bin_index += letter != " "
        # char_index increments whether or not letter was alphabetical
        char_index += 1
    # Return the encoded text and any leftover characters from the carrier message
    return result + carrier[char_index : ]


Drive a hexadecimal 7-segment display using NAND logic gates

Dominoes - Total Score: 243 NANDs

ORs used: 61 (3 NANDs each -> 183 NANDs)
NOTs used: 60 (1 NANDs each -> 60 NANDs)

This solution is in dominoes and required a collection of pieces of software I wrote in the course of answering Martin Büttner's two Domino related questions to produce (Golfing for Domino Day and Domino Circuits).

By modifying my Domino Circuit solver, I was able to produce a domino circuit (this file also contains the solver output and circuit skeleton) consisting of ORs, and IFNOTs where the first input is always TRUE (so it's essentially a NOT). Because there isn't much that will fit in this answer, I present the OR and NOT solutions to the truth table:

A: 1011011111101011
((-1 ifnot (2 or (1 or (-1 ifnot 0)))) or ((-1 ifnot ((-1 ifnot 1) or (-1 ifnot 2))) or ((-1 ifnot (3 or (-1 ifnot (0 or (-1 ifnot 1))))) or (-1 ifnot (0 or ((-1 ifnot 3) or (-1 ifnot (2 or 1))))))))
B: 1111100111100100
((-1 ifnot (3 or 1)) or ((-1 ifnot (3 or (2 or 0))) or (-1 ifnot ((-1 ifnot 3) or ((-1 ifnot (2 or (0 or (-1 ifnot 1)))) or (-1 ifnot ((-1 ifnot 0) or (-1 ifnot 2))))))))
C: 1101111111110100
((-1 ifnot (2 or (-1 ifnot 3))) or ((-1 ifnot (1 or (-1 ifnot 0))) or (-1 ifnot (0 or (-1 ifnot (3 or (1 or (-1 ifnot 2))))))))
D: 1011011011011110
((-1 ifnot (3 or (1 or 0))) or ((-1 ifnot (2 or ((-1 ifnot (3 or 0)) or (-1 ifnot (1 or 0))))) or (-1 ifnot ((-1 ifnot 2) or ((-1 ifnot (3 or 1)) or (-1 ifnot ((-1 ifnot 1) or (-1 ifnot 3))))))))
E: 1010001010111111
((-1 ifnot (3 or (-1 ifnot (2 or (-1 ifnot 1))))) or (-1 ifnot ((-1 ifnot 0) or (-1 ifnot (2 or 1)))))
F: 1000111011111011
((-1 ifnot (3 or (-1 ifnot 1))) or ((-1 ifnot (2 or (0 or (-1 ifnot (1 or (-1 ifnot 3)))))) or (-1 ifnot ((-1 ifnot 0) or (-1 ifnot (2 or (-1 ifnot 1)))))))
G: 0011111011110111
((-1 ifnot (2 or (0 or (-1 ifnot 1)))) or ((-1 ifnot (1 or (-1 ifnot (2 or 0)))) or (-1 ifnot ((-1 ifnot (3 or 2)) or (-1 ifnot (0 or (-1 ifnot 3)))))))

Note that the only binary operations used are OR and IFNOT, where I count each IFNOT as a NOT for scoring purposes

I added a 7-segment display to the end of the circuit and fed it into a domino simulator/gif generator. The resulting gif (which shows 'A' being displayed) took about 2 hours to generate. Because the final circuit is 1141 * 517 in size each "cell" is represented by a single pixel. A black cell is empty, a grey cell has a standing domino in it, and a white cell has a fallen domino in it. This means that you can't really tell what is going on, and it won't help if it's being squashed at all. Sparr kindly provided a much smaller version of my original gif (650kB), so here it is!

Below is the last frame of the animation for input 1010 ('A') as above. You can see the inputs on the far left, powerline at the top, the switchboard taking up most of the space, the 7 individual pieces of logic (these are domino representations of the functions above) to the left of the switch board, and to the far right is the 7-segment display itself. When this runs, the individual segments light up roughly at the same time, so you can't be looking at it for too long with some segments lit up waiting for others to light up.

See the animation in it's full glory here (36MB) or here (650kB, courtesy of Sparr) (the smaller copy is much smaller, but my browser seemed to like skipping frames marring the beauty so I've left the original thusly)

The detail of the 7-segment display can be seen here ('1' is shown)


J, 9 5 bytes

$":&1

Uses spaces and 1's and expects input in the form H W f N

Explanation:

$":&1
   &1 bonds the fixed right argument 1 to ":
 ":   formats the right argument number (1) to take up left argument (N) number of cells
      padding with spaces, resulting  in "  1"
$     reshape to H-by-W with repeating the string if necessary

Usage:

   3 7 ($":&1) 3
  1  1
 1  1
1  1  1

Try it online here.


Pyth, 17 bytes

+hS%R180,Q_Q" deg

Coincidentally, this is equivalent to @xnor's answer.

Try it online.


Pip 0.15.05.29, over 10100,000
(Subtracting the 51 bytes of source code is negligible for such a large number.)
This is a version of my answer to Make a slow error quine maker.  Requires the -w flag for warning output.
i:5**6**7d:"i:1d: Ssi?dRo--iRsRPdx"Ssi?dRo--iRsRPdx

The exact number of steps depends only on the value assigned to i, so it could be arbitrarily large (until the Python interpreter runs out of memory). Also, it would take longer than the age of the universe to complete the above sequence.
Explanation:
Example here uses an i-value of 5 for purposes of explanation.
i:5d:"i:1d: Ssi?dRo--iRsRPdx"Ssi?dRo--iRsRPdx

After setting i, store a string in d and then attempt to execute the Swap statement. Swap expects two variables (more accurately, lvalues). s is fine, but the second expression is i?dRo--iRsRPdx. If i is true (nonzero, for our purposes), the ternary evaluates to dRo--iRsRPd, which uses d from earlier to form a near-quine--only with i decremented. This expression is not an lvalue, so Pip complains:
Attempting to swap non-lvalue i:4d:"i:1d: Ssi?dRo--iRsRPdx"Ssi?dRo--iRsRPdx

... which then starts the whole thing over again. (Attempting to swap non-lvalue is a bunch of no-ops: At calculates the ASCII value of t = 10, n-l subtracts newline minus each value of an empty list, and all the lowercase letters are just variables.)
The process continues in like fashion all the way down to:
Attempting to swap non-lvalue i:0d:"i:1d: Ssi?dRo--iRsRPdx"Ssi?dRo--iRsRPdx

When this is run, i is now false. The ternary expression evaluates to the else branch x--which is an lvalue. Thus, swap simply swaps the values of s and x. The program then exits with no output.
(The only thing that's changed from the previous answer is using x, which is a predefined variable, instead of a, which is undefined if there were no command-line arguments and thus triggers a different error when i gets down to zero.)


JavaScript (Node.js),  160  159 bytes
I/O format: matrix of 24-bit integers.
Takes input as (a)(b).

a=>F=b=>(g=a=>[...new Set(a.flat())].sort(_=>Math.random()-.5))(a).every((c,i)=>c^=F[c]=B[i%B.length],B=g(b).slice(-g(a).length))?a.map(r=>r.map(c=>F[c])):F(b)

Try it online!
Commented
Helper function
The helper function \$g\$ takes a matrix as input and returns a shuffled list of the distinct values it holds.
g = a =>
  [...new Set(a.flat())]
  .sort(_ => Math.random() - .5)

Main code
a => F = b =>                 // a[] = first image, b[] = second image
  g(a).every((c, i) =>        // for each color c at position i in the list of shuffled
                              // colors of the first image:
    c ^=                      //   make sure that c is different from the
      F[c] = B[i % B.length], //     substitute color F[c] picked from the second image
    B =                       //   define B[] as:
      g(b)                    //     the list of shuffled colors from the second image
      .slice(-g(a).length)    //     resized to the number of colors in the first image
  ) ?                         // end of every(); if truthy:
    a.map(r =>                //   return a[] with each original color
      r.map(c => F[c])        //   replaced with its substitute color
    )                         //
  :                           // else:
    F(b)                      //   try again


Lua, Score: 85.91 13.50 13.20 12.70 9.41 9.32 9.83 9.66 9.12 9.06 8.03 (Average)

-- Get input
local inp = io.read("*a")

local out = ""
local faces = { [5] = 45, [4] = 36, [3] = 27, [2] = 18, [1] = 9 }
local lastChar = nil

-- Mode the program is in
-- 2 = not set (needs :), 1 = just set (needs +), 0 = normal
local mode = 1;
for i = 1, inp:len() do
  -- Character value at current position
  local c = string.byte(inp, i)

  if c == lastChar then
    -- Repeat character
    out = out .. "6"
  elseif c % 9 == 0 and c <= 45 then
    if #out == 0 then
      out = out .. "@"
    end
    out = out .. (c / 9)
  else
    local c2 = c

    -- Handle if difference from lastChar is divisible by 9
    if lastChar and (c - lastChar) % 9 == 0 then
      local difference = c - lastChar
      if difference > 0 then
        out = out .. "+"
      else
        out = out .. "-"
        difference = difference * -1
      end

      for index = 5, 1, -1 do
        local face = faces[index]
        while difference >= face do
          difference = difference - face
          out = out .. index
        end
      end
      c = 0
    end

    -- Handle anything not divisible by 9
    local extra = c % 9
    if extra > 0 then
      -- Try to optimize by dividing by 9, if possible
      if lastChar and math.floor(lastChar / 9) == extra then
        out = out .. "/1"
        mode = 1
        extra = 0
      else
        while extra > 0 do
          local n = extra > 5 and 5 or extra

          if mode == 2 then
            out = out .. ":"
            mode = 1
          elseif mode == 1 then
            out = out .. "+"
            mode = 0
          end
          out = out .. n
          extra = extra - n
        end
        out = out .. "/1"
        mode = 1
      end

      c = c - (c % 9)
    end

    -- Handle anything divisible by 9
    for index = 5, 1, -1 do
      local face = faces[index]
      while c >= face do
        if mode == 2 then
          out = out .. ":"
          mode = 1
        elseif mode == 1 then
          out = out .. "+"
          mode = 0
        end
        c = c - face
        out = out .. index
      end
    end

    out = out .. "@6"
    lastChar = c2
  end

  mode = 2
end
print(out)

Try it online!

Okay, I don't think I can optimize this anymore.

This version iterates through each character, adding c % 9 (where c is the character's decimal value) by doing :5+2/1, then adds the parts divisible by 9 by adding that face's value. For example: :2/1+551@ to print "e", where :2/1 adds 2, +551 adds 99 (9 * (5 + 5 + 1), or 9 * 11), and @ prints the output. Input is read with io.read().

Optimizations include directly adding/subtracting after printing if the difference between characters is a multiple of 9, dividing the current value if possible rather than setting c % 9 from scratch, and repeating characters by printing the current value again rather than recalculating it. Additionally, I've implemented Kamil's method of instantly printing any face that already contains the target value, and MD XF's suggestion to not use : at the beginning, but instead just start with a +.


Fill in an increasing sequence with as many numbers as possible

Haskell, 41 bytes

f takes a list and returns a list, with 0 representing ?s.

f=scanr1 min.tail.scanl(#)0
m#0=m+1
_#n=n

Basically, first scan list from left, replacing 0s by one more than the previous element (or 0 at the start); then scan from right reducing too large elements to equal the one on their right.

Try it online! (with wrapper to convert ?s.)


Dyalog APL / SOGL, 70 65 63 62 bytes

0000000: 7b0d 04eb c0fd 5832 5c49 e32a 2e4c ac20  {.....X2\I.*.L.
0000010: 4d2a 5b3a 836b 6b7d 01ea 500d 9b31 a90f  M*[:.kk}..P..1..
0000020: 7b0f c285 c8c7 b932 c00e f8b1 c70f 7db0  {......2......}.
0000030: 32c2 8531 9c85 80b2 b50f aa32 f97d       2..1.......2.}

Interpreted in the classic Dyalog APL encoding: - life: (contains unprintables), expects ⎕IO←1

{' ^|⎕X2I┤z.L?pMzÅÏÏ}ûP'[1+⍵{⍵,⍨⌽⍉(2|⍺)↓⍉⍵}↑2,⍨1/⍨¨⍳⌈⍵÷2]}

TryAPL here!

{' ^|..'[1+⍵{⍵,⍨⌽⍉(2|⍺)↓⍉⍵}↑2,⍨1/⍨¨⍳⌈⍵÷2]}

         1+      add 1 to every value
 ' ^|..'[  ....] index the array getten below into " ^|.." with SOGLs code never being indexed in

⍵{..}↑2,⍨1/⍨¨⍳⌈⍵÷2

          1/⍨¨      replace each with that many 1s
              ⍳     the first ... numbers
               ⌈      ceiling of
                ⍵÷2     the right argument divided by 2
       2,⍨          append 2
      ↑             mix; convert to a 2D array, padding with zeroes
⍵{..}               execute that function with the arguments ⍵ - my right argument and the result of above

   {⍵,⍨⌽⍉(2|⍺)↓⍉⍵}  helper function
    ⍵,⍨             append the right arg to
               ⍉⍵     the right arg transposed
              ↓       without the first ... rows
         (2|⍺)          remainder of left arg ÷ 2
       ⌽⍉             transposed and reversed

Interpreted in SOGLs encoding - death:

{∑⁴╝υ”X2\I┐*.Lκ M*[:≥kk}¹╚P∑Β1Ι»{»φ√ωΩΡ2υ«⌠ΝΩ»}μ2φ√1β√↓νΟ»ι2⌡}

Try it Here!

Explanation:

{∑⁴╝υ”X                         push "{∑⁴╝υ" and pop it - noop
       2\                       push input divides by 2
         I┐*                    get that many + 1 vertical bars
            .Lκ                 push 10-input
                M*              get that many "M"s as a string
                  [    }        while ToS isn't falsy (here: isn't "")
                   :              duplicate the string
                    ≥             put the duplicate at the stacks bottom
                     kk           remove the last 2 letters (does nothing when the string is empty)
                        ¹       wrap everything in an array
                         ╚      center horizontally
                          P     print that
                           ...  execute a bunch of random nonsense which luckily does nothing

This took way too long.. Golfing tips for the APL part are welcome, everything mostly should be applicable as long as it doesn't change anything before ûP'

You can load the file (after reversing xxd) in SOGL by selecting the file in the Browse... dialog and then clicking load SOGL codepage encoded file.


JavaScript (ES6), 70 68 63 bytes

g=n=>n?g(n-1).concat(/0/.test(n.toString(2).split`00`)?[]:n):[]

console.log(g(1000).join(", "))

Slightly more interesting recursive solution:

n=>[...Array(n+1).keys()].filter(f=n=>n<2?n:n%4?n&f(n>>1):f(n/4))

67 bytes thanks to @Neil.

g is the function to call.


MATL, 76 75 bytes
FFF!3Xyj"FFT_FTFv4BvtFT_YStTF_YS3:"3$y!]6$Xh@'ULlDRr'4#mt?X)Y*}xxt1Z)b+w]]x

This works in current version (12.1.1) of the language.
Edit (April 4, 2016): The behaviour of function v has changed in release 15.0.0 of the language. To make the above code run, remove the first v and replace the second 3$v. The following link includes this modification.
Try it online!
Explanation
The state of the ship can be described in terms of two variables:

position: 3x1 vector
orientation: 3x3 matrix with the accumulated rotation, where "accumulated" means repeated matrix product.

A third variable would be the direction in which the ship is facing, but that's not needed, because it can be obtained as the initial direction (column vector [1;0;0]) times the current orientation; that is, the first column of the orientation.
These two state variables are kept on the stack, and are updated with each letter. Each of the letters ULlDRr multiplies the orientation matrix by one of the six rotation matrices to update the orientation. Letter F adds the current position plus the first column of the orientation matrix.
The six rotation matrices are created as follows: first is introduced directly; second and third are circular shifts of the previous one; and the remaining three are transposed versions of the others.
FFF!             % 3x1 vector [0;0;0]: initial position
3Xy              % 3x3 identity matrix: initial orientation
j                % input string
"                % for-each character in that string
  FFT_FTFv4Bv    %   rotation matrix for U: defined directly
  tFT_YS         %   rotation matrix for L: U circularly shifted to the left
  tTF_YS         %   rotation matrix for l: L circularly shifted down
  3:"            %   repeat three times
    3$y!         %     copy third matrix from top and transpose
  ]              %   end loop. This creates rotation matrices for D, R, r
  6$Xh           %   pack the 6 matrices in a cell array
  @              %   push current character from the input string
  'ULlDRr'4#m    %   this gives an index 0 for F, 1 for U, 2 for L, ..., 6 for r
  t?             %   if non-zero: update orientation
    X)           %     pick corresponding rotation matrix
    Y*           %     matrix product
  }              %   else: update position
    xx           %     delete twice (index and rotation matrix are not used here)
    t1Z)         %     duplicate orientation matrix and take its first column
    b+           %     move position vector to top and add
    w            %     swap the two top-most elements in stack
  ]              %   end if
]                % end for-each
x                % delete orientation matrix
                 % implicitly display position vector


Brachylog, 245 bytes /2 = 122.5

@n:1a:"-"x:7fF:3a$\:3a@3:4a,Fc~bCh[0:0:0]gO,Co~c[V:O:T]h:F:6f:10ao:ba(h:11a;!);"!!"w!
h"-".|:"|"x:2f.
e(~m["0123456789":.]`;0<.<=9)
:ha#d.
:@3az:ca:5a.
:3a.
hs.:=a,?t:9ac:=fl1
:Im:8f:[[I]]z:ca.
:Jm:J.
:ha.
lg:?c.
b:+a[X:Y],?h:Y:Xr:"(~d,~d):~d
"w

(Note that you have to use the version of the language as of this commit. This code would need some slight changes for it to work properly in the following versions of Brachylog)

This prints "!!" if the given board has internal contradictions (This takes a few seconds in that case however on TIO, so be patient).

I'm not sure I understand the first bonus correctly so I'm not addressing it.

This is obviously non-competing since the language is much more recent than the challenge, however since there are no other answers I'm not sure this matters a whole lot…

Explanation

Main predicate:

@n                Split the input on line breaks
:1a:"-"x          Transform into a list of lists, each sublist contains a line's values
:7fF              Transform so that cells are [Value:X:Y]
:3a               All values on lines must be different
$\:3a             All values on columns must be different (by transposition)
@3:4a,            All 3*3 block values must be different
Fc~bCh[0:0:0]gO,  Append a fake cell [0:0:0]
Co~c[V:O:T]       Sort the board, the blank cells V will be those before O ([0:0:0])
h:F:6f            Find all subsets of blank cells with specific values for which
                      the board has only one solution
:10ao             Sort the subsets by lengths
:ba               Discard the lengths
(
  h:11a             Print the first subset = an answer
;                 Or (board is already fully determined)
  !                 Terminate
)
;                 Or (Some values don't respect the constraints)
"!!"w!            Print "!!" and terminate

Predicate 1: Remove all "|" on lines, transform the ---+---+--- into - to remove them after

h"-".    If the first char is "-", then Output is "-"
|        Or
:"|"x    Remove all occurences of "|" from the input
:2f.     Output is the result of all outputs of predicate 2 on the filtered string

Predicate 2: Convert one char to an integer, or if blank to a variable between 1 and 9.

e                      Take a char of the input string
(
  ~m["0123456789":.]     Output is the index of the char in "0123456789"
  `                      Discard the choice point caused by the ;
;                      Or
  0<.<=9                 Output is an integer between 1 and 9
)

Predicate 3: Impose that all values of the input list of cells must be distinct

:ha    Retrieve the head of each cell (i.e. the value) in the input
#d.    Apply a constraint of distinctness to those values

Predicate 4: Apply the distinctness constraint to values in 3*3 blocks

:@3a            Split 3 lines of the board in 3 parts
    z           Zip them together
     :ca:5a.    Concatenate each element of the zip, apply predicate 5 to that

Predicate 5:

:3a.    Apply predicate 3 to each element of the input

Predicate 6: Assign values satisfying the constraints to a subset of the blank cells, then with those values there is only one solution to the board.

hs.       Output is a subset of the blank cells
:=a,      Assign values to those cells
?t:9ac    Concatenate the values of all cells of the board
:=f       Find all solved boards
l1        There is only 1 such solved board

Predicate 7: Transforms the board such that each cell is now [V:X:Y] instead of only V (the value).

:Im       Take the Ith line of the board
:8f       Transform all elements of the line using predicate 8
:[[I]]z   Zip the result with [I]
:ca.      Concatenate each element of the zip

Predicate 8: Transforms a line such that each cell is now [V:X].

:Jm    Take the Jth element of the line
:J.    Output is [That element:J]

Predicate 9: Retrieve the values of cells

:ha.   Take the head of each element of the input

Predicate 10: Append the length of a subset at the beginning of it

lg     Put the length of the input in a list
:?c.   Concatenate it with the input

Predicate 11: Print one cell

b:+a[X:Y],        Increment coordinates by 1 to get X and Y
?h:Y:Xr:          Build the list [X:Y:Value]
"(~d,~d):~d\n"w   Format that list as "('X','Y'):'Value'\n" to STDOUT


Python 3, 80 bytes (Cracked)

bhmq = int(input())
print(bhmq ** 2)
(1 or [(sqrt),(specification+of*integerr)])

Domain: positive integers. Function is just squaring of a number. Input to stdin, output to stdout, as well as in the inverse function. Note that Python ignores the third line here, because it is syntactically valid and 1 is already a truthy value, so Python doesn't even look whether the right part of 'or' is well-defined.

Robbers should write a sqrt function that will work correct on all non-zero squares, printing integer value as is, without floating point (so on input '4' output should be '2' or '2\n', not '2.0' or '2.0\n').


7, 31 characters, score 30, safe but possibly broken?

A 7 program is normally just a number, but it can contain whitespace, splitting it into multiple numbers. This submission therefore consists of two numbers (which are implicitly concatenated by the 7 interpreter), and the program likewise takes two numbers as input, via standard input. (The "31 characters" in the header is the total length of the two numbers, plus one separating whitespace character; the digits that make up the numbers are interpreted as octal when used as a program, but decimal when used as an input, and it's the digits that are the same in the two cases, not the actual numbers. Note that it's irrelevant either when treated as a program, or when treated as an input, whether you separate them with a space or a newline; I hope that doesn't invalidate the submission.)

The expected output is the following number (expressed here in decimal, as that's the output format that the 7 interpreter uses):

238363505302130098723162537059

Note that the 7 interpreter linked from the Esolang wiki internally stores numbers in unary, meaning you're unlikely to have enough memory to actually run the program on itself to see what it does. I verified the program via working out its behaviour manually, and testing it on small inputs to verify that it did what I expected it to do. An alternative approach would be to write an interpreter that uses a more efficient method of storing numbers.

Avoiding cracks here was something of a pain, but I'm finally now satisfied that no two numbers other than those in the program itself are capable of producing 238363505302130098723162537059 as output. (EDIT 1 week later: I may have been wrong, depending on how you interpret the question; see below.)

Solution

The original program was:

  711170237403706
111723603700633

This program takes two numbers \$x\$ and \$y\$, and calculates the result of the expression \$3xy-y-2\$ (i.e. \$y(3x-1)-2\$). If we perform this calculation at \$x=711170237403706\$ and \$y=111723603700633\$, we get a result of \$238363505302130098723162537059\$ as required.

It was intended that no other input will give the desired result because:

  The input must be chosen such that \$y(3x-1)-2=238363505302130098723162537059\$, i.e. \$y(3x-1)=238363505302130098723162537061\$ (adding 2 to both sides). This number is a semiprime, with only two factors: \$111723603700633\$ and \$2133510712211117\$. Only one of these numbers, \$2133510712211117\$, can be expressed in the form \$3x-1\$ (giving \$(3 \times 711170237403706)-1=2133510712211117\$). So we can uniquely identify which number is \$x\$ and which is \$y\$, meaning that only one input works.

However, depending on how you interpret the question, there may be a second input that produces the desired output (thus invalidating this solution):

  Unfortunately, there are two multiplicative partitions of a semiprime into two factors: one is to divide it into the two prime factors, but the other is the trivial partition consisting of \$1\$ and the number itself. \$1\$ cannot be written in the form \$3x-1\$ with integer \$x\$, but the desired output can be; thus a potential meta-crack involves giving the input as \$79454501767376699574387512354\$ and \$1\$. However, the first number here involves characters (\$8\$ and \$9\$) which are not in the character set for 7 programs. So if input is restricted to being in the same character set as the program, this solution is valid; but if input containing characters from outside the program's character set is allowed, this solution is invalid.

Explanation

Here's how the intended solution functions:

  711170237403706 111723603700633
7   7   7                         Stack element separators
 111 023 403706 111723603700633   Initial stack elements
 111                              Number 3, in unary
     023                          I/O DSL for "input a number"
         403706 111723603700633   Main program
(Implicit: execute a copy of the main program element, preserving the original)
         40                       Swap {023} above {program}, escaping it
           3                      Do I/O using {023}; pop {program}
     0                            I/O: numeric
      23                          Input a number, copying {111} that many times
            706                   Append "6" to the number (decrementing it)
                11                Push two empty stack elements
                  17236           Push a stack element "23" (unescaped)
                       0          Escape {23}, consuming an empty element
                        3         Do I/O using {23}; pop {the element below}
                    23            Copy the top of stack input many times
                         7006     Append "66" (i.e. subtract 2)
                             3    Output {as a number}
                              3   Exit the program (due to low stack)
The leading 7 and trailing 3 aren't necessary for the program's functionality, they're just there to get the prime factors of the output right. It helps to follow this program if you understand the numeric format; numbers are stored in a unary variant in which 1 and 7 increase the value by 1, and 0 and 6 decrease the value by 1 (thus appending 66 decreases the value by 2, repeating the number multiplies it, and so on). Input's done by repeating a stack element (thus if the stack element is 12345 and the input is \$3\$, the new stack element will be \$123451234512345\$).


3. JavaScript → Python 2 → Foo

JavaScript

Classic JS quine. This is a full program which outputs to console:

(f=_=>console.log(`print(${String.fromCharCode(39)}${String.fromCharCode(34)}(f=${f})()${String.fromCharCode(34)}${String.fromCharCode(39)})`))()

Try it online!

Python 2

Python code basically prints out the JS code with quotes:

print('"(f=_=>console.log(`print(${String.fromCharCode(39)}${String.fromCharCode(34)}(f=${f})()${String.fromCharCode(34)}${String.fromCharCode(39)})`))()"')

Try it online!

Foo

Foo code is JS code with quotes:

"(f=_=>console.log(`print(${String.fromCharCode(39)}${String.fromCharCode(34)}(f=${f})()${String.fromCharCode(34)}${String.fromCharCode(39)})`))()"

Try it online!


V, 4 5 bytes

òeXp

Try it online!

|| denotes the cursor

The buffer starts with |w|ord and more words and the cursor being on the first character.

Recursively ò

go to the end of a word

wor|d| and more words

remove X the character to the left of the cursor

wo|d| and more words

paste it over the next character

wod|r| and more words

Implicit ending ò, repeat the same process for other words until the end of the buffer is reached


Make a code square with your favorite word

Javascript - action - 15x15
"Definetly not the shortest one, but PEW PEW PEW." - James Bond
ction="action "
ction+="means "
actionac="PEW "
ctionact="PEW "
tionacti="PEW "
ionactio="PEW "
onaction="PEW "
nactiona="PEW "
ction+=actionac
ction+=ctionact
ction+=tionacti
ction+=ionactio
ction+=onaction
ction+=nactiona
alert(""+ction)

Link to the jsfiddle
Output (37 chars):
action means PEW PEW PEW PEW PEW PEW


Shortest total non-primitive recursive function

Haskell, 29 bytes

(+1)?(2?)
z?f=(iterate f z!!)

Try it online!

An Ackermann-like function. Starting the base numerical value at 2 makes for a simple base case. An annoying number of bytes are spent converting the arguments order for "apply f n times starting from z" from iterate f z!!n to (?) z f n which can be curried nicely.

Same thing written more explicitly for 2 bytes longer:

31 bytes

0%n=n+1
m%n=iterate((m-1)%)2!!n

Try it online!

Another alternative to the original is to flip the two arguments to ?, allowing it to be defined in a point-free way for the same byte count.

29 bytes

(?2)?(+1)
(?)=((!!).).iterate

Try it online!

29 bytes

(?2)?(+1)
(?)f=(!!).iterate f

Try it online!

31 bytes

n?0=n+1
0?m=2
n?m=(n-1)?m?(m-1)

Try it online!


flex, 86 \$\cdots\$ 83 82 bytes
Saved 2 bytes and got moved into TIO thanks to Mukundan314!!!

%{
a;m(){a*=a!=256;}
%}
%%
i m(++a);
d m(a&&--a);
s m(a*=a);
o printf("%d ",a);
%%

Try it online!
flex stands for fast lexical analyser generator. It takes input as above and generates a lexer in C.
The input comprises of a C declaration section:
%{
a;m(){a*=a!=256;}
%}

where here we simply declare the accumulator a (implicitly as an int) and a function to set the accumulator to \$0\$ if it's \$256\$ after a computation.
This is followed by the rules section comprised of all the regexes that need to be parsed along with their actions (in C):
%%
i m(++a);
d m(a&&--a);
s m(a*=a);
o printf("%d ",a);
%%

here we have our 4 characters along with the code to run when each is encountered. Decrement will only happen if the accumulator is non-zero.
There's a program section that follows this but it will simply default to a main that runs the parser if left out (as in this case).
You can generate the C-source code lexer from the above (in file deadfish.l) and compile it with the following:
flex deadfish.l
gcc lex.yy.c -o deadfish -lfl

After compiling, running the following:
echo iissso | ./deadfish
echo diissisdo | ./deadfish
echo iissisdddddddddddddddddddddddddddddddddo | ./deadfish
echo isssoisoisoisoiso | ./deadfish
echo ooooosioiiisooo | ./deadfish
echo iiiiiiiissdiiiiiiiiiiiiiiiiio | ./deadfish

outputs:
0
288
0
1 4 25 676 458329
0 0 0 0 0 1 16 16 16
4112

You can also just run it as ./deadfish and have an interactive deadfish environment to play with to your heart's content!


Average impact of multiple conversion errors

APL (Dyalog Unicode), 41 bytes

(|40+⎕)+.×(|÷≢)1-1.8*1(-,+)⍨⍣(⎕-2)⊢1-3|⍳4

Try it online!
A full program. Takes the number of people, then the initial temperature. TIO version is wrapped in a function for easier testing. As I pointed out in a comment, the initial and final units do not matter as long as they are equal.
The math
The code exploits the fact that Fahrenheit-Celsius conversion has a fixpoint at -40 (-40°F = -40°C). Then we can add 40 to all temperature readings, and then the whole series of conversion reduces into a (positive or negative) integer power of \$\frac95\$.
$$
F+40=\frac95(C+40), \quad C+40 = \frac59(F+40)
$$
Since every temperature value is offset by the constant value of 40, the difference between two offset temperature values is the same as that of the original. Therefore, it suffices to apply the offset to the initial temperature and ignore it to the end.
Let's call \$r = \frac95\$.
Now to the part of counting all conversion paths. Let's say the initial reading is in Fahrenheit. Then:

Initial conversion: F→F (\$r^0\$) or F→C (\$r^{-1}\$).
Final conversion: F→F (\$r^0\$) or C→F (\$r^1\$).
All inner conversions: C→F (\$r^1\$) or F→C (\$r^{-1}\$).

So the task reduces to finding all the individual terms in the expansion of \$(r^0 + r^{-1})(r^1+r^{-1})^{n-2}(r^1+r^0)\$. Then plug in the value of \$r\$, evaluate the average of differences to 1, and then multiply with the initial temperature (with offset).
The code
(|40+⎕)+.×(|÷≢)1-1.8*1(-,+)⍨⍣(⎕-2)⊢1-3|⍳4

⊢1-3|⍳4  ⍝ A fancy way to create an array of 0 ¯1 1 0
         ⍝ which represents the powers in (1+r^-1)(r+1)
⍣(⎕-2)   ⍝ Repeat n-2 times...
1(-,+)⍨  ⍝ multiply the given polynomial with (r+r^-1)
         ⍝ and list all powers
1.8*     ⍝ Plug in r = 1.8 and evaluate the powers
1-       ⍝ Difference of each value from 1
(|÷≢)    ⍝ Average of absolute differences from 1
+.×      ⍝ Product and sum with...
(|40+⎕)  ⍝ Absolute difference between -40 and t


Matlab, 91 77 bytes
function k=f(a);k=0;while a*0+1;l=numel(a);a(mod((1:l)+a-1,l)+1)=[];k=k+1;end

Old version:
function k=f(a);for k=1:numel(a);a(mod((1:l)+a-1,l)+1)=[];l=numel(a);if l==0;break;end;end

This is a challenge where matlab shines, the heart of this code is the deletion of the array entries: a(mod((1:l)+a-1,l)+1)=[] which is quite elegant I think.


Perl, 162 bytes

@a=map{$==rand 10}0..9;$"='';$a[5]%=2if($a[4]%=4)==3;"@a[4,5]"||$a[5]++;$a[3]=($a[2]%=4)%2?$a[3]%3:1+$a[3]%9;$f=9;for(@a){$x+=$f*$_;$f-=$f%10==7?4:2}print@a,$x%10

Ungolfed:

# Array with random digits
# ------------------------
@a = map { $= = rand 10} 0..9;
# do not insert a space, if arrays are interpolated into strings
$" = ''; #"

# Day correction
# --------------
# The day must be in the range of "01" to "31":
# * map first digit to "0" to "3": $a[4] %= 4
# * map second digit to "0" to "1" if first digit is "3"
$a[5] %= 2 if ($a[4] %= 4 ) == 3;
# * set day to "01" if day is "00"
"@a[4,5]" || $a[5]++;

# Month correction
# ----------------
# The month must be in the range "01" to "12" or "21" to "32"
# to get a valid month and century:
# * map the month to "00" to "39"
# * if the first digit is odd (catching both centuries at once)
#   * then map the second digit to "0" to "2"      (for months: 10..12)
#   * otherwise map the second digit to "1" to "9" (for months: 01-09)
$a[3] = ($a[2] %= 4) % 2 ? $a[3] % 3: 1 + $a[3] % 9;

# Calculate the control digit
# ---------------------------
# Because of the modulo 10 operations, the formula for the calculation
# of the control digit is rewritten from
# Q = (10 - ((A + 3B + 7C + 9D + E + 3F + 7G + 9H + I + J) % 10)) % 10
# to
# Q = (9A + 7B + 3C + D - E - 3F -7G - 9H - 11I - 11J) % 10
$f = 9;
for (@a) {
    $x += $f * $_;
    $f -= $f % 10 == 7 ? 4 : 2
}

# Print the result and control digit
print @a, $x % 10

# TEST section
# ------------

;$Q = $x % 10; # remember control digit in $Q

# Pretty print PESEL
print "\n\n",
  "YY MM DD ZZZ X Q\n",
  "@a[0,1] @a[2,3] @a[4,5] @a[6,7,8] $a[9] $Q\n";
print "\n";

# Pretty print the date
$month = "@a[2,3]";
$century = "??";
$century = "19" if $month >= 1 and $month <= 12;
$century = "20" if $month >= 21 and $month <= 32;
printf "Date: $century@a[0,1]-%02d-@a[4,5]\n", $month % 20;
print "\n";

# Pretty print the gender
print "Gender: ", $a[9] % 2 ? "male" : "female", "\n";
print "\n";

# Calculate the control date the official way
print "Control digit:\n";
$sum = 0;
$f = 0;
for (my ($i, $f) = (0, 1); $i<10; $i++, $f+=2) {
    $f %= 10;
    $f += 2 if $f == 5;
    printf "  $a[$i] * $f = %2d\n", $a[$i] * $f;
    $sum += $a[$i] * $f;
}
print "  ", "-" x 10, "\n";
printf "  %10d\n", $sum;
printf "  $Q = (10 - ($sum % 10)) % 10 = %d\n", (10 - ($sum % 10)) % 10;

Examples

83102570819

YY MM DD ZZZ X Q
83 10 25 708 1 9

Date: 1983-10-25

Gender: male

Control digit:
  8 * 1 =  8
  3 * 3 =  9
  1 * 7 =  7
  0 * 9 =  0
  2 * 1 =  2
  5 * 3 = 15
  7 * 7 = 49
  0 * 9 =  0
  8 * 1 =  8
  1 * 3 =  3
  ----------
         101
  9 = (10 - (101 % 10)) % 10 = 9

20233143600

YY MM DD ZZZ X Q
20 23 31 436 0 0

Date: 2020-03-31

Gender: female

Control digit:
  2 * 1 =  2
  0 * 3 =  0
  2 * 7 = 14
  3 * 9 = 27
  3 * 1 =  3
  1 * 3 =  3
  4 * 7 = 28
  3 * 9 = 27
  6 * 1 =  6
  0 * 3 =  0
  ----------
         110
  0 = (10 - (110 % 10)) % 10 = 0


Injection from two strings to one string

brainfuck, 30 29 27 23 bytes

,[-[+.>]-[>+<---]>.-.,]

Try it online!

Inputs are separated by a 0x01 byte.

This turns ["foo", "bar"] into fUToUToUTUTbUTaUTrUT. To recover the original two strings, take groups of 3 characters, find the one where the second letter isn't U, and split there.


C#

So I decided to get a little more... creative with my entry. The Brainfuck code is embedded into the C# as the various operators (not in comments or in hardcoded strings), while the C# code itself operates on a similar principal to the way Brainfuck prints characters (meaning there are no hardcoded strings, and C# generates each individual character as an integer then casts it to a char when printing).

I'm sure I could have made this more elegant, but it took me long enough to finish as it is.

Everything was tested on this JavaScript Brainfuck interpreter by Cal Henderson and with Visual Studo 2012's C# compiler (targeted at .NET framework v4.0).

using System;

namespace Polyglot
{
    internal static class Program
    {
        private static void Main()
        {
            var a = new short[50];

            short _1 = 72;
            short _2 = 0;
            short _3 = 0;
            short _4 = 0;
            short _5 = 0;
            short _6 = 0;
            short _7 = 97;
            short _8 = 0;
            short _9 = 0;
            short _10 = 0;
            short _11 = 0;
            short _12 = 0;
            short _13 = 0;
            short _14 = 0;
            short _15 = 0;
            short _16 = 46;
            short _19 = 0;
            short _20 = 0;
            short _21 = 0;

            if( 0 >= 0 )
            {
                ++_1;
                ++_1;
                ++_1;
                ++_1;
            }

            a[ -1 < 0 ? 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 : 0 + 1 > 1 ? 0 : 0 ] = 9001;

            if( 7 < 42 )
            {
                ++_1;
                ++_1;
            }

            Console.Write( (char)_1 );

            _2 = 101;
            _1 += 1 + 1 + 1 + 1 + 1;

            _3 = 42 > 7 ? 110 + 9 : 1 + 1;

            a[ -1 < 0 ? 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 : 0 > 0 ? 0 : 0 ] = 9001;

            if( 1 < 2 )
                _4 = 32;

            Console.Write( (char)_2 );

            ++_1;
            _5 = 105;

            Console.Write( (char)_3 );

            --_1;

            _6 = 115;

            Console.Write( (char)_4 );

            ++_1;
            ++_1;
            ++_1;
            _1 += 1 + 1 + 5;

            Console.Write( (char)_5 );

            --_1;
            --_1;

            if( 42 > 41 )
            {
                ++_1;
                ++_1;
                ++_1;
            }

            a[ -1 < 0 ? 0 : 10 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 > 5 ? 0 : 0 ] = 9001;

            if( 42 < 9001 )
                Console.Write( (char)_6 );

            Console.Write( (char)_4 );
            Console.Write( (char)_7 );

            if( 12 > 11 && 11 > 10 )
            {
                _8 = 108;
                _9 = _3;
            }
            else
            {
                ++_1;
                ++_1;
                ++_1;
            }

            a[ -1 < 0 ? 1 + 1 + 1 + 1 + 1 + 1 : 1 > 2 ? 0 : 0 ] = 9001;

            if( _4 < _1 )
            {
                ++_1;
                Console.Write( (char)_8 );
            }
            else if( _4 > _19 && _2 > _20 )
            {
                ++_21;
                ++_21;
                ++_21;
                ++_21;
                ++_21;
                _21 += (short)( _21 + 36 );
            }

            a[ -7 < 9 ? 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 : 4 > 8 ? 9 : 9 ] = (short)( 12 < 10 ? -_4 : _9 );
            Console.Write( (char)_9 );

            if( _4 > _9 )
            {
                ++_1;
                ++_1;
                ++_1;
            }

            a[ -9 < 7 ? 10 - 1 - 1 - 1 - 1 : 6 > 7 ? 0 : 0 ] = _21;

            if( 1 < 0 )
                return;
            else
            {
                ++_1;
                Console.Write( (char)_7 );
            }

            _10 += 5 + 4 + 1 + 2 + 8 + 9 + 1 + 91;
            Console.Write( (char)_10 );

            if( 10 > _4 ) ++_21; else a[ -0 < 0 ? 5 + 6 + 1 + 2 + 3 + 9 : 1 > 2 ? 0 : 9 ] = 50;

            if( _21 <= _4 )
                _11 = 58 + 57;

            Console.Write( (char)_11 );

            if( _2 <= _8 )
                Console.Write( (char)_4 );
            else if( 1 >= 2 )
                return;
            else if( 42 >= _4 )
                _1 += ++_21;
            else
            {
                a[ -99 < --_1 ? --_1 - _1 : 44 > 12 ? 9 : 7 ] = (short)( _2 < _4 ? _21 : 6 );
                throw new Exception();
            }

            switch( _4 )
            {
                case 32:
                    var x = (char)( (short)( _4 + 66 ) );
                    Console.Write( x );
                    break;
                default: break;
            }

            _12 += (short)( ++_12 + ( ++_1 ) + 1 + 1 + 1 );
            Console.Write( (char)_12 );

            _13 += (short)( 39 + 38 + 39 );
            Console.Write( (char)_13 );

            if( _12 < _13 )
                Console.Write( (char)_13 );

            if( _13 >= _4 )
            {
                _14 = (short)( 500 - ( - ( 50 ) ) - ( --_1 ) - 90 - ( -4 ) - 267 );
                Console.Write( (char)_14 );
            }

            switch( _1 )
            {
                case 52:
                    _15 += (short)( ++_1 + ( ++_21 ) );
                    break;
                default:
                    _15 += (short)( 15 + ( ++_1 ) + 2 );
                    break;
            }

            Console.Write( (char)_15 );

            if( _16 <= 3521 && _21 < _4 )
                Console.WriteLine( (char)_16 );

            _16 = (short)( Int16.Parse( "54" ) % 2 );
            _20 = (short)( Int16.Parse( "99" ) / ( _1 > _4 ? 3 : 0 ) );
            _1 = (short)( 02.23 );

            if( _16 > 9 || _20 >= 52 )
                _1 += (short)( ( ++_1 ) + _21 );

            a[ -0 < 0 ? -52 - ( --_20 ) : 1 > 0 ? 1 : 2 ] = (short)( _12 < _19 ? Int16.Parse( "19" ) : 44 );
            _12 -= (short)f( --_19 / 19.467d );

            if( _12 > _14 )
                _19 += (short)( _19 + 1 + _3 + 5 );

            a[ -904 < 409 ? 4 + ( ++_4 ) + 4 : 49 > 50 ? 49 : 50 ] = (short)( 50 < 99 ? _4 + 669.2452 : 0 );

            if( 44 > ++_4 )
                a[ -9 < 6 ? 6 + ( ++_4 ) : 9 > 2 ? 44 : 8 ] = 3;
        }

        private static double f( double x )
        {
            return x < 12 ? x + 13.22 : x < 6 ? x + 90.45 : 5555;
        }
    }
}

This is the original Brainfuck code I wrote for this challenge:

> +++++ +++
[ - < +++++ ++++ > ]
< ++++ .
+++++
> ++
[ - < +++++ +++++ > ]
< . ++ . -- . +++++ ++++ .
----
> +++++ +
[ - < ----- ----- > ]
< ... >>
+++++ +
[ - < +++++ > ]
< ++ . >>
+++++ +++++ ++
[ - < +++++ +++++ > ] <
- . >
+++++ +
[ - < ---- > ] <
++ . +++++ +++ .
> ++
[ - < +++++ > ]
< + . < . >>
+++
[ - < ----- > ] <
+ . +++++ ++++ . +++ .
< . > ----- ---- . +++++ +++++ + .
<< ... > . >>
++++
[ - < ---- > ] < .
--- . >
++++
[ - < ++++ > ]
< + .
> ++
[ - < +++ > ]
< + . < + .

When running the C# code through a Brainfuck interpreter, you end up with the following commands (notice the addition of the square brackets at the beginning, these are from the array declaration and don't do anything, since the cell under the memory pointer in the array will already be 0):

[] > +++++ +++
[ - < +++++ ++++ > ]
< ++++ .
+++++
> ++
[ - < +++++ +++++ > ]
< . ++ . -- . +++++ ++++ .
----
> +++++ +
[ - < ----- ----- > ]
< ... >>
+++++ +
[ - < +++++ > ]
< ++ . >>
+++++ +++++ ++
[ - < +++++ +++++ > ] <
- . >
+++++ +
[ - < ---- > ] <
++ . +++++ +++ .
> ++
[ - < +++++ > ]
< + . < . >>
+++
[ - < ----- > ] <
+ . +++++ ++++ . +++ .
< . > ----- ---- . +++++ +++++ + .
<< ... > . >>
++++
[ - < ---- > ] < .
--- . >
++++
[ - < ++++ > ]
< + .
> ++
[ - < +++ > ]
< + . < + .


Ruby, 229 bytes

->s,m{c=m.flat_map.with_index{|x,i|x.size.times.select{|j|x[j]==?D}.map{|y|[i,y]}}
s.chars{|h|x='1234567890qwertyuiop*asdfghjkl*zxcvbnm'.index h
x,y=(x%10)*2,x/10
a,b=c.min_by{|a,b|(y-a).abs+((y%2>0?x+1:x)-b).abs}
m[a][b]='F'}
m}

Not very good, but I just had to get the first answer in.

Slightly ungolfed / commented version:

#!/usr/bin/ruby

f = -> s, m {
    # get knob coords
    c = m.flat_map.with_index {|x, i| x.size.times.select{|j| x[j] == ?D }.map{|y| [i, y] } }
    # for each char in the string
    s.chars {|h|
        # note the asterisks to correct for offsets
        x = '1234567890qwertyuiop*asdfghjkl*zxcvbnm'.index h
        # get un-"staggered" x and y coords
        x, y = (x % 10) * 2, x / 10
        # add one to x for every other row to fit keyboard
        x += 1 if y % 2 > 0
        # find closest knob by Manhattan distance
        a, b = c.min_by{|a, b| (y - a).abs + (x - b).abs }
        # LIGHT IT ON FIRE!
        m[a][b] = 'F'
    }
    # return new map
    m
}

puts f['helloworld123', ['D    D       D     D', '    D', '', '              D  D']]


Change text gravity like the 2048 puzzle

Jelly, 23 bytes
UZ
Ç¡=⁶$Þ€Ç$⁴¡ZU$⁵+⁴¤¡Y

Try it online!
I'm a bit unsatisfied, but MATL needed some competition. :P
Uses the order URDL. Inputs:

the input array as an array of padded lines
the number of repetitions
the move to start from (1 = U, 2 = R, 3 = D, 4 = L)

Explanation
UZ       Helper link. Argument: A (the 2D array)
U        Reverse each line and...
 Z       ...transpose. Rotates 90° CCW.

Ç¡=⁶$Þ€Ç$⁴¡ZU$⁵+⁴¤¡Y    Main link. Arguments: A, n (2D array, repetitions)
Ç                       Rotate 90° CCW...
 ¡                      ...m times. (m = which move to start on)

     Þ                  Sort...
      €                 ...each line of the array...
  =⁶                    ...based on the characters' equality to " ".
       Ç                Rotate 90° CCW.
        $               Combine the sort and rotate to one action.
         ⁴¡             Do that n times. (n = repetition count)

           Z            Transpose and...
            U           ...reverse each line. Rotates 90° CW.
             $          Combine the transpose and reverse to one action.
                  ¡     Do that...
              ⁵+⁴¤      ...m + n times.

                   Y    Join the array by newlines.


Bash 116 bytes, 16 spaces

find . -depth -exec bash -c 'B=${0##*/}
M="${0%/*}/${B// /_}"
while [ -e "$M" ]
do M=$M.
done
mv "$0" "$M"' {} \;

I didn't suppress errors to gain a couple more bytes. This will not have any collisions.

If non-posix GNU find can be expected, this can be shortened further:

Bash 110 bytes, 15 spaces

find -d -exec bash -c 'B=${0##*/}
M="${0%/*}/${B// /_}"
while [ -e "$M" ]
do M=$M.
done
mv "$0" "$M"' {} \;

Removing spaces instead of replacing them uses two less bytes:

Bash 108 bytes, 15 spaces

find -d -exec bash -c 'B=${0##*/}
M="${0%/*}/${B// }"
while [ -e "$M" ]
do M=$M.
done
mv "$0" "$M"' {} \;

Note: if tabs can be used instead of spaces, only 1 space is needed (the one in the match rule for substitution at line 2).

Thanks to Dennis for finding bug on double quote (and providing solution)


CJam (84 80 chars * 0.7 = 56)

{_,({_,,{_2$m<(;(+Q0\)\++m>\}%)_(+.{X2$-*_@+/}1\{1$*\1$-}%)1\-f/.f*:.+}{,da}?}:Q

Online demo. This is a recursive function which takes an array of doubles and returns an array of doubles. The online demo includes a tiny amount of scaffolding to execute the function and format the output for display.

Dissection

The basic principle is that if there are n > 1 players left, one of them must be the next one to be knocked out. Moreover, the order of the queue after that happens depends only on the initial order of the queue and on who gets knocked out. So we can make n recursive calls, calculate the winning probabilities for each player in each case, and then we just need to weight appropriately and add.

I'll label the input probabilities as [p_0 p_1 ... p_{n-1}]. Let f(a,b) denote the probability that a fails to defend against b. In any given round, the probability that a defends successfully is p_a, the probability that b knocks a out is (1-p_a)*p_b, and the probability that it goes to another round is (1-p_a)*(1-p_b). We can either do an explicit sum of a geometric progression or we can argue that the two geometric progressions are proportional to each other to reason that f(a,b) = (1-p_a)*p_b / (p_a + (1-p_a)*p_b).

Then we can step up a level to full rounds of the line. The probability that the first player is knocked out on is f(0,1); the probability that the second player is knocked out is (1-f(0,1)) * f(1,2); the third player is (1-f(0,1)) * (1-f(1,2)) * f(2,3); etc until the last one is knocked out with probability \prod_i (1-f(i,i+1)) * f(n-1,0). The same argument about geometric progressions allows us to use these probabilities as weights, with normalisation by a factor of 1 / \prod_i f(i, i+1 mod n).

{                   e# Define a recursive function Q
  _,({              e# If we have more than one person left in the line...
    _,,{            e#   Map each i from 0 to n-1...
      _2$m<         e#     Rotate a copy of the probabilities left i times to get [p_i p_{i+1} ... p_{n-1} p_0 ... p_{i-1}]
      (;(+          e#     i fails to defend, leaving the line as [p_{i+2} ... p_{n-1} p_0 ... p_{i-1} p_{i+1}]
      Q             e#     Recursive call
      0\)\++        e#     Insert 0 for the probability of i winning and fix up the order
      m>\           e#     Rotate right i times and push under the list of probabilities
    }%
    )               e#   Stack: [probs if 0 knocked out, probs if 1 knocked out, ...] [p_0 p_1 ...]
    _(+.{           e#   Duplicate probs, rotate 1, and pointwise map block which calculates f(a,b)
      X2$-*_@+/     e#     f(a,b) = (1-p_a)*p_b / (p_a + (1-p_a)*p_b)  TODO is the d necessary?
    }
    1\{1$*\1$-}%    e#   Lift over the list of f(a,b) a cumulative product to get the weights  TODO is the d necessary?
    )1\-f/          e#   Normalise the weights
    .f*             e#   Pointwise map a multiplication of the probabilities for each case with the corresponding weight
    :.+             e#   Add the weights across the cases
  }{,da}?           e# ...else only one left, so return [1.0]
}:Q


Diophantine Approximation: find lowest possible denominator to approximate within given precision

R, Xx bytes
Note: this challenge is quite a good introductory-challenge for R, which is the 'language-of-the-month' for September 2020, so I've blanked-out my answer in the hope of encouraging some other golfers to have a shot at it in R, too...

 50 bytes

    function(x,e,s=1:e^-1)s[(x-round(x*s)/s)^2<e^2][1]

Try it online!
Function with arguments x & error e.  Can handle negative x (even though not required for challenge)

Note 2: dammit!  a port of xnor's approach is 6 bytes shorter still:

 44 bytes

    function(x,e,s=1:e^-1)s[(x+e)%%(1/s)<2*e][1]

Try it online!


Ruby (recursive), 41 bytes * 0.5 = 20.5
def n(n,i=1);i>n ?[]:n(n,i+1)+[*i..n];end

Or using a lambda (as recommended by histocrat and Ventero): 34 bytes * 0.5 = 17
r=->n,i=n{i>0?[*i..n]+r[n,i-1]:[]}

(call using r[argument])


I felt like doing a little JavaScript.
Also, I cried a little on the inside when I wrote "document.write"

    <textarea id='ta' cols='80'></textarea>
    <button onclick="foo()">go</button>

Input:

10
{"":["ab","cd",""],"":["e<C>e"],"<C>":["z","",""]}

Output:

ccaaceeeeezeeeeedbbdd
accccceeeezeeeedddddb
aecezedeb
eaezebe
ccccaacezedbbdddd
eeeaaaceecacezedbdeedbbbeee
acaecaeaaeacccceeeeeeeaeeezeeebeeeeeeeddddbebbebdebdb
aaceezeedbb
aacezedbb
ceeaceecacaacezedbbdbdeedbeed


Python 2, 18 bytes

lambda n:3*n-1%n*4

Try it online.

I picked this trick up from xnor just a few days ago…!


Turn an integer n into a list containing it n times

Jelly, 1 byte

x

Try it online!

Note that this is not the “repeat n n times” built-in — its function is more general than that. For example 4,5,6x1,2,3 equals [4, 5, 5, 6, 6, 6]. Given only one argument, Jelly just happens to use it as both the left and right argument for the supplied link, but this functionality is not inherent to x.

If this doesn’t count, there are various fun 2-byte alternatives:

x` ṁ` Ra Rị R» a€ oR oḶ oṬ oẊ Ḷị Ḷ» Ṭị Ṭ» Ẋị Ẋ» ị€ ṛ€ ȧ€ »€

etc.


NOTE: The below are correct as of Julia 1.4.1
A few tricks to save a few characters

Overload operators with frequently used binary functions. For example, if you need to do a lot of integer divisions, and no need for inverse division, use \ =div, and you can then type a\b instead of div(a,b). Note the space - this is necessary to avoid it parsing as a "=" operator. Also note that, if overloaded at REPL prompt level, use (\)=Base.(\) or \ =Base. \ to reset it. NOTE: some functions have existing UTF-8 operators pre-defined, such as ÷ for div, as noted by Alex A.
Use ^ with strings for conditional output. That is, rather than a>0?"Hi":"", use "Hi"^(a>0) to save one byte, or for boolean a, use "Hi"^a to save three bytes.
(sometimes) Store small fixed-size vectors as separate variables. For instance, rather than a=split("Hi there"," "), you may be able to avoid a[1] and a[2] by using a,b=split("Hi there"," "), which can be referenced as a and b, saving three bytes for each use, at the cost of just two extra characters at assignment. Obviously, do not do this if you can work with vector operations.
Don't use isempty for Arrays, Tuples, or Strings - instead, use ==[] for arrays and ==() for tuples; similarly, for the negative, use !=[] and !=(). For strings, use =="" for empty, but use >"" for not-empty, as "" is lexicographically before any other string and it saves one byte.
Use the right short-circuit boolean operator in place of "if". It might be a bit less Julia-specific, but it is worth bearing in mind. x<=1&&"Hi" can be written as x>1||"Hi", saving a character (so long as the return of the boolean isn't important).
Don't use contains to check presence of character in string - if you're restricted to the basic ASCII, use in('^',s) rather than contains(s,"^"). If you can use other characters, you can save a bit more with '^'∈s, but note that ∈ is 3 bytes in UTF-8.
Looking for minimum/maximum values in an array? Don't use minimum or maximum - rather than using minimum(x) or maximum(x), use min(x...) or max(x...), to shave one character off your code. Alternatively, if you know all elements of x will be non-negative, use minabs(x) or maxabs(x)
Where possible and permitted by the challenge, use an actual newline instead of \n - note that this will make your code harder to read, and may mean that you need to provide an "ungolfed" version to make it possible for people to actually understand it.
Put options after the regex string - if you want to have a regex string in multiline mode, for example, don't type r"(?m)match^ this", type r"match^ this"m, saving three characters.
Where possible, use array concatenation instead of push!, unshift!, append!, or prepend! - for normal arrays, this can be done easily. For arrays of type Any with array elements, you will need the type Any, as in Any[[1,2]]. At one stage, curly braces could be used as an alternate notation ({[1,2]}), but this has been discontinued.
Don't use collect to convert a string into a char array - instead of collect(A), use [A...], which will do the same thing and save 4 bytes.
Need a number converted to a string? Use "$(s[i])" or dec(s[i]) for expressions or multi-character variables, and "$i" for single-character variables.
Use union or ∪ instead of unique - union(s) will do the same thing as unique(s), and save a byte in the process. If you can use non-ASCII characters, then ∪(s) will do the same thing, and ∪ only costs 3 bytes instead of the 5 bytes in union. In some circumstances, for single-character variables, you can save another byte using s∪s (thanks, MarcMush, for s∪s).
Use array indexing to get the size of an array or string - when you use end within array indexing, it automatically gets converted to the length of the array/string. This can be handy when you want to collect the length while doing certain operations. For example, if you need the length of A and the middle value, you might write A[(k=end)÷2]. This can also work in multiple dimensions, and for index iterators - A[(k=1:end;)] will give you an iterator for k=1:length(A), which can be handy when you also want to use A. Note that the assignment must occur in brackets, with a semicolon (such as (k=end;)) if no operation is done outside the brackets. (thanks to MarcMush for identifying a workaround for keywords in array indexing)

Outdated tricks that worked at some point, but no longer do:

 Access first element of Array with [] - for arrays, the expression A[] is equivalent to A[1]. Note that this does not work for Strings if you wish to get the first character, or for Tuples. - A[] no longer works.

 Reverse 1-D arrays using flipud - reverse(x) is one byte longer than flipud(x) and will perform the same operation, so the latter is better. - flipud is no longer in Base.

 Use ?: instead of && or || for conditional assignment - that is, if you want to perform an assignment only on some condition, you can save one byte by writing cond?A=B:1 rather than cond&&(A=B), or cond?1:A=B rather than cond||(A=B). Note that the 1, here, is a dummy value. - the ?: notation now requires spaces around ? and :.


J, 30

I like the elegance of this:

[:A.[:{/]A.~/~i.@[

or this:

13 :'A.{/(i.x)(A.)~/y'

but they work like this:

3 f 2 5
3
12 f 8 9
17

So this is the valid entry:

([:A.[:{/i.@{.A.~/}.)".}.>ARGV

Some explanations:

3 A. 0 1 2: gives the 3rd permutation of 0 1 2 (= 1 2 0)
0 1 2 (A.)~ 3: is the same but with arguments reversed
0 1 2 (A.)~/ 3 4 5 ... "applies" (A.)~ to 3 4 5 ..., so it gives the 3rd, 4th, 5th, ... permutation of 0 1 2.
A. 1 2 0: gives the order of the permutation of 1 2 0 (= 3)
i. n: gives the sequence 0 1 2 ... n-1
1 2 0 { 0 2 1 arranges 0 2 1 by 1 2 0 (= 2 1 0)


Exploit the ByRef default when calling subs

It is sometimes possible to use a Sub call in place of a Function to save a few additional characters...

This (87 chars)

Sub a()
b = 0
Do Until b = 5
b = c(b)
Loop
End Sub
Function c(d)
c = d + 1
End Function

can be re-worked to (73 chars):

Sub a()
b = 0
Do Until b = 5
c b
Loop
End Sub
Sub c(d)
d = d + 1
End Sub

Notice this will NOT loop forever, though it appears you are never reassigning b's value.

The above doesn't use a Function call, but instead exploits the ByRef ("By Reference") functionality of the Sub call. What this means is the passed argument is the same variable as in the calling function (as opposed to a ByVal, "By Value" passing, which is a copy). Any modifications to the passed variable will translate back to the calling function.

By default, vba takes all arguments as ByRef, so there is no need to use up characters to define this.

The above example may not translate perfectly for you, depending on the return value of your function. (i.e. returning a different data type than what is passed), but this also allows for the possibility of getting a return value whilst still modifying your original variable.

For example:

Sub a()
b = 0
Debug.Print c(b) ' This will print 0, and b will equal 1.'
End Sub
Function c(d)
c = d
d = d + 1
End Function


Add an integer to a set and take it back out

C#

void Encode(HashSet<int> set)
{
    set.Add((set.Single() + 1) % 1001);
}

void Decode(HashSet<int> set)
{
    set.Remove(set.Equals(new HashSet<int>() { 0, 1000 }) ? 0 : set.Max());
}

Works for a set of length 1.


8437495638205698686671 bytes

This translates to the brainfuck program:

-[>>[>]+[->[>]+.[<]+<]<-]

Which prints exactly \$231584178474632390847141970017375815706539969331281128078915168015826259279614\$ SOH bytes.

This is calculated by the function

f(n)=2*f(n-1)+n
f(0)=0

with an input of 255.

Explanation:

-[         Loop 255 times
  >>[>]    Move to the end of a series of positive cells (initially empty)
  +        Add one cell to the end
  [-       Loop over each cell
    >[>]+  Add one cell to the end
    .      Print a SOH byte
    [<]+   Restore current cell
  <]       Move to next cell
<-]        Decrement counter


Repeated Consecutive Digital Product Sum Convergence

05AB1E, 7 6 5 bytes

Thanks to Emigna for saving a byte!

vSγPO

Uses the 05AB1E encoding. Try it online!


x86 Machine Code, 23 bytes
86 89 C8 D4 23 34 0B 6B C0 C3 0C 35 24 B5 00 C8 D4 A8 F6 E1 83 C0 53 C3

Try it online!
The above bytes of code define a function that returns the \$n\$th prime, according to the formula given in the challenge. The function accepts a single argument, \$n\$, which is passed in the ECX register. It returns the result in the AX register. (Note: A 16-bit value is returned—the caller is responsible for zero-extending that 16-bit value in AX to a 32-bit value in EAX, if desired. Add one byte for a CWDE instruction if you think that is cheating!)
This is a custom calling convention, but it isn't particularly "weird", and machine/assembly language submissions are allowed to define a custom calling convention.
Credit where credit is due: this code is based on EasyasPi's x86 submission, but carefully optimized for size. In particular, I've chosen to target 32-bit x86 so that I can use the long-obsolete AAM instruction, which is not supported in x86-64 "long" mode. AAM was designed into the architecture as a way to convert from binary to binary-coded decimal (BCD). To do this, it divides the AL register by 10, storing the quotient in AH and the remainder in AL. (Note that this is the reverse of what the DIV instruction produces!) Intel's original manuals documented AAM as a one-byte instruction, but it was actually encoded with two bytes, where the second byte was 10—the divisor for AL. Changing that second byte to another value allows dividing AL by an arbitrary value, essentially giving x86 an instruction to divide by an 8-bit intermediate. This trick is used twice, to great effect. (There is also a complementary AAD instruction, which allows multiplying by an arbitrary 8-bit immediate value, but that did not result in any savings, since it actually performs the multiplication on AH, instead of AL, and the shift that is required to support that requires 2 bytes, plus the 2 bytes for AAD, which is more than the 3 bytes required to encode the IMUL reg, reg, imm.) There are myriad other size optimizations as well, compared to EasyasPi's code.
Here are the ungolfed assembly mnemonics:
            ; Input(s):
            ;   ecx = The zero-based index of the prime to generate (i.e., "n").
            ;         (Note: This is assumed to be a value from 0 to 73.)
            ; Output(s):
            ;   ax  = The nth prime.
            ;         (Note: This is a 16-bit unsigned integer;
            ;                caller must zero-extend if desired.)
            ; Clobbers:
            ;   eax, flags
            GenerateNthPrime:
89 C8         mov   eax, ecx       # make a copy of the input (ecx) in eax
D4 23         aam   35             # al %= 35        ; ah = al / 35
34 0B         xor   al, 11         # al ^= 11
6B C0 C3      imul  eax, eax, -61  # ax  = (al * 195)
0C 35         or    al, 53         # al |= 53
24 B5         and   al, 181        # al &= 181
00 C8         add   al, cl         # al += cl
D4 A8         aam   168            # al %= 168       ; ah = al / 168
F6 E1         mul   cl             # ax  = (al * cl)
83 C0 53      add   eax, 83        # ax += 83
98          # cwde                 # eax = ax (sign-extend, assuming sign bit is 0)
C3            ret

Note the cwde instruction immediately before the return instruction there, which is commented out. For the purposes of this submission, this instruction is functionally equivalent to movzx eax, ax, which is what the caller of this function would normally use to zero-extend its 16-bit result (ax) to a 32-bit result (eax). However, cwde is encoded in only 1 byte, as opposed to the 3 bytes required by movzx. As I mentioned above, if you don't think it's legit that I return a 16-bit result, then add the cwde instruction to increase the total size of the function by only one byte.


Befunge, 70 64 bytes
~0~:70p##~+2%00p+"A"-~7%2++7%:3%2%00g*:10p+"A"+,00g!10g+#@_"#",@

Try it online!
The input should be in the form C# Treble or F Bass, although the clef can simply be the first letter (i.e. T or B), since the rest of the input is ignored anyway.
Explanation
~0        Read the note and push a zero (the purpose of this will become apparent later).
~:70p     Read the following sharp or space and write that out as the next instruction.

As a result of this code modification, the next sequence of instructions will take one of two forms:
##~       The first # jumps over the second, and thus we perform the read instruction.
 #~       But if there's only one #, we'll ending up skipping the read instruction.

At this point the stack either contains note,0,sharp,space or note,0,space.
+2%       Add the top two stack items mod 2, returning 1 if we read a sharp, else 0 if not.
00p       Save this 'sharp' boolean for later use.

At this point the stack either contains note,0 or just note (with an implicit zero below).
+         By adding the top two items, we combine the 0 (if present) onto the note below.
"A"-      We can then subtract 'A' to convert the note into a number in the range 0 to 6.
~7%2+     Read the T/B clef, then mod 7 and add 2, returning 2 or 5 (the conversion offset).
+7%       Add that offset to our note number, then mod 7, to get the converted note number.
:3%2%     Make a dup, and calculate mod 3 mod 2 to determine the special cases (B# or E#).
00g*      Multiply that by the 'sharp' boolean, since we only care if the input was sharp.
:10p      Duplicate and save this special case boolean for later.
+         Now add it to the note number, since the special cases need to be offset by 1.
"A"+,     Then we can finally convert the number back into a character and output it.
00g!10g+  Now we check if the original note was not sharp, or if this was a special case.
#@_       If so, we exit immediately.
"#",@     Otherwise, we output a '#'.


Spot all (anti)diagonals with duplicated values

R, 92 86 82 78 bytes

function(m,x=row(m),y=col(m),`|`=split,`^`=Map)sum(max^table^c(m|x-y,m|x+y)>1)

Try it online!

Explanation

First, we declare additional variables \$x\$  and \$y\$ that stand for row and column indices, respectively. Then we can delineate the diagonals and anti-diagonals by taking their difference and sum. E.g., for a 4x4 matrix:

\$x-y\$ gives:

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

\$x+y\$ gives:

2  3  4  5
 3  4  5  6
 4  5  6  7
 5  6  7  8

Now split(m, x-y) and split(m, x+y) produce the actual lists of diagonals and anti-diagonals, which we join together.

Finally, we count the entries of the resulting list where duplicates are present.

Thanks for bytes saved:

-4 by CriminallyVulgar
-4 by digEmAll


Javascript 5,955,958,211

I'm not sure if it is the optimal solution.
I used a brute-force method.

function f(n) {
  var o=[];
  for(var i=n;i--;) o.push(2*n-i); //init array from n+1 to 2*n

  for(i=n;i>0;i--) { //bruteforce on number from n to 1
    var index=0;
    var nbFactor=0;
    for(j=0;j<n;j++) {
      if((o[j]/i)%1==0) {
        index=j;
        nbFactor++;
      }
    }
    if(nbFactor==1) { //if there is only 1 factor, replace it by the new number
      o[index]=i;
    }
  }
  return o.sort(function(a,b){return a-b;});
}

Golfed (130) :

function f(n){o=[];for(i=n;i++<2*n;)o.push(i);for(i=n;i;i--){for(d=c=j=0;j<n;j++)if((o[j]/i)%1==0)d=j,c++;if(c==1)o[d]=i}return o}

Here is the result found by my algorithm for 25 :

  [8, 12, 14, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 29, 30, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49]

Little piece of code to compute the score (takes approx. 200 seconds on Chrome) :

var result=0;
var t = Date.now();
for(var j=1;j<2501;j++) {
  result += f(j).reduce(function(r,e){return r+e;});
}
console.log("Score : " + result + "\nCompute time : " + ((Date.now()-t)/1000) + " seconds");


Octave, 60 52 50 bytes

@(x)sum(sum(~diff(sort(reshape(x,3,[]))))'==[2 1])

Try it online!

Saved 8 bytes thanks to Luis!

Explanation:

Reshapes the input into a matrix with 3 rows, and the appropriate amount of columns. It then sorts each of the columns, and calculates the difference between the elements on different rows. This gives a matrix with two rows, where identical numbers will have a zero, and different numbers will have a positive number. This is negated, so that all equal elements are 1, and all unequal are 0. We then sum each of those columns, giving us one of the three alternatives: 0 = All elements are unequal, 1 = Two elements are equal and 2 = All elements are equal. We then check how many are >1, and how many are exactly ==1.


Jelly, 18 bytes

b⁴µ:⁵©+¹%⁵ḅ⁵ß¹®S¤?

Try it online!

The binary, 18 byte version of the source code has the xxd dump

0000000: 62 b6 8c 3a b7 85 2b 8e 25 b7 a3 b7 95 8e 88 53 83 3f b..:..+.%......S.?

and works with this version of the Jelly interpreter.

How it works

b⁴µ:⁵©+¹%⁵ḅ⁵ß¹®S¤?  Define the main link -- Left input: a (number)

b⁴                  Convert from integer to base 16.
  µ                 Start a new, monadic link.
   :⁵               Divide all base 16 digits by 10.
     ©              Save the result in a register.
      +¹            Add the quotients to the base 16 digits.
        %⁵          Take all resulting sums modulo 10.
          ḅ⁵        Convert from base 10 to integer.
              ®S¤   Take the sum of the quotients from the list in the register.
                 ?  If the result is non-zero:
            ß         Recursively call the main link.
             ¹        Else, apply the identity function.

Ḍ (decimal-to-integer) should have worked as a shorthand for ḅ⁵, but the latest version of Jelly at the time of this post had a bug that prevented me from using it.


Shortest python A + B program with input and output

Given the right hint toward the solution in the comment to the same question asked on stackoverflow ( see here ), I have got it right down to 34 and without any limitations on the input number or other tricks necessary:
print(eval(input().replace(*' +')))
Here a short summary of currently known different solutions:

print(eval(input().replace(' ','+')))  # 36
print(sum(map(int,input().split())))   # 36
print(eval(input().replace(*' +')))    # 34
print(sum(map(int,input()[::2])))      # 33 (limited to numbers between 0 and 9)

Maybe it could be considered cheating, but maybe not. At least there is no rule for this defined yet so let's include it into the collection of possible solutions:

import f;f.f()                         # 13

Required for this solution to work is a script f.py available in a search directory for modules of Python with following content:
def f():
    print(sum(map(int,input().split())))


C, 112 bytes, 28 TB/s, score ≈ 0.008

long b[9<<21];main(){for(b[2]=write(*b=1,wmemset(b+8,'\ny\ny',1<<25),1<<27)/2;b[3]=b[2]*=2;ioctl(1,'@ ”\r',b));}

(If you’re having trouble copying and pasting this, replace the multicharacter constant '@ ”\r' with '@ \x94\r' or 1075876877.)

This writes 128 MiB of y\ns to stdout, and then repeatedly invokes the FICLONERANGE ioctl to double the file’s length by adding new references to the same disk blocks.  Requires Linux x86-64 and a filesystem supporting FICLONERANGE, such as Btrfs or XFS; stdout must be opened in read-write mode (e.g. ./prog 1<> out in bash).

Self-contained testing script

This script loop-mounts a freshly created filesystem from a memory-backed image file and runs the program there.  (I get about 43 TB/s in-memory, but the ratio with yes(1) is similar.)  It works with either Btrfs or XFS, but Btrfs seems to give better scores.

#!/usr/bin/env bash
set -eux
dir="$(mktemp -dp /dev/shm)"
cd "$dir"
trap 'umount fs || true; rm -r "$dir"' EXIT
printf "long b[9<<21];main(){for(b[2]=write(*b=1,wmemset(b+8,'\\\\ny\\\\ny',1<<25),1<<27)/2;b[3]=b[2]*=2;ioctl(1,'@ \\x94\\\\r',b));}" > prog.c
b="$(stat -c %s prog.c)"
gcc -O3 prog.c -o prog
dd of=fs.img bs=1 count=0 seek=8G

# Pick one:
mkfs.btrfs fs.img
#mkfs.xfs -m reflink=1 fs.img

mkdir fs
mount fs.img fs
sync
timeout 1 yes 1<> fs/out || true
y="$(stat -c %s fs/out)"
rm fs/out
sync
timeout 1 ./prog 1<> fs/out || true
y1="$(stat -c %s fs/out)"
echo "score = $b * $y / $y1 = $(bc -l <<< "$b * $y / $y1")"


CJam, 147 bytes, slightly broken

qN/6/{z{:i:+165%91%' +}%"e 3 VG rr A>Q V) rP r4 />/ F> [> C >> 9$ j8 fQrQ rG rN rD VV $>$ ;$ 859 98 ff = BB"S/eeWf%$W%{~@@/\a*}/{`''#},'@f+'@/S*N}%

It passes CODE GOLF and A-Z but not STAR WARS (which it reads as SAR WARS). I give up, but maybe someone is inspired.


1.

The portion 2+(_[0]+_[1]>=10) could be rewritten as 2+(_[0]+_[1]>9) to save two bytes. In a similar vein 2-(_[0]==10) can be rewritten as 2-(_[0]>9), since 10 is the only possible value greater than 9.

a=map(ord,raw_input());a=[10if y==88else 0if y==45else 58-a[x-1]if y==47else y-48for x,y in enumerate(a)]
t=0;exec('t+=sum(a[:2+(a[0]+a[1]>9)]);a=a[2-(a[0]>9):];'*10);print t

Try it online!

(I also renamed _ to a, because even though it's code-golf we don't have to make it unreadable)

2.

You can also use a dictionary instead of conditionals to saves some bytes.

a=raw_input();a=[{y:ord(y)-48,'X':10,'-':0,'/':58-ord(a[x-1])}[y]for x,y in enumerate(a)]
t=0;exec('t+=sum(a[:2+(a[0]+a[1]>9)]);a=a[2-(a[0]>9):];'*10);print t

Try it online!

3.

Don't enumerate.  enumerate tends to be too long for it's own good.  Here you want to get the last character, which can better be acheived with a zip.

a=raw_input();a=[{y:ord(y)-48,'X':10,'-':0,'/':58-ord(x)}[y]for x,y in zip('-'+a,a)]
t=0;exec('t+=sum(a[:2+(a[0]+a[1]>9)]);a=a[2-(a[0]>9):];'*10);print t

Try it online!

If you combine this with @user202729's two tips you get 149 bytes.

a=raw_input();a=[[10,0,58-ord(x),ord(y)-48]['X-/'.find(y)]for x,y in zip('-'+a,a)]
t=0;exec't+=sum(a[:2+(a[0]+a[1]>9)]);a=a[2-(a[0]>9):];'*10;print t

Try it online!

Here's another version that is also 149 bytes:

a=raw_input();a=[['-123456789X'.find(y),58-ord(x)][y=='/']for x,y in zip('-'+a,a)]
t=0;exec't+=sum(a[:2+(a[0]+a[1]>9)]);a=a[2-(a[0]>9):];'*10;print t

Try it online!


Convert a pawn promotion from algebraic to ICCF numeric notation


Perl, 63 62 bytes

Includes +4 for -lp

Give input on STDIN

oddeven.pl:

#!/usr/bin/perl -lp
s%.%(--$|?$n|$':$&|(ord$&&1?$n:$'))&($n=$&,~v0)%eg;y;\x7f-\xff; ;

This works as shown, but to get the claimed score this must be put in a file without final ; and newline and the \xhh escapes must be replaced by their literal values. You can do this by putting the code above in the file and running:

perl -0pi -e 's/\\x(..)/chr hex $1/eg;s/;\n$//' oddeven.pl


The square root of the square root of the square root of the…

APL (Dyalog Unicode), 39 bytes

+/⊢{∨/⍺⍵<⍵0:0⋄⍺=0:1⋄+/∊∇¨/⍺(⍵*2)-⊂⍳⍺}¨⍳

Try it online!
A tacit function containing an inner dfn to use recursion. Does not use floating point numbers at all.
How it works
First of all, observe that
$$
\displaystyle
\sqrt{a_1+\sqrt{a_2 + \cdots + \stackrel{\vdots}{\sqrt{a_t}}}} \le \cdots \le \sqrt{a_1+a_2 + \cdots + a_t} \le a_1+a_2 + \cdots + a_t = n
$$
and this holds for all suffixes of any given sequence of positive integers.
Let's define a function \$f(x,y)\$ as the number of sequences where the sum is \$x\$ and the "root sum" is \$y\$. Then the following holds:
$$
\begin{align}
f(0, 0) &= 1 \\
f(0, y) &= 0, \qquad 0 < y \\
f(x, y) &= 0, \qquad x < y \text{ or } y < 0 \\
f(x, y) &= \sum_{i=1}^{x}{f(x-i, y^2-i)}
\end{align}
$$
Then the desired result is the sum \$\sum_{i=1}^{n}{f(n,i)}\$.