Posts by Razetime
There's a small problem with the leaderboard: It seems to be recognizing the first <code> block in the answer rather than the first <pre><code> block in the answer. The byte co...
APL(Dyalog Unicode), 64 bytes SBCS {64-≢∪x,u/⍨∧/¨(>∘0∧<∘9)u←⊃,/(a/⍨2|+/¨|a←,∘.,⍨1 2,-1 2)∘+∘⊂¨x←⍸⍵} Try it on APLgolf! A dfn which takes a boolean grid.
APL (Dyalog APL), 42 bytes {⎕UCS⊢2⊥1@2⊢(7⍴2)⊤⎕UCS⍵} Attempt This Online! In APL, base encoding(⊤) returns a matrix, so setting the lowercase bit is very easy with 1@2, setting the entire secon...
APL (Dyalog APL), 61 bytes {⍵/⍨~(⊢∊⌊/,⌈/)+⌿0 1↓2⊥⍣¯1⊢0,⎕UCS⍵} Attempt This Online! APL's style of filter works very well here, since we can check for the max and min elements here: (⊢∊⌊/,⌈/) ...
BQN, 107 bytes A↩C←A⇐¯π{_𝕣_:@;/⊏𝕩.y?𝕗‿∊𝕊⟨𝕤,⍷⟩𝕏𝕎𝔽𝕨𝔾𝕘}∞˙⌜˘¨´˝`(•Js⎉⊔⎊⌽⌾⍉⚇«∘»·∧○∨⍋⍒↑↓≍∾˜⥊⋈↕⊢⍟⊣¬!|≡≢/≥⟜≠=⊸≥⊐⊘⊒◶⊑><⌊⌈√⁼⋆+-×÷)⋄# BQN doesn't have keywords but primitive symbols are reserved. It's ...
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...
Stax, 8 bytes Ç▐GcΦ≡◘¶ Run and debug it Uses spaces as the staircase fill.
Charcoal, 7 bytes GH↑→↓N# Try it online! Link is to verbose version of code. PolygonHollow exactly fits this challenge. Prints a polygon with sides in x, all with length y, and the z used ...
Husk, 3 bytes ∫İ1 Try it online! Scan from left over all odd numbers with addition. Uses this formula: $$ n^2 = \sum_{k=1}^n(2k-1) $$
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...
Ruby, 35 bytes ->a{a.split.map{eval _1}.reduce :*} Try it online! Right tool for the job, I suppose. uses ruby 2.7+ features, so tio link will look different.
APL(Dyalog Unicode), 13 bytes SBCS {⍵[?⍨≢⍵]}@⎕⊢⎕ Try it on APLgolf! A tradfn submission which takes both lists on STDIN, second input is 1-indexed.
MAWP, 8 bytes @!2P2WA: Try it! 1 for odd and zero for even. mawp doesn't have modulus, so it floor divides by 2, multiplies by 2 and subtracts from the input.
Husk, 9 bytes ΛöS=⌊AhḊḊ Try it online! or Verify all testcases returns number of divisors + 1 for true and 0 for false.
APL(Dyalog Extended), 32 bytes SBCS {1=≢⍵:⍵⋄0~⍨,⍉↑∇¨↓2 ¯1⍴⍵,0/⍨2|≢⍵} Try it on APLgolf! A dfn submission which takes a string as input. I thought this would be much shorter, but it's only a s...
Husk, 8 bytes ΣTm?I₀ε½ Try it online! It's jelly but reversed. 1 byte lesser due to a single byte halve.
Husk, 4 bytes Sz#ḣ Try it online! Explanation Sz#ḣ Sz zip the input ḣ with its prefixes # using the count function
Stax, 5 bytes òP^↓Φ Run and debug it Same idea as Quintec's answer. Input as a floating point number. Explanation 1gpun+ 1 start with 1 gp apply the following till a fixpoint...
Languages made specifically for a challenge after it was published This is the general problem with allowing languages newer than the challenge. This is already considered a standard loophole, and...
Husk, 8 bytes ηÖ↔mo⌈½ŀ Try it online! Same idea as xash's answer from CGCC.
Husk, 6 bytes Fo+hx0 Try it online! there's got to be a smarter way to do this with grouping.
In my user preferences in "Edit Profile", under the "Link Stack Exchange Account" heading, this shows up: An association with Code Golf Stack Exchange needs to be added for this site.