2022 Developer Survey is open! Take survey.
46 votes

Scroll Word's font size selector

Word VBA, 199 147 126 116 102 100 87 85 Bytes Why emulate when you can do?! Declared function in the ThisDocument module that takes input ...
user avatar
44 votes

Stretching Words

Brainfuck, 46 45 (63 with printable characters in input) Compatible with Alex Pankratov's bff (brainfuck interpreter used on SPOJ and ideone) and Thomas Cort's BFI (used on Anarchy Golf). The ...
user avatar
30 votes

Bit run rundown

Python 2, 46 45 bytes f=lambda n,k=1:`k`in bin(n^n/2)and-~f(n,k*10) Try it online! How it works By XORing n and n/2 (dividing by 2 essentially chops off the ...
user avatar
  • 206k
29 votes

Speed of Lobsters

convey, 59 47 bytes { ?;\,&:1< v^<^ ,<$1 "=>^}"@"} >">>#=" '*'>:<=0 Try it online! Run with ...
user avatar
  • 11k
28 votes

Is there a single straight line in the matrix?

Python 2, 49 bytes Takes as input a 2D binary matrix \$ a \$, and its size \$ n \$. lambda a,n:sorted(map(sum,a+zip(*a)))[-2:]==[1,n] Try it online! There may be ...
user avatar
  • 16.9k
25 votes

Universal Spooky Meme Translator

Ruby, 50 44 43 bytes FGITW answer. Gotta go fast! Thanks to @Neil for saving 6 bytes. Oh right, crossed out 44 is still 44 ...
user avatar
  • 11.4k
24 votes

Make me a metasequence

Wolfram Language (Mathematica), 34 bytes 0~Range~19~Binomial~i~Sum~{i,0,#}& Try it online! The tier \$n\$ metasequence is the sum of the first \$n+1\$ ...
user avatar
  • 32.8k
19 votes

Make me a metasequence

Haskell, 34 bytes (iterate(init.scanl(+)1)[1..20]!!) Uses 0-indexed inputs (f 4 returns tier 5.) Haskell, 36 bytes ...
user avatar
  • 65.5k
17 votes

Bit run rundown

Python 2, 46 bytes f=lambda n,r=1:max(r,n and f(n/2,1+~-n/2%2*r)) Try it online Extracts binary digits from n in reverse by ...
user avatar
  • 137k
17 votes

What's my TIO uniqueness?

JavaScript (Node.js),  819  779 bytes Returns 0 for undefined TIO uniqueness. ...
user avatar
  • 166k
17 votes

Longest Zero Sum Sub-array

Python 3, 47 bytes f=lambda x,*a:f(*a,x[1:],x[:-1])if sum(x)else x Try it online! It's simple breadth-first search, implemented recursively. The ...
user avatar
  • 16.9k
16 votes

Speed of Lobsters

JavaScript (ES6), 35 bytes Expects (haystack)(needle), where haystack is a list of characters and ...
user avatar
  • 166k
15 votes

Universal Spooky Meme Translator

Perl, 36 34 bytes s/\d+/"0|$&$^I"=~s#\^#**#r/gee The source code is 30 bytes long and it requires the switches -pi (+4 ...
user avatar
  • 206k
15 votes

All the k-mers/n-grams

Jelly, 1 byte Jelly has a single byte dyadic atom for this very operation Try it online! (the footer splits the resulting list with newlines, to avoid a ...
user avatar
14 votes

Stretching Words

CJam, 15 bytes rr{_C#)/(C@s}fC Try it online. How it works ...
user avatar
  • 206k
14 votes

Bit run rundown

05AB1E, 6 bytes b.¡€gM Try it online! Explanation ...
user avatar
  • 51.7k
14 votes

Even sum subarrays

Python 3.8 (pre-release), 57 bytes f=lambda S,p=1:S>[]and f(S[1:])+sum((p:=p^s%2)for s in S) Try it online! Similar to brute-force method below but should have ...
user avatar
  • 5,810
14 votes

Check if the string is reshaped

Retina, 10 bytes ^(.+).*\1$ Try it online! Works in any flavor of regex that supports backreferences.
user avatar
  • 15.2k
14 votes

Output every sublist ... eventually

Haskell, 31 27 bytes -4 bytes thanks to Wheat Wizard! Takes an infinite list as input and returns each finite sublist an infinite number of times. ...
user avatar
  • 53.4k
13 votes

Is it a circumfix?

J, 23 21 20 bytes >&#*]e.1}:@}.-&#]\.[ Try it online! -1 byte thanks to Bubbler Return true if: >&# left ...
user avatar
  • 26.6k
13 votes

cadaddadadaddddaddddddr - linked list accessing

JavaScript (V8), 48 bytes a=>f=b=>b[2]?b[[x,...r]=f(b.slice(1)),1]<f?x:r:a Try it online! -2 bytes thanks to @Arnauld!
user avatar
  • 11.1k
13 votes

Is there a single straight line in the matrix?

Brachylog, 8 bytes {z|}≡ᵛ+1 Try it online! ...
user avatar
12 votes

Bring out the inner llama of a sentence

Perl, 52 bytes The solution is provided as function that takes the string as argument and returns a list of positions. One-based positions, case-sensitive search, without newlines: 52 bytes ...
user avatar
12 votes

Bring out the inner llama of a sentence

sed, 299+1 Yes, sed can find a llama. No, sed can't do math. This is the longest answer so far, at 299+1 characters, because I had to teach sed to count. This answer requires a sed with extended ...
user avatar
  • 2,805
12 votes

Stretching Words

C, 62 bytes f(char*s,char*c){while(*s-*c||putchar(*c++),*s)putchar(*s++);} Well, this is surprisingly competetive. We define a function ...
user avatar
  • 5,342
12 votes

Fractal Smoke Sequence

Python 2, 95 bytes l=[];n=input() exec"a=min(set(range(n))-{2*b-c for b,c in zip(l,l[1::2])});print-~a;l=[a]+l;"*n The main trick is in generating the ...
user avatar
  • 137k
12 votes
Accepted

Sum of Binary Substrings

Jelly, 10 7 bytes BṡRḄFS_ Try it online! How it works ...
user avatar
  • 206k
12 votes

Subsequence Substitution

Python 2, 88 bytes def f(a,b,c,o=""): for q in a:x=q==b[:1];o+=c[:x]or q;b=b[x:];c=c[x:] print[o,a][c>''] A function that takes in the three strings and ...
user avatar
  • 60.9k
12 votes

Scroll Word's font size selector

JavaScript (ES6), 103 101 bytes Takes input as an array of -1 / 1. ...
user avatar
  • 166k

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