Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Activity for Marshall Lochbaum‭

Type On... Excerpt Status Date
Comment Post #287055 The two cases `bbaabbaabbaabba` and `abbaabbaabbaabb` given as falsy do fit in 8 squares, shown by adding an `a` at the end of the first or beginning of a second. Are these shorter than intended?
(more)
over 1 year ago
Edit Post #287073 Post edited:
over 1 year ago
Edit Post #287073 Post edited:
over 1 year ago
Edit Post #287073 Post edited:
over 1 year ago
Edit Post #287073 Initial revision over 1 year ago
Answer A: Chequer checker
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 but would cost a byte. Not explained below, `⊐⌾⥊𝕩` applies Classify under Deshape to...
(more)
over 1 year ago
Edit Post #284198 Post edited:
Train to take advantage of the repeated 2
over 2 years ago
Suggested Edit Post #284198 Suggested edit:
Train to take advantage of the repeated 2
(more)
helpful over 2 years ago
Edit Post #282449 Post edited:
almost 3 years ago
Edit Post #282450 Initial revision almost 3 years ago
Answer A: Leaderboards are live
Adding `display:flex; align-items:center` to `.toc--full` items centers the names and code samples vertically, which I think looks a little better.
(more)
almost 3 years ago
Edit Post #282449 Initial revision almost 3 years ago
Answer A: Leaderboards are live
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 language" and check it again, they are ordered by byte count. These should be consistent. I'd prefer the...
(more)
almost 3 years ago
Edit Post #282442 Post edited:
almost 3 years ago
Edit Post #282442 Initial revision almost 3 years ago
Answer A: Create a Sudoku
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. This list is used to repeat the operation rotating itself by one. Since it's a self-inver...
(more)
almost 3 years ago
Edit Post #282251 Initial revision almost 3 years ago
Answer A: Are they abundant, deficient or perfect?
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 normally have two arguments, but Nothing (`·`) can be used on the left to not pass a left arg...
(more)
almost 3 years ago
Edit Post #282161 Initial revision almost 3 years ago
Answer A: Diagonalized alphabet
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 column is `0 ¯1 ¯2…`. After this it maps non-positive numbers `0 ¯1 ¯2…` to `A C E…`, ...
(more)
almost 3 years ago
Edit Post #282080 Initial revision almost 3 years ago
Answer A: Evaluation order of an APL n-train
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 them, and so on—it's fully expanded below. Although it's organized as a train, th...
(more)
almost 3 years ago
Edit Post #281600 Initial revision almost 3 years ago
Answer A: Juggler sequences
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 argument 𝕩 ÷2 # Reciprocal of 2 (one half) 𝕩+ # Plus ...
(more)
almost 3 years ago
Edit Post #281593 Initial revision almost 3 years ago
Answer A: Print the Great Numeric Pyramid
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 pretty much. The result is a character matrix. The three coordinates are height, distance ...
(more)
almost 3 years ago
Edit Post #281553 Initial revision almost 3 years ago
Answer A: Merge two strings
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 solution is much shorter mainly because it has Prefixes (`↑`) built in. Being able to filte...
(more)
almost 3 years ago
Edit Post #281450 Post edited:
The online REPL's not so slow any more
almost 3 years ago
Edit Post #281526 Post edited:
almost 3 years ago
Edit Post #281526 Initial revision almost 3 years ago
Answer A: Make my number a set
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 works, placing elements in the opposite order). The reason this works is that a prefix...
(more)
almost 3 years ago
Edit Post #281500 Initial revision almost 3 years ago
Answer A: Weave Strings Together
BQN, 8 bytesSBCS ``` ∾⊒˜¨⊔○∾⊢ ``` Run online! and parsing diagram The idea here is to build a list of groups, with group `i` containing the `i`th character of each string that has one, then join the groups. The structure `∾ ⊒˜¨ ⊔○∾ ⊢` is a train of four functions: the last three form a 3-t...
(more)
almost 3 years ago
Edit Post #281495 Initial revision almost 3 years ago
Answer A: Length of a Sumac Sequence
BQN, 15 bytesSBCS ``` {𝕨(1+⊢𝕊-)⟜𝕩⍟>0} ``` Run online! A block function that takes $t1$ as the left argument `𝕨` and $t2$ as the right argument `𝕩`. In BQN, `𝕊` indicates recursion on the current block function. Inside the function the idea is just to return 0 if `𝕨≤0` and otherwise advance...
(more)
almost 3 years ago
Edit Post #281490 Initial revision almost 3 years ago
Answer A: Win a War (or at least a few battles)
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 length of A, so it's not used as an argument. The function builds a list of all possible combin...
(more)
almost 3 years ago
Comment Post #281467 First link goes to the APL solution.
(more)
almost 3 years ago
Edit Post #281459 Post edited:
almost 3 years ago
Edit Post #281459 Initial revision almost 3 years ago
Answer A: Really Cool Numbers
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 split into two expressions, where the `{` on the left indicates to apply the modifier on ...
(more)
almost 3 years ago
Edit Post #281450 Initial revision almost 3 years ago
Answer A: Output 256 in many different ways
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. The expressions based entirely on repetition have been reduced to 16 reps to improve readability and res...
(more)
almost 3 years ago
Edit Post #281433 Initial revision about 3 years ago
Answer A: Create an Alphabet Diamond
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 `↕59` with `4+↕51` at the cost of two characters. BQN has no built-in idea of the alphabet, b...
(more)
about 3 years ago
Edit Post #281416 Initial revision about 3 years ago
Answer A: Obligatory Quine Challenge
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 needs to have four quote characters. This also means that the source string is displayed with ...
(more)
about 3 years ago
Edit Post #281414 Initial revision about 3 years ago
Answer A: Obligatory Quine Challenge
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 argument string, then joins (`∾`) the argument string to it.
(more)
about 3 years ago