2022 Developer Survey is open! Take survey.
15 votes

LOOOOONG TEEEEEXT

Vyxal d, 10 bytes ĠƛhA[h:d⇩+ Try it Online! Explained ...
user avatar
  • 21k
13 votes

Crossing a Lily Pond

BitCycle, 329 bytes BitCycle is certainly not an easy language to solve this in, despite the fact that its only form of data (streams of bits), easily represents the pattern of the lilypond in this ...
user avatar
  • 1,490
12 votes

Generate All 8 Knight's Moves

Wolfram Language (Mathematica), 25 bytes Solve[x^2y^2==4,Integers] Try it online! Outputs a list of {x -> x, y -> y}s.
user avatar
  • 15.2k
12 votes

Reverse hex cipher

Vyxal s, 5 bytes CHRHC Try it Online! Look ma, no unicode, and it's a palindrome! ...
user avatar
  • 27.3k
10 votes

LOOOOONG TEEEEEXT

Perl 5 -p, 29 bytes Now handles undoubling thanks to [@Jo King]! s/((?i)[aeiou])\1*/$1\L$1$1/g Try it online!
user avatar
  • 22.1k
10 votes

Eh, codegolf shmodegolf

sed, 29 bytes s/[^aeiou]*\([aeiou]\)/shm\1/ Try it online!
user avatar
  • 18k
9 votes

Generate All 8 Knight's Moves

Python, 30 bytes print((2*"2212-1-21-2-1")[2:]) Attempt This Online! A mashup of my previous and the trivial solutions. Python, 41 bytes a=1 for b in b"41030143":print(a,a:=b-50) ...
user avatar
  • 5,820
9 votes

Eh, codegolf shmodegolf

Jelly, 16 12 bytes œlØḄṭ⁸¹?“shm Try it online! -4 thanks to ovs remembering there's a strip builtin ...
user avatar
9 votes

Eh, codegolf shmodegolf

Haskell, 52 bytes snd.span(`notElem`"aeiou")>>=(?) ""?s=s r?_="shm"++r Try it online!
user avatar
  • 137k
8 votes

Find the nth Fibonacci number, where n is the mth Fibonacci number

Jelly, 4 3 bytes ÆḞ⁺ Attempt This Online! ÆḞ⁺ ⁺ # Twice: ÆḞ # Nth fibonacci -1 byte thanks to Unrelated String 05AB1E, 4 ...
user avatar
  • 4,086
8 votes

Divisible subset sums

Python 3, 54 bytes f=lambda n,k,r=0:n and f(n-1,k,r)+f(n-1,k,r-n)or r%k<1 Try it online!
user avatar
  • 15.2k
7 votes

LOOOOONG TEEEEEXT

Jelly, 15 bytes ŒgµŒlṁ3fØcȯaẆḢ) Try it online! ...
user avatar
7 votes

In between fractions

Husk, 20 12 11 bytes ḟ<⁰MS/ȯ→⌊*N Try it online! Generates an infinite list of fractions by going through each integer N as ...
user avatar
7 votes

I want 8 bits for every character!

Vyxal, 16 bytes b8∆Zf⁰LbLẇvBꜝ‹İ∑ Try it Online! ...
user avatar
  • 27.3k
7 votes

Generate All 8 Knight's Moves

J, 18 bytes (,+)@(1j2*0j1^i.4) Try it online! A function taking any input and returning the list we want as complex numbers. ...
user avatar
  • 26.6k
7 votes

Can a run ascending list be made?

Python 3, 106 bytes def f(a,n=-1,x=0):a[n]-=x;return~-any(a)^any(f(1*a,i,j+1)for i,k in enumerate(a)for j in range(x,k)if i-n) Try it online! Brute force search. ...
user avatar
  • 6,240
7 votes

Divisible subset sums

JavaScript (ES6), 40 bytes Expects (k)(n). k=>g=(n,s=0)=>n--?g(n,s)+g(n,s-~n):s%k<1 Try it online! Commented ...
user avatar
  • 166k
7 votes

Reverse hex cipher

Ruby, 26 bytes Accepts input from STDIN. $<.bytes{|c|putc c*257>>4} Try it online! Alternative 26s: ...
user avatar
7 votes

Eh, codegolf shmodegolf

sed, 25 bytes /[aeiou]/s/[^aeiou]*/shm/ Try it online! /[aeiou]/ is a conditional that only runs the substitution ...
user avatar
  • 1,739
6 votes

LOOOOONG TEEEEEXT

Python, 78 bytes lambda s:re.sub(r"([aeiouAEIOU])\1*",lambda m:m[1]+2*m[1].lower(),s) import re Attempt This Online! I don't read Perl unless under duress, but if would I'd have to note that ...
user avatar
  • 5,820
6 votes

LOOOOONG TEEEEEXT

Retina, 28 bytes ((?i)[aeiou])\1* $1$l$1$l$1 Try it online! Link includes test cases. Explanation: Port of @DomHastings' Perl answer, but Retina's ...
user avatar
  • 143k
6 votes

LOOOOONG TEEEEEXT

JavaScript (ES6), 63 bytes Repeats 3 times. s=>s.replace(/([AEIOUaeiou])\1*/g,([c])=>c+(c+c).toLowerCase()) Try it online!
user avatar
  • 166k
6 votes

Find the nth Fibonacci number, where n is the mth Fibonacci number

Factor + benchmark.fib3, 37 bytes [ [ 0 ] [ 1 - fib 1 - fib ] if-zero ] Try it online! Huh? Factor comes with a suite of ...
user avatar
  • 8,768
6 votes
Accepted

Implement FBLint

Python3, 2381 bytes: ...
user avatar
  • 2,500
6 votes

In between fractions

PARI/GP, 38 bytes f(a,b)=d=0;until(b*d++>n=a*d\1+1,);n/d Attempt This Online! Takes two fractions and outputs a fraction. For inputs \$a,b\$, let \$d\$ loops ...
user avatar
  • 32.9k
6 votes

Eh, codegolf shmodegolf

Stax, 11 bytes ÄFï¥░$º{═┘ç Run and debug it Left-trim consonants. If non-empty, prepend "shm". Else restore original input.
user avatar
  • 9,954
5 votes

Crossing a Lily Pond

Desmos, 85 62 bytes f(l,s)=max(0,sign(s-mod([1...l.length][l=0],s).unique.length)) -23 bytes thanks to Aiden Chow Try it on Desmos!
user avatar
  • 4,086
5 votes

LOOOOONG TEEEEEXT

05AB1E (legacy), 16 bytes γεDlžMÃĀiÙDlDJ]J Uses the legacy version of 05AB1E, because there is a bug in the new version with Ā (...
user avatar
5 votes

LOOOOONG TEEEEEXT

Python, 82 80 79 bytes lambda s,*e:''.join([c,(c+2*c.lower())*(e!=c)][(e:=c)in"AEIOUaeiou"]for c in s) Attempt This Online! First time realising that you can use the walrus operator (...
user avatar
  • 991
5 votes

LOOOOONG TEEEEEXT

Husk, 23 bytes ṁ?oS:oR2_←Iȯ€"AEIOU"a←g Try it online! ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible