Kade
  • Member for 6 years, 10 months
  • Last seen more than a month ago
"Hello, World!"
89 votes

Haystack, 17 Bytes Haystack is a 2D programming language that executes until it finds the needle in the haystack |, all while performing stack-based operations. All programs start from the top left ...

View answer
Summation from a to b
24 votes

Stuck, 4 Bytes I'm amazed Stuck finally is winning something! The inclusive range function checks to see if the top of the stack is a list of length 2, and uses it for the parameters of the range ...

View answer
Binary to decimal converter
22 votes

Python 2, 49 37 31 30 Bytes Now this will take a binary number in a decimal representation, since Python can handle arbitrarily large integers. b=lambda n:n and n%2+2*b(n/10) thanks to xnor for ...

View answer
Simple ASCII Gantt
20 votes

Python 2, 39 Bytes Straightforward solution using string multiplication :) for x,y in input():print' '*x+'-'*(y-x) Accepts input formatted like so: ((5,20),(5,20),(2,10),(15,19)) Check it out ...

View answer
Sign that word!
19 votes

Stuck, 5 Bytes I finally get to use my language, Stuck! :D s$""j This takes an input via stdin, sorts, joins, and implicitly prints. This did give me some ideas for changes though. Edit: Oh wow, ...

View answer
Translate your English source code into a foreign language
11 votes

C#, Latin - C Acutus using System; using System.Collections.Generic; using System.Text; using System.IO; namespace ToLatin { class Program { static void Main(string[] args) { ...

View answer
Given the names of two planets, give the distance
10 votes

Python 2, 149 147 142 138 128 123 119 Bytes Just uses a simple lookup to figure out which distances to use :) This defines an anonymous function, so to use it you'll need to give it a name. Thanks ...

View answer
Natural Pi #0 - Rock
9 votes

Python 2, 143 140 132 124 122 124 122 bytes It has been quite some time since I have tried golfing, so I may have missed something here! Will be updating as I shorten this. import random as r,...

View answer
Code close to the challenge: Inception
9 votes

Frink, distance 24 Calculate[the,Levenshtein]:=editDistance[the,Levenshtein] To use this, you would call Calculate with the two strings, and since this is returning, you also need to surround the ...

View answer
Make me a fake loader
8 votes

Python 2, 119 113 112 Bytes I had originally gone with the random amount being random()/.75, however the endpoint wouldn't be included. There isn't much difference from this to the other question for ...

View answer
Interleave strings
8 votes

Python 2, 101 89 86 69 bytes I'm hoping I can get this into a lambda somehow, shortening it down by making it recursive. It isn't ideal because you would hope transposing is shorter, unfortunately it ...

View answer
The Squaring Sequence
7 votes

Python 2, 51 46 44 Bytes I'd like to get rid of the clunky if if possible, but I think an exec could be shorter.. Turns out for the moment that exec is shorter. Wrong again! The recursive function ...

View answer
The very weird word counter
7 votes

Python 2, 220 ... 124 119 Bytes Huge thanks to Sp3000 for saving a lot of bytes. f='qwertyuiopasdfghjkl zxcvbnm'.find g=lambda i:sum(abs(f(x)%10-f(y)%10)+2*abs(f(x)/10-f(y)/10)for x,y in zip(i,i[1:])...

View answer
Display a chain of little mountains with an odd number on the top of it!
6 votes

Python 2 3, 67 65 63 60 Bytes Nothing too crazy here, I think the first section can probably be done shorter but I'm not quite sure how. I use the fact that in this case -~n/2 will work for ceil. ...

View answer
Depalindromize this string!
6 votes

Python 2, 23 bytes I am not able to test on my phone, but this should work: lambda s:s[:-~len(s)/2]

View answer
Dennis, Doorknob, Martin Büttner, Chris Jester-Young - Pizzeria!
6 votes

Stuck, 42 33 It returns! And in awfully long form. :( -- I stole aditsu's sort idea to save 9 bytes :) t;g*4/[4*"CEDM"z"];F*":j0GK'$:Nj Explanation: t;g*4/ # Take |-...

View answer
Brainf**k to Unary and Back
6 votes

Python 2, 80 79 63 55 + 86 64 = 119 Bytes Thanks to Sp3000 for his numerous suggestions, saving a lot of bytes. Brainfuck to Unary, 78 77 61 53 + 2 = 55 bytes Added two bytes to account for ...

View answer
Stretching Words
6 votes

Python 2, 83 74 72 65 Bytes No real special tricks here. x is the string, y is the array of characters that are duplicated. To clarify if this doesn't copy properly, the first indentation level is a ...

View answer
5318008 - Fun with Calculators
6 votes

Python 2, 271 216 211 205 Bytes This is the only idea I've had so far.. I will update this once I think of something else! I assumed we needed to read from a file, but if not let me know so I can ...

View answer
Fermat Near Misses
5 votes

Python 2, 122 119 Bytes why are you still upvoting? Dennis crushed this answer ;) Welcome to the longest solution to this question :/ I managed to shave off a whole byte by making longer conditions ...

View answer
Make your program sequential!
5 votes

Python 2, 35 Bytes I decided to use the obvious sequence A000027, which essentially has the formula n ;) If you run the following code: #print'n' n=1 exec'print n;n+=1;'*8 You get the output: 1 2 ...

View answer
Do Matrix Multiplication!
5 votes

Python 2, 69 66 Bytes This just follows the standard formula, but lambda-d for conciseness :) The ungolfed code is extremely straightforward! lambda x,y:[[sum(map(int.__mul__,r,c))for c in zip(*y)]...

View answer
Build me a brick wall!
5 votes

Python 2, 46 44 Bytes Just using string multiplication to build the string, and slicing to get the right bits :) k='_|__'*18 print'\n'.join([k[:70],k[2:]]*5) thanks to Antony Hatchkins for saving ...

View answer
How many integers contain a number in a specific range
5 votes

Python 2, 47 43 Bytes Relatively straightforward, making use of Python 2's repr short-form. f=lambda n,a,b:a<b and(`n`in`a`)+f(n,-~a,b) Ouput: f( 3, 1, 100) -> 19 f( 3, 3, 93) -> ...

View answer
Trick or Treat polyglot
5 votes

CJam / Stuck, 19 17 Bytes Stuck makes a comeback! "trick"e#"treat"p CJam will print trick, and Stuck will print treat! Here's an explanation in both languages. CJam: "trick" e# pushes ...

View answer
Folding Numbers
5 votes

Python 2, 100 99 95 94 Bytes This feels a bit long, but I'll keep working at it :) Prints a 1 if the number can be folded, 0 otherwise. a=bin(input())[2:] b=len(a) print(a[b/2]>=`b%2`)*all(c!=d ...

View answer
Track listings to time tables
5 votes

Python 2, 170 160 Bytes Been a while since I've done a golf, hopefully this isn't too bad :P t=0 for i in input().split('\n'):i=i.split(' - ');print'(%d:%02d:%02d)'%(t/3600,t%3600/60,t%60),i[0]....

View answer
Counter counter
5 votes

Python 2, 96 90 75 67+2 = 69 Bytes Can't think of any other way to do this... is what I would have thought until I saw xnor's solution. I'll post what I had anyways. Thanks to FryAmTheEggman for ...

View answer
Generate boxes!
5 votes

Python 2, 58 57 Bytes Fairly straightforward implementation. def f(x,y):a="="*(4*y+1);print(a+"\n="+" ="*y+"\n")*x+a Check it out here. Thanks to Sp3000 for saving one byte.

View answer
Variable-Prices income!
4 votes

Python 2, 79 74 54 48 Bytes Massive byte count increase by rethinking the problem. I would like to get rid of the int cast but my brain isn't working. Making use of l.pop() to avoid trimming the list ...

View answer