Posts by Razetime
Challenge Given an array in any suitable format, create a frequency table for it. i.e: Pair each unique element with the number of times it appears in the array. You can return the frequency tabl...
Ruby, 82 bytes ->w,n{[*0...w.size].permutation(n).map{e=w*1;_1.map{|x|e[x]='.'};e}.uniq.join '|'} Attempt This Online! uses permutation to do most of the work. Might be shorter with somethi...
Given a grid of numbers, mark the concentric areas around nonzero elements (beacons) decreasing from the value of the beacon till 1. For example, here are some grids with a single beacon: Size 1:...
No Your logic is correct. kolmogorov-complexity requires for the same constant fixed output across all solutions. This is not a static pattern, since it runs forever, so it doesn't fall under tha...
General requirements You need to have all the code that is necessary to create the function within your submission. For most languages, this may include the syntax for defining the name and argum...
Haskell, 35 bytes main=mapM putStrLn$iterate('*':)"*" Attempt This Online! 55 -> 39, with orthoplex's idea. 39 -> 35 from orthoplex.
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+𝕊).
jq, 38 bytes while(1;.+("\(.)"|explode|max+min-96)) Try it online! prints the infinite sequence starting with $n$.
jq, 48 bytes [while(.>0;./2|floor)]|map(.%2)|reverse|join("") Try it online! jq is the Language of the month for September! if the output is not required as per the question, join can be o...
Husk, 5 bytes ±£Θİ□ Try it online! similar to haskell, checks if the number is in the infinite list of squares.
Cracks Lundin's answer: C++ (gcc) %: %: define cops(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) if(not false and k%:%:f%:%:d%:%:l(& (not true) <:%:i%:j%:k%:l" "%:m" "%:n%:o%:p%:q%:r%:s%:t:&...
Cracks Shaggy's answer: Japt ((Cops)&(Robbers))`¬ps d bÞ`¸ËhDÎmEgviuø Test it
Ruby, 56 bytes ->s,i{a=[*?a..?z].rotate(i)*"";s.tr "A-Za-z",a.upcase+a} Try it online! tr is wildly useful here. Builds the tr string manually and replaces only the alphabets.
Ruby, 55 bytes ->a{[a.split,a.tr($/,''),a.gsub(/[ ]/,'')].map &:size} Try it online! split removes all whitespace, but lines doesn't for some reason. Would've been useful in place o...
Husk, 9 bytes ḟo=⁰Σπ2İp Try it online! Explanation ḟo=⁰Σπ2İp İp take the infinite list of primes π2 cartesian power 2 (all possible pairs) ḟo first pair which satisfie...
CGCC Sandbox, Codidact Sandbox Given three positive integers as input, animate an ascii-art polygonal loading symbol on the screen. Intro Using the first input $n$, Take one the following regul...
RoadLang, 59 bytes wagwan my slime man say"Hello, World!" chat wit u later fam My first RoadLang answer! And probably the first one on this site! Removing any of the words says "Aight the ...
APL (Dyalog Unicode), 110 67 bytes {(⍕((f⊖⍪'AEBFCGDAEBFD'),r⌽12↑¯6↑5⍴'-')⍳2↑⍵),⎕a⌷⍨1+0≠f←¯3+r←3×'i'∊⍵} -43 bytes from dzaima. Requires input exactly as shown in the diagram. A bit fiddly with...
Husk, 10 bytes L►LfΛo<0-Ṗ Try it online! Explanation L►LfΛo<0-Ṗ Ṗ power set of input f get elements which match the following: Λo - all pairwise difference...
Canvas, 9 7 bytes H/×║∔}r Try it here! Explanation H/×║+}r H } push empty art and start a loop from 1..n /× repeat '/' i times ║ palindromize horizontally(no overlap) ...