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 »

Search

Advanced Search Options

To further refine your search, you can use additional qualifiers such as score:>0.5. For example, the search score:>=0.5 created:<1y grammar would return only posts mentioning "grammar" that have a score >= 0.5 and were created less than a year ago.

Further help with searching is available in the help center.

Quick hints: tag:tagname, user:xxx, "exact phrase", post_type:xxx, created:<N{d,w,mo,y}, score:>=0.5

Filters
28 posts
 
71%
+3 −0
Challenges 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 b...

posted 1y ago by Marshall Lochbaum‭  ·  edited 1y ago by Marshall Lochbaum‭

Answer
60%
+1 −0
Challenges Create a range grid

BQN (CBQN), 10 bytes Anonymous function that takes m on the left and n on the right. {𝕨‿𝕩⥊↕𝕨×𝕩} ↕𝕨×𝕩 # list of range [0,m*n) 𝕨‿𝕩⥊ # reshape list to m*n Try it here!

posted 2y ago by snail_‭  ·  edited 2y ago by snail_‭

Answer
60%
+1 −0
Challenges Keyword golfing

BQN, 107 bytes A↩C←A⇐¯π{_𝕣_:@;/⊏𝕩.y?𝕗‿∊𝕊⟨𝕤,⍷⟩𝕏𝕎𝔽𝕨𝔾𝕘}∞˙⌜˘¨´˝`(•Js⎉⊔⎊⌽⌾⍉⚇«∘»·∧○∨⍋⍒↑↓≍∾˜⥊⋈↕⊢⍟⊣¬!|≡≢/≥⟜≠=⊸≥⊐⊘⊒◶⊑><⌊⌈√⁼⋆+-×÷)⋄# BQN doesn't have keywords but primitive symbols are reserved. It's ...

posted 2y ago by Razetime‭  ·  edited 2y ago by Razetime‭

Answer
60%
+1 −0
Challenges Determine whether an integer is square-free

BQN, 13 bytesSBCS ∧´0≠⊢|˜·×˜2+↕ Run online! A train submission. It's 2 bytes shorter than the lambda version {∧´0≠𝕩|˜×˜2+↕𝕩}, due to omitting curly braces. The idea is similar to ruby: ran...

posted 2y ago by Razetime‭

Answer
50%
+0 −0
Challenges Evaluate a single variable polynomial equation

BQN, 13 bytes {+´(𝕨⋆↕≠𝕩)×𝕩} { } # fn +´ # sum reduce (𝕨⋆↕≠𝕩) # x^i for each term ×𝕩 # times each coefficient Try it

posted 2y ago by snail_‭  ·  edited 2y ago by snail_‭

Answer
66%
+2 −0
Challenges Collatz conjecture; Count the tries to reach $1$

BQN, 31 28 bytes {1+(1≠𝕩)◶¯1‿𝕊2(|⊑÷˜∾1+3×⊢)𝕩} Try it online! An anonymous function which takes a number. the ¯1 branch is a bit tacky but saves a byte over (1+𝕊).

posted 2y ago by Razetime‭  ·  edited 2y ago by Marshall Lochbaum‭

Answer
71%
+3 −0
Challenges Multiply two strings

BQN, 3 bytes Anonymous tacit infix function, taking the second string as left argument and the first string as right argument. ⥊⌊⌜ ⌊⌜ minimum table ⥊ deshape (flatten) BQN treats characters ...

posted 2y ago by Adám‭  ·  edited 2y ago by Adám‭

Answer
60%
+1 −0
Challenges Reduce over the range [1..n]

BQN, 8 bytes {𝔽´1+↕𝕩} Try it! basic fold builtin version. Use as a dyadic 1-modifier. Longer than APL since evaluated output is shorter than using first class functions. A more fun recursive...

posted 2y ago by Razetime‭  ·  edited 2y ago by Razetime‭

Answer
66%
+2 −0
Challenges 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. T...

posted 3y ago by Marshall Lochbaum‭  ·  edited 3y ago by Marshall Lochbaum‭

Answer
71%
+3 −0
Challenges 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 norma...

posted 3y ago by Marshall Lochbaum‭

Answer
66%
+2 −0
Challenges Diagonalized alphabet

APL (Dyalog Unicode), 31 bytes ⎕←↑(14↑(2⌷x),⍨⌽)¨,\1⌷x←⍉13 2⍴⎕A Try it online! Lot worse than the BQN answer. ⎕←↑(14↑(2⌷x),⍨⌽)¨,\1⌷x←⍉13 2⍴⎕A ⎕A ⍝ String of up...

posted 3y ago by user‭

Answer
80%
+6 −0
Challenges 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 colu...

posted 3y ago by Marshall Lochbaum‭

Answer
71%
+3 −0
Challenges 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...

posted 3y ago by Marshall Lochbaum‭

Answer
71%
+3 −0
Challenges Juggler sequences

APL (Dyalog Unicode), 15 bytesSBCS With many thanks to Marshall Lochbaum and dzaima for their help debugging and golfing this answer {⍵∪⌊⍵*2|⍵+.5}⍣≡ {⍵∪⌊⍵*2|⍵+.5}⍣≡ ⍝ ⍵ is our input of eith...

posted 3y ago by SherlockSage‭

Answer
80%
+6 −0
Challenges 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 argu...

posted 3y ago by Marshall Lochbaum‭

Answer
60%
+1 −0
Challenges 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 pr...

posted 3y ago by Marshall Lochbaum‭

Answer
75%
+4 −0
Challenges 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 solut...

posted 3y ago by Marshall Lochbaum‭

Answer
77%
+5 −0
Challenges 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 wo...

posted 3y ago by Marshall Lochbaum‭  ·  edited 3y ago by Marshall Lochbaum‭

Answer
66%
+2 −0
Challenges 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 ith character of each string that has one, then join the group...

posted 3y ago by Marshall Lochbaum‭

Answer
66%
+2 −0
Challenges Length of a Sumac Sequence

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 ...

posted 3y ago by Marshall Lochbaum‭

Answer
66%
+2 −0
Challenges 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 le...

posted 3y ago by Marshall Lochbaum‭

Answer
71%
+3 −0
Challenges 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...

posted 3y ago by Marshall Lochbaum‭  ·  edited 3y ago by Marshall Lochbaum‭

Answer
77%
+5 −0
Challenges 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. Th...

posted 3y ago by Marshall Lochbaum‭  ·  edited 3y ago by Marshall Lochbaum‭

Answer
77%
+5 −0
Challenges 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...

posted 3y ago by Marshall Lochbaum‭

Answer
75%
+4 −0
Challenges 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 ...

posted 3y ago by Marshall Lochbaum‭

Answer