New answers tagged

1 vote

Auto-golf an esolang

Jelly, 45 bytes ¹©ṃ“D;ɼṛ6“+7“ṚḌ“D1;Ḍ%”Ṛv@ƒ6ṛ®ḊḌ⁼ 1ç1#ṃ“!+~%”U Try it online! A pair of links called as a monad with an integer argument and returning a string ...
Nick Kennedy's user avatar
  • 19.4k
0 votes

Night hike partitioning

Perl 5 -MList::Util=uniq -F, 114 bytes ...
Xcali's user avatar
  • 13.4k
1 vote

Auto-golf an esolang

Haskell, 165 bytes ...
matteo_c's user avatar
  • 5,883
3 votes

Auto-golf an esolang

05AB1E, 47 bytes "%!+~"∞5в0δKÙ.Δ´6svyiˆ6ëÐÂr1ìs%s7+)yè}}ˆ¯JQ}1ªè Brute-force, so pretty slow. Outputs as a list of characters. Try it online or verify ...
Kevin Cruijssen's user avatar
1 vote

Auto-golf an esolang

Charcoal, 79 65 bytes ⊞υ⟦ω⁶ω⟧Fυ¿¬ⅈ¿¬⌕ιθ⊟ι«≔§ι¹ηF⪪⟦η⁻⁶η!ω⁷+ω⁻⮌ηη~ω∧η⁻﹪XχLηηη%⟧³⊞υEκ⁺λ§ιμ Try it online! Link is to verbose version of code. Explanation: Based on @...
Neil's user avatar
  • 166k
2 votes

Auto-golf an esolang

JavaScript (Node.js), 121 119 bytes f=(n,a='',b,c=6,...s)=>n!=b?f(n,...s,a+'+',b,c+7,a+'-',b,+[...c+''].reverse().join``,a+'%',b,('1'+c)%c,a+'!',[b]+c,6):a Try ...
l4m2's user avatar
  • 20.7k
4 votes

Auto-golf an esolang

JavaScript (ES6), 139 bytes -1 thanks to @l4m2 Expects the target integer as a string. ...
Arnauld's user avatar
  • 189k
1 vote

Print 100 digits of Champernowne's Constant

05AB1E, 5 3 bytes 1т× -2 bytes porting @Tbw's APL answer. Outputs at 0-based index \$55555555555555555555555555555555555555555555555555551\$. Try it online. ...
Kevin Cruijssen's user avatar
2 votes

Auto-golf an esolang

Python, 158 bytes simple brute force approach, takes input as a (decimal) string ...
bsoelch's user avatar
  • 5,865
2 votes

What's the character limit of this text field?

Python 3, 55 bytes lambda s:"".join(map(str,range(1,1001))).find(s)+len(s) This is a rather simple solution, but it works.
Jakav's user avatar
  • 191
2 votes

Print 100 digits of Champernowne's Constant

Vyxal H, 14 bitsv2, 1.75 bytes 1ẋ Try it Online! Bitstring: 01000010111110 Prints ...
Pacmanboss256's user avatar
1 vote

Print 100 digits of Champernowne's Constant

GolfScript, 6 bytes 55,(;5 Try it online! Prints the first 100 digits. ...
noodle man's user avatar
  • 5,557
2 votes

Print 100 digits of Champernowne's Constant

///, 17 bytes /10/00000001/1100 Try it online! Outputs 98 0s followed by 2 1s, which ...
m90's user avatar
  • 9,881
4 votes

Print 100 digits of Champernowne's Constant

brainfuck, 23 bytes -[----->+>+<<]>-[->..<] Try it online! Outputs 100 3s, which appears at index ...
m90's user avatar
  • 9,881
1 vote

What's the character limit of this text field?

Japt, 9 bytes +A³õ ¬ aN Try it
Shaggy's user avatar
  • 41.6k
3 votes

Print 100 digits of Champernowne's Constant

Charcoal, 6 bytes ⭆⁵⁰⁺χι Try it online! Link is to verbose version of code. Starts at index 9. Explanation: Loops over the ...
Neil's user avatar
  • 166k
4 votes

Print 100 digits of Champernowne's Constant

APL (Dyalog Classic), 7 bytes 100⍴'1' Try it online! Prints 1, one hundred times. Similar approach to @Jonathan Allan and others. First appears as ...
Tbw's user avatar
  • 271
2 votes

Print 100 digits of Champernowne's Constant

APL+WIN, 11 10 bytes i byte saved thank to Tbw A function taking no arguments with output from index 2 with index origin = 1 1↓⊃,/⍕¨⍳55 Try it online! Thanks to ...
Graham's user avatar
  • 5,526
7 votes

Print 100 digits of Champernowne's Constant

C, 41 bytes main(i){for(i=9;i++<59;)printf("%d",i);} Goes through numbers 10 to 59 (indexes 9 to 108), printing exactly 100 digits (without a newline)....
segfaultdev's user avatar
9 votes

Print 100 digits of Champernowne's Constant

Jelly,  4 3  2 bytes ³Ṭ A full program that accepts no arguments and prints a list of one hundred consecutive places starting at the 0-indexed index (you may need ...
Jonathan Allan's user avatar
4 votes

Print 100 digits of Champernowne's Constant

Jelly, 6 bytes 2r55DF Try it online! Starts at index 1 (digit 2 in the number 2). Range from 2 to 55 and then the decimal ...
hyper-neutrino's user avatar
  • 41.3k
3 votes

What's the character limit of this text field?

Charcoal, 10 bytes I⁺Lθ⌕⭆φ⊕ιθ Try it online! Link is to verbose version of code. Explanation: ...
Neil's user avatar
  • 166k
2 votes

What's the character limit of this text field?

APL (Dyalog Classic), 22 bytes ≢-1-(⊃∘⍸⍷∘(⊃,/⍕¨⍳1E3)) Try it online! ...
Tbw's user avatar
  • 271
2 votes

What's the character limit of this text field?

Pip, 10 bytes Semi-port of lyxal's Vyxal answer J1,a~:Xa$) Attempt This Online! ...
math scat's user avatar
  • 8,563
3 votes

What's the character limit of this text field?

APL+WIN, 35 33 bytes Two bytes saved thanks to Tbw Prompts for string of digits: ↑(¯1+⍴s)+((s←,⎕)⍷n)/⍳⍴n←⊃,/⍕¨⍳1E3 Try it online! Thanks to Dyalog Classic
Graham's user avatar
  • 5,526
0 votes

Collatz, Sort, Repeat

Haskell, 96 bytes (x:w)#h|x<=h!!0=x:w#h x#y=y#x g x=[div i 2|i<-x,even i]#[3*i+1|i<-x,odd i] f 0=[1..] f n=g$f$n-1 Try it online!
matteo_c's user avatar
  • 5,883
4 votes

What's the character limit of this text field?

Haskell, 65 63 bytes -2 bytes thanks to @AZTECCO n%h|l<-length n,n==take l h=l n%(_:h)=1+n%h f=(%([1..]>>=show)) Try it online!
matteo_c's user avatar
  • 5,883
4 votes

What's the character limit of this text field?

Perl 5 (-p), 27 bytes (join"",1..1e3)=~$_;$_="@+" Try it online!
Nahuel Fouilleul's user avatar
6 votes

What's the character limit of this text field?

Excel (ms365) 1) Recursion with LAMBDA(), 74 bytes: Formula in B1: ...
JvdV's user avatar
  • 3,413
3 votes

What's the character limit of this text field?

Retina 0.8.2, 38 bytes ^ 1001$*1¶ \G1 $.` r`\B\1.*¶(.*) $1 \B Try it online! Link includes test cases. Explanation: ...
Neil's user avatar
  • 166k
5 votes

What's the character limit of this text field?

Ruby, 34 30 bytes ->i{[*1..1e3]*''=~/(?<=#{i})/} Try it online! Thanks to @Neil for saving 1 Byte by removing useless + in regexp Regexp /(?<=#{i})+/ ...
AZTECCO's user avatar
  • 10.7k
5 votes

What's the character limit of this text field?

05AB1E, 7 bytes LJIkIg+ Times out for larger inputs. Add a leading (push 1000) to speed it up. Try it online or verify all ...
Kevin Cruijssen's user avatar
5 votes

What's the character limit of this text field?

JavaScript (Node.js), 43 bytes x=>~(g=s=>~s.indexOf(x,1)||g(s+i++))(x,i=1) Try it online! Using range, fail 11 (expect ...
l4m2's user avatar
  • 20.7k
5 votes

What's the character limit of this text field?

Vyxal, 50 bitsv2, 6.25 bytes ⌊ɾṅḟ?L+ Try it Online! Bitstring: 11001011010011010000000111000101111000110100000010 Times out ...
lyxal's user avatar
  • 32.3k
2 votes

Night hike partitioning

JavaScript (Node.js), 96 bytes ...
l4m2's user avatar
  • 20.7k
3 votes

Night hike partitioning

JavaScript (ES6), 106 bytes -1 thanks to @l4m2 Expects a string with leading 1's for X's and trailing ...
Arnauld's user avatar
  • 189k
3 votes

Night hike partitioning

Jelly, 15 bytes I'm very prepared for a smarter approach to trounce this! Œ!ŒṖ€ẎṢ€ṢẸƇƊƑƇQ A monadic Link that accepts a list of zeros (no torch) and ones (has ...
Jonathan Allan's user avatar
6 votes

Night hike partitioning

Nekomata, 6 bytes Ooᵐᵗžũ Attempt This Online! Takes input as a sorted list of 1s and 0s, ...
alephalpha's user avatar
  • 46.7k
1 vote

Night hike partitioning

Charcoal, 52 bytes ⊞υ⟦⟧FS«≔υθ≔⟦⟧υFθ«Fκ⊞υEκ⎇⁼ν⌕κλ⁺μιμ¿⁼ιX⊞υ⊞OκX»»Φυ⁼κ⌕υι Try it online! Link is to verbose version of code. Assumes the input contains ...
Neil's user avatar
  • 166k
4 votes

Night hike partitioning

05AB1E, 16 bytes œ€.œ€`€€{€{êʒ€àP I/O as a list of 1s/0s for ...
Kevin Cruijssen's user avatar
2 votes

The vanilla factorial challenge

Vyxal 3L, 2 bytes /* Try it Online! Fold / the input by multiplication *. Fold treats whole ...
noodle man's user avatar
  • 5,557
0 votes

Minimum excluded number

Z80 machine language, 11 bytes Base address of list in HL, length in BC. AF C5 E5 ED B1 E1 C1 C0 3C 18 F6 Returns with mex in A unless it's at least 256, then ...
NoLongerBreathedIn's user avatar
1 vote

Shift right by half a bit

JavaScript (Node.js), 31 bytes n=>(g=i=>i*i*2<n*n?g(++i):i)(0) Try it online! or BigInt version, anyway really large values impractical to run Brute-...
l4m2's user avatar
  • 20.7k
1 vote

Shift right by half a bit

Python 3.8 (pre-release), 40 bytes This one works with python integers, giving the correct result even for arbitrarily large integers. Always rounds down. ...
Stef's user avatar
  • 699
2 votes

Count without 3

Swift, 84 bytes func f(_ n:Int)->Int{var n=n+1;while String(n).contains("3")||n%3==0{n+=1};return n}
Annett Schwarze's user avatar
2 votes

Multiplicative persistence

05AB1E, 13 bytes ,[1svy*}Ð,gΘ# Try it online! Explanation: ...
Flummox's user avatar
  • 69
1 vote

Which skill to train?

Excel (ms365), 89 bytes Formula in G1: ...
JvdV's user avatar
  • 3,413
1 vote

Which skill to train?

Scala, 171 bytes A port of @matteo_c's Haskell answer in Scala. Golfed version. Try it online! ...
138 Aspen's user avatar
  • 4,855
1 vote

Which skill to train?

Python 3 (197 bytes) ...
Amir reza Riahi's user avatar
1 vote

Count without 3

Google Sheets, 63 bytes =+let(n,sequence(254),filter(n,n>A1,mod(n,3),iserr(find(3,n)))) Put the input in cell A1 and the ...
doubleunary's user avatar

Top 50 recent answers are included