New answers tagged

1 vote

Decipher a squashed sequence

Pyth, 13 bytes ef!-.+T1sMM./ Try it online! Accepts a string as input. ...
user avatar
  • 6,897
1 vote

Decipher a squashed sequence

JavaScript (ES6), 83 bytes S=>[...S].some(c=>(k=s+=c,g=q=>q==S||S.match(q)&&g(q+k,o.push(k++)))(o=[]),s='')&&o Try it online!
user avatar
  • 167k
1 vote

Decipher a squashed sequence

Python 3, 127 bytes lambda s:g(s)[0] g=lambda s:s and[[int(s[:i])]+j for i in range(1,1+len(s))for j in g(s[i:])if j==[]or~-j[0]==int(s[:i])]or[[]] Try it online!
user avatar
  • 6,329
1 vote

Decipher a squashed sequence

Rust, 242 235 bytes ...
user avatar
  • 483
1 vote

Print all integers

Regenerate, 22 bytes 0|($2[0-9]!-?[1-9]())+ Attempt This Online! Thanks to thejonymyster for the idea to use this language to answer this question. In pretty-...
user avatar
  • 6,549
2 votes

Decipher a squashed sequence

R, 66 bytes \(n)repeat for(i in 1:(T=T+1))if(n==Reduce(paste0,i:T))return(i:T) Attempt This Online!
user avatar
2 votes

Decipher a squashed sequence

Julia, 71 bytes ! =length *(s,a=1,b=a,j=join(a:b))=!j<!s ? s*a*-~b : j!=s ? s*-~a : a:b Attempt This Online! Takes a string as input and returns a range (...
user avatar
  • 4,894
1 vote

Decipher a squashed sequence

J, 37 bytes 0{<((=<@;\"1)#&,<\"1@])".\<@":@+/i.@# Try it online! Not much in the way of golfiness (and it could surely be ...
user avatar
  • 27.1k
2 votes

Decipher a squashed sequence

Python3, 142 bytes: f=lambda x,l=[]:l if''==x else max(w,key=len)if(w:=[f(x[k+1:],l+[int(x[:k+1])])for k,_ in enumerate(x)if l==[]or int(x[:k+1])==l[-1]+1])else w ...
user avatar
  • 2,976
6 votes

Decipher a squashed sequence

Brachylog, 8 bytes ~c.~⟦₂≠∧ Try it online! Takes an integer as input, which makes it atrociously slow, as concatenation on integers computes constraints on the ...
user avatar
  • 35.7k
3 votes

Decipher a squashed sequence

Vyxal, 10 8 bytes øṖ⌊'ḣtṡ⁼ Try it Online! Incredibly slow for some inputs, reasonable for others. Explained ...
user avatar
  • 21.9k
0 votes

Compress Jelly's code page

Pip, 216 bytes ...
user avatar
  • 30.3k
4 votes

Nest some addition

Flurry, 28 bytes ({}){{}{}}[{}{<><<>(){}>}]{} A language based on untyped lambda calculus is certainly the right tool here :) Takes input in the ...
user avatar
  • 62.7k
1 vote

Help me design an unfair laundry machine

Jelly, 20 bytes Œṗf³$ƑƇoؽœ&/L P!Ç€Ṁ Try it online! Unlike Vyxal, Jelly's multiset intersection appears to work properly. This is roughly \$O\left(2^{\left(\...
user avatar
  • 30.3k
1 vote

Compress Jelly's code page

Charcoal, 222 bytes ...
user avatar
  • 144k
0 votes

Not-Roman-Numeral Addition

05AB1E, 24 bytes ₄500тD;T5X)D.X:.vO.XS.vJ Try it online or verify all test cases. Explanation: ...
user avatar
3 votes

Nest some addition

PARI/GP, 47 bytes x->[[a,b]=[t=c^b,t^a]|c<-x[^b=!a=0]];(x[1]+a)*b Attempt This Online! A port of my Haskell answer. Takes input as \$[x_0,x_1,\dots,x_n]\$.
user avatar
  • 34.7k
3 votes

Doing a little trolling with the microwave timer

05AB1E, 12 bytes [=Ð_#тÖ40*>- I/O as integers. Outputs everything on a separated line to save bytes. Try it online or verify all test cases. Explanation: ...
user avatar
3 votes

Print all integers

Vyxal, 5 bytes {N…ꜝ… Try it Online! { # Forever... N # Negate … # Print ꜝ # ~ … # Print
user avatar
  • 30.3k
3 votes

Nest some addition

Haskell, 54 bytes x#y|(a,b)<-foldl(\(a,b)c->(c^b,(c^b)^a))(0,1)y=(x+a)*b Attempt This Online! Takes input as \$x_0 \# [x_1,\dots,x_a]\$. Abusing the notation,...
user avatar
  • 34.7k
1 vote

Fibonacci polynomials

Desmos, 62 41 bytes L=[n...0] f(n)=mod(L+n,2)nCr((n+L-1)/2,L) Function f outputs a list of coefficients in descending order, ...
user avatar
  • 4,449
1 vote

Doing a little trolling with the microwave timer

Perl 5 -n, 48 bytes do{say"@F";@F=("@F"-1,59)if!$F[1]--}while"@F">=0 Try it online! Minutes ...
user avatar
  • 12.5k
9 votes

Fix my FizzBuzz

Vyxal, 21 15 bytes ṖÞ∞ƛ₍₃₅T∨;ÞS$↔h Try it Online! Why use clever mathematics when you can just generate infinite FizzBuzz? -6 thanks to Steffan and emanresuA ...
user avatar
  • 21.9k
1 vote

Doing a little trolling with the microwave timer

Pyth, 18 bytes WsQQ=?eAQ,GtH,tG59 Try it online! Doesn't include [0,0] ...
user avatar
  • 6,897
2 votes

Compress Jelly's code page

JavaScript (Node.js), 385 bytes ...
user avatar
  • 29.1k
5 votes

Fix my FizzBuzz

J, 54 bytes (-:&(/:~)"1#])#]\1((,~{~0=])2-@#.0=5 3|])@+#i.@+9>.>./ Try it online! _1, _2, _3 represent Fizz, Buzz, FizzBuzz. Generate all integers ...
user avatar
  • 27.1k
3 votes

Doing a little trolling with the microwave timer

Curry (PAKCS), 40 bytes n#m=(n,r m)?(r$n-1,r 59) r n=anyOf[0..n] Try it online! This is a non-deterministic function whose return values are the all the ouputs.
user avatar
  • 34.7k
1 vote

ro1000an nu1000era50 en100o501ng

C (gcc), 150 159 152 137 bytes +9 to handle either case -7 thanks to emanresu A -15 thanks to ceilingcat Processes a string, looking for Roman numerals. If it finds one, the value is added to the ...
user avatar
  • 3,977
2 votes

Doing a little trolling with the microwave timer

Retina 0.8.2, 79 74 bytes \d+ $* \G1 1$'¶ 1>`:.* :59$* %(r`1\G ¶$`1 O^` (1*):(1{10})*(1*) $.1:$#2$.3 Try it online! Takes input in ...
user avatar
  • 144k
2 votes

Doing a little trolling with the microwave timer

J, 25 24 bytes (,.i.,])(,,/)60,"0/&i.~[ Try it online!
user avatar
  • 27.1k
7 votes

"Hello, World!"

Objective-Java*#++--Script.NETnotation.sh, 18 bytes. Hello,\ World!.exe Try it online! How it works: ...
user avatar
  • 101
4 votes

Compress Jelly's code page

Vyxal D, 201 bytes (UTF-8) ...
user avatar
  • 30.3k
2 votes

Doing a little trolling with the microwave timer

Javascript, 49 bytes let g=a=>([b,c]=a,(b+c)?[g([b-!c,c?c-1:59]),a]:a) A recursive function that takes in an array like ...
user avatar
3 votes

Compress Jelly's code page

Jelly, 170 bytes ...
user avatar
3 votes

Doing a little trolling with the microwave timer

C (GCC), 78 bytes main(h,m){for(scanf("%d%d",&h,&m);h+m;m?--m:--h&(m=59))printf("%d %d\n",h,m);} Attempt This Online!
user avatar
  • 1,916
7 votes

Compress Jelly's code page

Modified Regenerate -a --sep=, 228 bytes ...
user avatar
  • 30.3k
1 vote

How long is it in Roman

Stax, 10 bytes ì¿≥Θu^Z6ê) Run and debug it
user avatar
  • 10.1k
1 vote

Flood fill by distance

Julia, 97 bytes h(X,r=1,c=1,d=0)=try d<X[r][c]&&(X[r][c]=d;for i=[5,7,1,3] h(X,r+i÷3-1,c+i%3-1,d+1)end)catch;end Attempt This Online! representation: ...
user avatar
6 votes

Doing a little trolling with the microwave timer

C (gcc), 43 bytes f(n){printf("%d ",n);n&&f(n%100?n-1:n-41);} Try it online!
user avatar
  • 15.8k
6 votes

Compress Jelly's code page

Python, 404 bytes J="̇".join A="abcdefghilmnoprstwxyz" a=A.replace I,x,y="ị̇" c=a("w","uvw") for r in"cfgpx":c=c.replace(r,"") C=...
user avatar
  • 20.9k
3 votes

Am I being run backwards?

Make, 14 15 bytes x:# #$@$# #:y Try it online! Updated to add a trailing tab on the second line... Here's another one that's not as short, but seems ...
user avatar
  • 1,939
3 votes

Doing a little trolling with the microwave timer

HBL, 15.5 bytes 1'.(?,('?.(-,)).('?(-.)(-'-*))? Takes the minutes and seconds as separate arguments to the main program; outputs a list of two-number lists. Try it ...
user avatar
  • 32.4k
1 vote

I reverse the source code, you negate the output!

HBL, 1 byte +< Run forwards, outputs 4: + Increment < Three Run backwards, ...
user avatar
  • 32.4k
4 votes

Compress Jelly's code page

Vyxal d, 246 bytes ...
user avatar
  • 6,070
2 votes

Compress Jelly's code page

Jelly (trivial), 2 bytes ØJ Try it online! ØJ: Yield Jelly's codepage.
3 votes

Doing a little trolling with the microwave timer

Brainfuck, 36 bytes ,+>,+<[->[-<.>.]>----[<+>----]<---<] Try it online! There are no separators and output is just ...
user avatar
  • 617
1 vote

Am I being run backwards?

HBL, 1 byte +2 Run forwards, outputs 3: + Increment 2 Two Run backwards, outputs ...
user avatar
  • 32.4k
1 vote

Is this a strange pond?

Python3, 264 bytes: ...
user avatar
  • 2,976
1 vote

Doing a little trolling with the microwave timer

Factor + math.unicode pair-rocket, 60 bytes [ [ .s dup last 0 = 1 => -59 "\0"? v- dup Σ 0 > ] loop . ] Try it ...
user avatar
  • 10.1k
1 vote

ro1000an nu1000era50 en100o501ng

Python, 130 122 bytes -8 bytes by porting Arnauld's formula ...
user avatar
  • 6,897

Top 50 recent answers are included