Posts by Marshall Lochbaum
BQN, 18 bytesSBCS 'A'-¬⊸⌊2×13-˜⌜○↕14 Run online! This solution computes a table of c-r, where r is the row number and c is the column number, so that the first row is 0 1 2… and the first colu...
BQN, 17 bytesSBCS {𝕩∾1𝕊⍟≠⌊𝕩⋆2|𝕩+÷2} Run online! BQN primitives alone can't express unbounded iteration, so this must be a recursive block function. {𝕩∾1𝕊⍟≠⌊𝕩⋆2|𝕩+÷2} # Function 𝕊 taking argu...
BQN, 24 bytesSBCS {g⊔⁼𝕊¨⍟(1<≠)𝕩⊔˜∧g←2|↕≠𝕩} Run online! {g⊔⁼𝕊¨⍟(1<≠)𝕩⊔˜∧g←2|↕≠𝕩} { } # Block function 𝕊 with argument 𝕩 ≠𝕩 # Length of 𝕩 ...
BQN, 19 bytesSBCS ' '+32⊸<⊸×+⌜˜⌽⊸⌊↕59 Run online! This uses the whitespace allowance, padding by four spaces on all sides to make the arithmetic work better. It can be adjusted by replacing...
BQN, 14 solutions (SBCS) Run online! This link shows the result of each expression and a table of character intersections. Each expression intersects with itself only, giving a diagonal matrix. Th...
BQN, 7 6 bytesSBCS ≢↑∘⊢´↕ Run online! The less-golfed version {↑⍟𝕩⟨⟩} is more readable: it applies Prefixes (↑) the given number of times to the empty list ⟨⟩ and… that's it. (Suffixes also wo...
BQN, 20 bytesSBCS ∾2/0‿8⊏↓"∾2/0‿8⊏↓""" Run online! BQN's strings escape double quotes by doubling them, so that the string used to start with only contains a single quote, although the output ...
BQN, 18 bytesSBCS {⊑(⊑𝕨⊸⍷)¨⊸/∾⟜𝕩¨↑𝕨} Run online! A direct translation of Razetime's APL solution (my attempted improvement ⊣∾{⊢´/𝕨⊸«⊸≡¨↑𝕩}↓⊢ turns out to be not at all correct). The BQN solut...
BQN, 32 bytesSBCS Run online! {∨´∾8(⥊(⊐⌾⥊𝕩)⍷·≠⌜˜2|/∘⥊)¨1+↕≠⥊𝕩} Brute force: tests against all boards up to the number of characters in 𝕩 using Find (⍷). Using the longest dimension is faster b...
Seems to be an issue with the ordering (across languages) when "Group by language" is set. When I first load the page, they are ordered with the most recent post first. If I then uncheck "Group by ...
BQN, 21 bytesSBCS (¬·×-+´·/0=↕⊸|)¨⊸⊔1+↕ Run online! Mostly one big train used to find the appropriate group for each number, to be used with Group (⊔). The combining functions in a train norma...
BQN, 8 bytesSBCS ⍒↕+2|⊢+↕ Run online! The solution itself is an 8-train, so its evaluation order is given by the sequence 7 5 6 3 4 1 2 0: first the rightmost ↕, then the ⊢, then the + between...
BQN, 25 bytesSBCS ⌊⊸≡(/0=↕⊸|){(+´÷≠)∘𝔽¨«⟜𝔽} Run online! This expression has a complicated structure. This link uses BQN's explain feature to show the order in which everything is applied. It's...
BQN, 8 bytesSBCS ∾⊒˜¨⊔○∾⊢ Run online! and parsing diagram The idea here is to build a list of groups, with group i containing the ith character of each string that has one, then join the group...
BQN, 15 bytesSBCS {𝕨(1+⊢𝕊-)⟜𝕩⍟>0} Run online! A block function that takes $t_1$ as the left argument 𝕨 and $t_2$ as the right argument 𝕩. In BQN, 𝕊 indicates recursion on the current block ...
BQN, 44 bytesSBCS +´{(≠↑𝕨-𝔽)⊸+2↓⊑∨(≍×𝕨≥⊢)○𝔽˜⟜×⊸∾¨(<1+𝕩)×⥊↕2¨𝕩} Run online! The solution is a function that takes n as the left argument (𝕨) and A as the right argument (𝕩). k is just the le...
BQN, 11 9 bytesSBCS Run online! 1⌽⍟⊢⍋3|↕9 The result is a length 9 list of lists using the numbers 0 to 8. The solution is based on the 3x3 transpose list 036147258, obtained with Grade Up. T...
Adding display:flex; align-items:center to .toc--full items centers the names and code samples vertically, which I think looks a little better.
BQN, 14 bytesSBCS ∾⟜•FMT"∾⟜•FMT" Run online! Assumes •FMT will format a string by placing it in quotes, which depends on the BQN system in use. After (⟜) applies its right operand •FMT to the ...
BQN, 33 bytesSBCS >(⌽(⊑¨55↑+˜⊸+⊔'0'+⌽⊸⌊⊸⌊)¨˜1↓↑)↕28 Run online! Minimum of barycentric coordinates placed according to a skew transformation on two of them. So, the min(i,j,27-i-j) thing pr...