Skip to main content
Share Your Experience: Take the 2024 Developer Survey
13 votes

Compute the degree of a string

JavaScript (ES6), 38 bytes Straightforward formula Expects an array of ASCII codes. a=>a.map(t=c=>t=-~t-(a+4-[a=c])%3)|t/3 Try it online! JavaScript (ES6), ...
Arnauld's user avatar
  • 193k
10 votes

Enumerate all matches of a regex

Python, 214 bytes ...
Bubbler's user avatar
  • 76.8k
9 votes

Decode a Caesar ciphertext with high probability

Charcoal, 31 bytes, 93.66%, score 33.1 ≔EβΣEθ∧№βλ№etaonis§β⁻⌕βλκηI⌕η⌈η Attempt This Online! Link is to verbose version of code. Outputs the shift ...
Neil's user avatar
  • 171k
8 votes

Enumerate all matches of a regex

JavaScript (Node.js), 72 bytes s=>{for(i=9n,t='';;t=i.toString(36))t.replace(s,i)==i++&&console.log(t)} Try it online!
l4m2's user avatar
  • 24.4k
7 votes

Enumerate all matches of a regex

Python + Regenerate, 49 46 bytes -3 bytes thanks to xnor from regenerate import* main(input(),[],1e999) Takes the regex from stdin and outputs all matches to ...
DLosc's user avatar
  • 39.5k
7 votes

Decode Caesar cipher based on a given text

Ruby, 31 29 bytes -2 bytes thanks to @AZTECCO! ->a,b,c{c.tr b+w='-ZA-Z',a+w} Attempt This Online!
ovs's user avatar
  • 59.5k
7 votes

Compute the degree of a string

Python 3.8 (pre-release), 50 bytes lambda a,*s:int(sum(-(a+~(a:=b))%3-1for b in s)/3) Try it online! -5 bytes thanks to Neil -5 bytes thanks to Albert.Lang Port ...
Jitse's user avatar
  • 7,216
7 votes

Compute the degree of a string

Cubical Agda, 1134 bytes Uses Agda 2.6.4.3, the cubical library 0.7 and the standard library 2.0. ...
Naïm Favier's user avatar
6 votes

How can I reduce the characters in the following python code?

Python 3.8 (pre-release), 46 bytes You can use exit instead of print to save 1 byte. This displays the same for me in a terminal running on Windows and displays the string in the Debug section in TIO....
ElPedro's user avatar
  • 6,459
6 votes

Decode a Caesar ciphertext with high probability

Vyxal, 10 bytes, 99.9%, score 10.01 ‡ka*݇øDL∵ Try it Online! Based on Jonathan Allan's idea of compressing the strings, this takes the rotation that's compressed ...
emanresu A's user avatar
  • 38.4k
6 votes

Cold Bee and Old Beer

Python 3, 59 bytes lambda d:[[i,j]for i in d for j in d-{i}if{i[1:],j[:-1]}<d] Try it online!
Mukundan314's user avatar
5 votes

HTML Table Parser

JavaScript (Node.js), 175 bytes ...
l4m2's user avatar
  • 24.4k
5 votes

Compute the degree of a string

Rust, 67 66 bytes |a|a[1..].iter().fold((0,a[0]%3),|(b,c),d|(b-(c+!d)%3-1,*d%3)).0/3 Attempt This Online! Now handles repeats
mousetail's user avatar
  • 12.6k
5 votes

Decode a Caesar ciphertext with high probability

Jelly, 19 bytes, \$94.65\%\$; score \$=\frac{10000\times 19}{9415}\approx 20.18\$ ØaṙJ,€¤y€ċⱮ“Ẉ²»S$ÞṪ A monadic Link that accepts the encrypted text and yields its ...
Jonathan Allan's user avatar
5 votes

Cold Bee and Old Beer

Jelly, 11 bytes œ!2ḊṖƭ€fƑ¥Ƈ Try it online! Don't love resorting to ƭ for this. ...
Unrelated String's user avatar
4 votes

Enumerate all matches of a regex

Python, 214 211 198 195 bytes -3 bytes thanks to emanresu A ...
DLosc's user avatar
  • 39.5k
4 votes

Enumerate all matches of a regex

Python + numpy, 94 bytes def f(s,i=0):re.sub(s,"",t:=numpy.base_repr(i,36).lower())or print(t);f(s,i+1) import re,numpy Attempt This Online! Uses the ...
corvus_192's user avatar
  • 5,304
4 votes

Decode Caesar cipher based on a given text

Jelly,  13  10 bytes -3 using transliterate as prompted by Kevin Cruijssen' answer O_/ḢØA,ṙ¥y A dyadic Link that accepts the known plaintext, ciphertext pair on ...
Jonathan Allan's user avatar
4 votes

Decode Caesar cipher based on a given text

05AB1E, 12 11 10 bytes ÇøÆнAu._Au‡ Inputs \$a,b,c\$ taken as two separated inputs in the format \$[b,a]\$ and \$c\$, where \$a\$ and \$b\$ are lists of characters. ...
Kevin Cruijssen's user avatar
4 votes

Compute the degree of a string

05AB1E, 13 11 bytes ÇÔ¥3%É·<O3÷ -2 bytes porting @LuisMendo's MATL answer, so make sure to upvote that answer as well! Input as a string. (If we're allowed to ...
Kevin Cruijssen's user avatar
4 votes

Compute the degree of a string

Jelly, 12 bytes _ƝNA¡€ṠS÷3r` A monadic Link that accepts a list of the walked vertices' ASCII codes/byte values and yields a singleton list containing the net ...
Jonathan Allan's user avatar
3 votes

Enumerate all matches of a regex

Perl 5 + -M5.10.0 -a, 30 bytes }{/^@F$/&&say;$_++;y/1/a/;redo Try it online!
Dom Hastings's user avatar
  • 23.8k
3 votes

English An or A?

Scratch, 69 bytes Run it here (The executing script does not need to be counted. Look inside and find the custom block for the code) ...
SectorCorruptor's user avatar
3 votes

Word Search Puzzle

R, 240 bytes ...
Pradeep Chaghran's user avatar
3 votes

"Hello, World!"

Lazy K, 564 bytes ...
Esolanging Fruit's user avatar
3 votes

"Hello, World!"

AWK, 18 bytes $0="Hello, World!" Try it online! AWK defaults to {print $0}. Pass/pipe this anything and it will just print "Hello, World!". <...
C K's user avatar
  • 71
3 votes

Enumerate all matches of a regex

Java 10, 120 bytes r->{var i=java.math.BigInteger.ONE;for(var t="";;i=i.add(i.ONE),t=i.toString(36))if(t.matches(r))System.out.println(t);} Port of @...
Kevin Cruijssen's user avatar
3 votes

Divisibility patterns

Python, 65 bytes lambda n,s:[(i//-~n*" ").join(s)[::i%-~n+1]for i in range(~n*~n)] Attempt This Online! Outputs in reverse order
corvus_192's user avatar
  • 5,304
3 votes

Divisibility patterns

Jelly, 11 bytes If it were required a byte could be appended to yield a flat list of the lines rather than a table TIO. ...
Jonathan Allan's user avatar
3 votes

HTML Table Parser

Charcoal, 144 bytes ...
Neil's user avatar
  • 171k

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