@zyabin101 How should I pronounce your name? I always say züjabin (ü is pronounced the same as the letter in the greek "mu", or as in Martin Büttner's name)
@QPaysTaxes It's pretty useful quite often though. You can return multiple things from a function in a list and unpack them at the receiving end.
def foo(n):
a = 3*n+1
b = n//2
return a,b
x, y = foo(30)
print(x) #91
print(y) #15
Incidentally, a, b = 3, 2 is syntatic sugar for (a, b) = (3, 2).
The syntax can get weirder.
>>> *w = map(lambda x:x**2, range(10))
SyntaxError: starred assignment target must be in a list or tuple
>>> *z, = map(lambda x:x**2, range(10))
>>> z
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
That's not weird syntax though. Just a borked interpreter. :P
@NathanMerrill Based on the current state and the symbol under the tape head, write to the tape (may be the same symbol), move left or right, and change to a different state (well, may be the same state as before).
I am now trying to find the website I learned this from several years ago.
Help me find my car
image-processing graphical-output code-challengecode-golf
Every time I go to the mall, I use the "Find your car" machine. It never finds my car. I need you to help me make a better one.
Objective
Given a directory with images 1.jpg, 2.jpg..., and a license plate string,...
@xnor Hmm, the no-regex thing kind of has the problem I mentioned on that meta post about "what counts as regex". Technically none of Snails is regex, so it should have the banner? (Although you can't use regex in snails... so I'm not sure...)
The FitnessGram™ Code Golf Test
Same concept and rules to the well-known Rick Astley post a while back, only instead of using samples of various sizes, sample length is limited to what number sample it is. And different text for the program to write.
It's code golf, so standard loopholes apply,...
Largest Sum-Free Partition
related and inspired by -- Finding sum-free partitions
code-golf set-partitions combinatorics
A set A is sum-free if its self-sum A + A = { x + y | x, y in A} has no elements in common with it. Alternatively, the equation x + y = z has no solution for x,y,z ∈ A. For ...
$$ is a special variable meaning the last token of the previous command
So, we take the last token of the previous command, pipe it to a ForEach-Object loop |%{...} and each iteration just output the last token of the previous command
It's weird how I have a hard time keeping Euclid and Euler separate in my mind. Both were very prolific mathematicians, and they lived millennia apart.