Bubbler
  • Member for 3 years, 9 months
  • Last seen this week
  • UTC+9
3 answers
32 votes
3k views
Minimally destroy CGCC in Game of Life
Accepted answer
45 votes

Score 1, 35 generations Sorry, but I guess I wrecked the challenge. I brute-forced all meaningful one-dot additions by hand, and found no other answer that wins against this. Raw ASCII format OOO ...

View answer
17 answers
52 votes
16k views
Biggest Irreducible Hello World
35 votes

APL (Dyalog Unicode), \$ \approx (10 \uparrow)^{625} 10.024549 \gg 10 \uparrow \uparrow 626 \$ bytes ⎕UCS(13⌿*⌿2+|⊃⎕RL⊣⎕RL←⍪⍨1)⊤≢⍬⍬⍬... The exact byte count is $$ \text{byte count before zilde} + \...

View answer
10 answers
26 votes
3k views
The square root of the square root of the square root of the…
24 votes

APL (Dyalog Unicode), 39 bytes +/⊢{∨/⍺⍵<⍵0:0⋄⍺=0:1⋄+/∊∇¨/⍺(⍵*2)-⊂⍳⍺}¨⍳ Try it online! A tacit function containing an inner dfn to use recursion. Does not use floating point numbers at all. How it ...

View answer
11 answers
19 votes
4k views
Ethan Finds the Maximum Element
Accepted answer
21 votes

APL (Dyalog Unicode), 5 3 bytes ⍳⊥× Try it online! Adám gave me an inspiration to golf this further. How it works ⍳⊥× Monadic train. Input: n, the length of array A. × v: Signum, which always ...

View answer
9 answers
22 votes
1k views
Count the Collatz survivors mod 2^n
20 votes

APL (Dyalog Unicode), 18 bytes +/∧/¨1<×\¨.5+,⍳⎕/2 Try it online! A full program. Fails to compute the answer for \$k>15\$ due to system limitations (rank of intermediate array). How it works ...

View answer
3 answers
31 votes
1k views
The cell at the end of the rainbow
17 votes

54 Bytes ------[>+++<--]>[->----[-[->+<]<[->+<]>>]<]>>>>>>>>>>. 119 x 252 = 29988. Straightforward nested loop. I used this tool to ...

View answer
6 answers
44 votes
6k views
Build a Turing *incomplete* language
16 votes

APL (Dyalog Unicode), 15 14 bytes (⍎⍞~'⎕⍎⍣⌶?{')⎕ Try it online! A full program that takes two inputs (an array of numbers in APL syntax, and then a line of APL code) from STDIN and prints the ...

View answer
12 answers
26 votes
2k views
Rows of the Collatz tree
15 votes

K (ngn/k), 37 35 bytes {x#x(,/{(4=6!x*4<x)(-6!)\2*x}')\,1} Try it online! How it works "n is even and (n-1)/3 is an integer" is equivalent to "n is 4 mod 6". Avoiding the ...

View answer
6 answers
-12 votes
528 views
You failed everything!
15 votes

Polyglot, 0 bytes This is a list of languages where an empty program gives an error. C/C++/Objective-C: Any compiler will complain not having a main, and emit a link error. C (gcc), C (tcc), C (...

View answer
16 answers
17 votes
1k views
Weight of the Least Weighted RoD Path
15 votes

J, 42 bytes v(+}.<.}:)&.>/@{.[:</.(2#v=._1+1#.$){.!._] Try it online! How it works v(+}.<.}:)&.>/@{.[:</.(2#v=._1+1#.$){.!._] v=._1+1#.$ ...

View answer
2 answers
11 votes
4k views
Creating a function over multiple lines
15 votes

35 Lines f= 0[ c= '\ c\ o\ n\ s\ t\ r\ u\ c\ t\ o\ r' ][ c] ` r\ e\ t\ u\ r\ n\ '\ b\ a\ r\ b\ a\ r\ i\ a\ n' ` Try it online! Uses the fact that 0 is a number, the constructor of 0 is Number, and ...

View answer
21 answers
18 votes
2k views
Implement the Torian
14 votes

Jelly, 6 bytes R×\⁸¡Ṫ Try it online! APL (Dyalog Unicode), 10 bytes {⊃⌽×\⍣⍵⍳⍵} Try it online! The main trick is to observe how the computation of x!y progresses as y increases. 1!0=1 2!0=2 ...

View answer
25 answers
24 votes
1k views
Multiply elements of the dihedral group
14 votes

J, 23 bytes ~:/I.@,~4|[:-/1#;._1@,] Try it online! Takes a boolean vector where 0 represents r and 1 represents s, and returns the result in the same encoding. How it works Imagine evaluating the ...

View answer
23 answers
30 votes
9k views
R.E.P.A.I.R. T.H.E. K.E.Y.B.O.A.R.D
14 votes

Labyrinth, score 35, 180 bytes 6 54.@ 7 55.@ 8 312.@ 9 313.@ 0 !@ - 45.@ = 1341.@ y 121.@ u 1141.@ i 2153.@ o 111.@ p 112.@ [ 1115.@ ] 2141.@ h 2152.@ j 2154.@ k 1131.@ l 1132.@ ; 315.@ ' 551.@ \ 4444....

View answer
19 answers
23 votes
2k views
Quoted rational numbers
14 votes

J, 25 bytes (%-.)~/@(10^#&>)#.10#.&>] Try it online! Takes a boxed 2-item vector containing the digit vectors of \$x\$ and \$y\$, and returns a rational number. The digits must be given ...

View answer
15 answers
16 votes
552 views
Repetend length in 1/n
14 votes

Jelly, 6 bytes R⁵*%i1 Try it online! Basically compute 10**[1..n] % n and get the 1-based index of 1.

View answer
1 answers
21 votes
897 views
How should I tile my kitchen?
14 votes

APL (Dyalog Unicode), 193 bytes {G←{⍵⊃⍨⊃⍋(+/' '=,)¨⍵} G{s←,30-⍳,⍨61 G,⊢∘⊂⌺30 30⊢((≢a)/⍪' '~⍨,x)@(B∘.+a)⊢''⍴⍨(⍴b)+⊃⌈/a←(⊢-⌊/)(⊃+/)¨s×⊂⍵}¨o/⍨(⍱/X∊⍨+/,-/)¨o←,∘.,⍨⊂¨∪{⍵/⍨0<2⊥¨×⍵}(,B∘.-⍸b<(1∊⊢)⌺3 3⊢...

View answer
24 answers
26 votes
2k views
Antisymmetry of a Matrix
14 votes

APL (Dyalog Unicode), 3 bytes -≡⍉ Try it online! This is exactly an APLcart entry on "antisymmetric". Basically it checks if the input's negative - matches ≡ the input's transpose ⍉.

View answer
20 answers
24 votes
3k views
Solve a 2xN Maze
14 votes

APL (Dyalog Unicode), 8 bytes ∧/⍲⌿2∨/⎕ Try it online! Takes input from stdin as a 2-row boolean matrix, where 1 is a wall and 0 is a space. Prints 1 for true, 0 for false (which are the only truthy/...

View answer
21 answers
23 votes
2k views
Prisoner's Dilemma with access to opponent
14 votes

BoomBot function boom(them) { throw 1; } If the opponent is run first and calls this without try..catch, this bot automatically wins 3 points. Zero points in any other case.

View answer
5 answers
14 votes
921 views
Non-sums of distinct positive powers
13 votes

APL(Dyalog Unicode), 26 bytes SBCS ⊢{z~∊(⊢,+)\⍺*⍨z←⍳!⍵}!×2*×⍨ Try it on APLgolf! This only works theoretically in multiple ways. The upper bound used (factorial of c = n! * 2^(n^2)is way too high to ...

View answer
1 answers
14 votes
955 views
How to golf a fork in Haskell?
13 votes

18 bytes (flip.).(.).((.).) Try it online! Since your function has no argument repetition and no argument deletion, it essentially becomes a BC calculus golf (in Haskell terms, a golf using just B=(....

View answer
40 answers
29 votes
3k views
Is this a Permutation of 1..n
13 votes

J, 7 bytes -:/:@/: Try it online! Ninja'd by hyper-neutrino :( Takes zero-based input. Applying Grade Up twice to a vector gives a "ranking" of each element, so that 0 is the smallest, 1 is ...

View answer
8 answers
18 votes
1k views
Sum of set bits from 1 to n
13 votes

K (ngn/k), 45 32 bytes {+/b*1+(q!'x)+-2!q*<q:2/=#b:2\x} Try it online! Golfing ideas thanks to @ngn and @coltim The OEIS page contains a curious PARI program: a(n)=if(n==0,0,m=logint(n,2);r=n%2^m;...

View answer
38 answers
29 votes
2k views
Jelly's Untruth
13 votes

APL (Dyalog Extended), 3 bytes ׯ⍸ Try it online! A tacit function. Banning only the exact built-in actually gives APL a massive advantage! How it works ׯ⍸ ⍸ ⍝ Takes a vector v and gives another ...

View answer
41 answers
26 votes
6k views
All you have to do is print the number 1! ...Twice
13 votes

APL (Dyalog Unicode), 2x2 bytes *0 +1 Try it online! *0 computes e^0, and +1 computes complex conjugate of 1. *0 has Unicode codepoint 42 and 48, and +1 has 43 and 49, so the two are different by ...

View answer
17 answers
39 votes
3k views
Overlapping Polyglots
13 votes

Hexagony, Klein (101) and ??? xx={puts/} gets87!@xx=p main\ >9.*5,6v This prints 7 in Hexagony, 8 in Klein (101), and 9 in ???. The 9 does not work if a newline is added at the end of the ...

View answer
12 answers
21 votes
2k views
Greedy queens sequence
12 votes

APL (Dyalog Unicode), 38 bytes 1+{⍵,⊃⍸|⊃×/×(⌽⍳≢⍵)(⊢×+×-)⍵-⊂⍳3×≢⍵}⍣⎕⊢⍬ Try it online! Kinda port of tsh's JS and Python answers. They actually need some explanation of why it works, rather than how. ...

View answer
33 answers
28 votes
2k views
Mr. Binary Counterman
12 votes

J, 12 bytes +2*/:<.&/:\: Try it online! Explanation: Self plus twice the minimum of ascending and descending ranks. Given a boolean array 1 1 0 0 1 1 1, ascending rank /:@/: and descending ...

View answer
63 answers
90 votes
11k views
xkcd 2385 KoTH (Final Exam)
12 votes

Calculus { name: "Calculus", isFirstTurn: true, run(scores) { let ret = this.isFirstTurn ? 70 : (100 + (average(scores)) * 0.8) / 2; this.isFirstTurn = false; return ret; ...

View answer
1
2 3 4 5
25