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 »
Challenges

Post History

66%
+2 −0
Challenges Fibonascii Squares

BQN, 29 28 bytes (⍉≍""){β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©}´⟜⌽'@'+↕ Try it here! Explanation: (⍉≍""){β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©}´⟜⌽'@'+↕ # a function taking a single argument ⍉≍"" # a 0-by-1 matrix (...

posted 5mo ago by dzaima‭  ·  edited 5mo ago by dzaima‭

Answer
#3: Post edited by user avatar dzaima‭ · 2024-07-02T11:54:31Z (5 months ago)
  • # BQN, 29 bytes
  • ```bqn
  • (≍""){β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©}´⟜⌽'@'+1↓↕
  • ```
  • [Try it here!](https://mlochbaum.github.io/BQN/try.html#code=RiDihpAgKOKJjSIiKXvijYnijL3wnZWp4oi+y5jwnZWo4qWKy5zii4jLnOKJoPCdlal9wrTin5zijL0nQCcrMeKGk+KGlQpGIDc=)
  • Explanation:
  • ```bqn
  • (≍""){β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©}´⟜⌽'@'+1↓↕ # a function taking a single argument
  • ≍"" # a 1-by-0 character matrix
  • (≍""){ }Β΄ # right fold with the initial value of ≍""
  • ⟜⌽ # (but reverse the list to make it a left fold)
  • ↕ # range; 0 1 2 3 4 … input-1
  • 1↓ # drop the first element; 1 2 3 4 … input-1
  • '@'+ # plus the character '@' ('A' = '@'+1); "ABCDEF…"
  • {β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©} # fold operand: 𝕨 - current character, 𝕩 - accumulator - the matrix
  • ≠𝕩 # numbers of rows in the matrix
  • β‹ˆΛœ # paired with itself (7 β†’ [7,7])
  • 𝕨β₯ŠΛœ # reshape 𝕨 that much
  • π•©βˆΎΛ˜ # concatenate horizontally to 𝕩
  • β‰βŒ½ # rotate 90Β° clockwise (reverse vertically, transpose)
  • ```
  • # BQN, <s>29</s> 28 bytes
  • ```bqn
  • (⍉≍""){β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©}´⟜⌽'@'+↕
  • ```
  • [Try it here!](https://mlochbaum.github.io/BQN/try.html#code=RiDihpAgKOKNieKJjSIiKXvijYnijL3wnZWp4oi+y5jwnZWo4qWKy5zii4jLnOKJoPCdlal9wrTin5zijL0nQCcr4oaVCkYgNw==)
  • Explanation:
  • ```bqn
  • (⍉≍""){β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©}´⟜⌽'@'+↕ # a function taking a single argument
  • ⍉≍"" # a 0-by-1 matrix
  • (⍉≍""){ }Β΄ # right fold with the initial value of the 0-by-1 matrix
  • ⟜⌽ # (but reverse the list to make it a left fold)
  • ↕ # range; 0 1 2 3 4 … input-1
  • '@'+ # plus the character '@'; "@ABCDEF…"
  • {β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©} # fold operand: 𝕨 - current character, 𝕩 - accumulator - the matrix
  • ≠𝕩 # numbers of rows in the matrix
  • β‹ˆΛœ # paired with itself (7 β†’ [7,7])
  • 𝕨β₯ŠΛœ # reshape 𝕨 that much
  • π•©βˆΎΛ˜ # concatenate horizontally to 𝕩
  • β‰βŒ½ # rotate 90Β° clockwise (reverse vertically, transpose)
  • ```
#2: Post edited by user avatar dzaima‭ · 2024-07-02T11:47:09Z (5 months ago)
  • # BQN, 28 bytes
  • ```bqn
  • (≍""){β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©}´⟜⌽'@'+1↓↕
  • ```
  • [Try it here!](https://mlochbaum.github.io/BQN/try.html#code=RiDihpAgKOKJjSIiKXvijYnijL3wnZWp4oi+y5jwnZWo4qWKy5zii4jLnOKJoPCdlal9wrTin5zijL0nQCcrMeKGk+KGlQpGIDc=)
  • Explanation:
  • ```bqn
  • (≍""){β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©}´⟜⌽'@'+1↓↕ # a function taking a single argument
  • ≍"" # a 1-by-0 character matrix
  • (≍""){ }Β΄ # right fold with the initial value of ≍""
  • ⟜⌽ # (but reverse the list to make it a left fold)
  • ↕ # range; 0 1 2 3 4 … input-1
  • 1↓ # drop the first element; 1 2 3 4 … input-1
  • '@'+ # plus the character '@' ('A' = '@'+1); "ABCDEF…"
  • {β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©} # fold operand: 𝕨 - current character, 𝕩 - accumulator - the matrix
  • ≠𝕩 # numbers of rows in the matrix
  • β‹ˆΛœ # paired with itself (7 β†’ [7,7])
  • 𝕨β₯ŠΛœ # reshape 𝕨 that much
  • π•©βˆΎΛ˜ # concatenate horizontally to 𝕩
  • β‰βŒ½ # rotate 90Β° clockwise (reverse vertically, transpose)
  • ```
  • # BQN, 29 bytes
  • ```bqn
  • (≍""){β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©}´⟜⌽'@'+1↓↕
  • ```
  • [Try it here!](https://mlochbaum.github.io/BQN/try.html#code=RiDihpAgKOKJjSIiKXvijYnijL3wnZWp4oi+y5jwnZWo4qWKy5zii4jLnOKJoPCdlal9wrTin5zijL0nQCcrMeKGk+KGlQpGIDc=)
  • Explanation:
  • ```bqn
  • (≍""){β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©}´⟜⌽'@'+1↓↕ # a function taking a single argument
  • ≍"" # a 1-by-0 character matrix
  • (≍""){ }Β΄ # right fold with the initial value of ≍""
  • ⟜⌽ # (but reverse the list to make it a left fold)
  • ↕ # range; 0 1 2 3 4 … input-1
  • 1↓ # drop the first element; 1 2 3 4 … input-1
  • '@'+ # plus the character '@' ('A' = '@'+1); "ABCDEF…"
  • {β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©} # fold operand: 𝕨 - current character, 𝕩 - accumulator - the matrix
  • ≠𝕩 # numbers of rows in the matrix
  • β‹ˆΛœ # paired with itself (7 β†’ [7,7])
  • 𝕨β₯ŠΛœ # reshape 𝕨 that much
  • π•©βˆΎΛ˜ # concatenate horizontally to 𝕩
  • β‰βŒ½ # rotate 90Β° clockwise (reverse vertically, transpose)
  • ```
#1: Initial revision by user avatar dzaima‭ · 2024-07-02T11:46:34Z (5 months ago)
# BQN, 28 bytes

```bqn
(≍""){β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©}´⟜⌽'@'+1↓↕
```
[Try it here!](https://mlochbaum.github.io/BQN/try.html#code=RiDihpAgKOKJjSIiKXvijYnijL3wnZWp4oi+y5jwnZWo4qWKy5zii4jLnOKJoPCdlal9wrTin5zijL0nQCcrMeKGk+KGlQpGIDc=)

Explanation:

```bqn
(≍""){β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©}´⟜⌽'@'+1↓↕  # a function taking a single argument
 ≍""                           # a 1-by-0 character matrix
(≍""){            }Β΄           # right fold with the initial value of ≍""
                    ⟜⌽         #   (but reverse the list to make it a left fold)
                            ↕  # range; 0 1 2 3 4 … input-1
                          1↓   # drop the first element; 1 2 3 4 … input-1
                      '@'+     # plus the character '@' ('A' = '@'+1); "ABCDEF…"

     {β‰βŒ½π•©βˆΎΛ˜π•¨β₯ŠΛœβ‹ˆΛœβ‰ π•©}            # fold operand: 𝕨 - current character, 𝕩 - accumulator - the matrix
                ≠𝕩             # numbers of rows in the matrix
              β‹ˆΛœ               # paired with itself (7 β†’ [7,7])
           𝕨β₯ŠΛœ                 # reshape 𝕨 that much
        π•©βˆΎΛ˜                    # concatenate horizontally to 𝕩
      β‰βŒ½                       # rotate 90Β° clockwise (reverse vertically, transpose)
     
                      
```