Posts by Razetime
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.
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...
Ruby, 75 bytes ->t,u{g=->a{a.reduce{-2*_1+_2}};('%b'%(g[t]+g[u]+(y=43690)^y)).to_i.digits} Try it online! Uses latest ruby features, so tio link will look different. Takes two digit a...
APL(Dyalog Unicode), 13 bytes SBCS {⍵[?⍨≢⍵]}@⎕⊢⎕ Try it on APLgolf! A tradfn submission which takes both lists on STDIN, second input is 1-indexed.
Few QoL improvements can be made: Some trivial challenges(i.e. "Hello World!") get many, many answers, so the leaderboard should show a scrollbar beyond some point(after the first 10 submissions, ...
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.
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, 10 bytes kSo±-ȯΣhḊḣ Try it online! keyon is very nice here, but it's still a bit too long, sadly.
Task Print the following: ABDFHJLNPRTVXZ CABDFHJLNPRTVX ECABDFHJLNPRTV GECABDFHJLNPRT IGECABDFHJLNPR KIGECABDFHJLNP MKIGECABDFHJLN OMKIGECABDFHJL QOMKIGECABDFHJ SQOMKIGECABDFH USQOMKIGE...
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.
Husk, 11 10 bytes U¡λ⌊^+.%2¹ Try it online! This can probably be trivially ported to Jelly. Explanation U¡o⌊Ṡ^o+.%2 ¡ iterate over the input infinitely, creating a list o ...
Description From the Esolangs wiki, In Fractran, a program consists of a finite list of positive, rational numbers. The input to a program is a positive integer n. The list is then searched ...
APL(Dyalog Unicode), 26 bytes SBCS {⊃x/⍨⊃¨⍺∘⍷¨x←,∘⍵¨(⊂⍬),,\⍺} Try it on APLgolf! A dfn submission which takes the inputs as left and right argument. I took way too long to come up with this. ...
JavaScript (V8), 32 bytes f=n=>[...Array(n).keys()].map(f) Try it online! Somehow it doesn't recurse forever at n=0. Pretty nice.
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
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.
Challenge Given a string, e.g. Hello, do the following: Mirror it: Hello -> HelloolleH and create a right triangle using it as the sides: H ee l l l l o...
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...
Stax, 12 bytes ä╫◙=♥:≡ƒélΣæ Run and debug it +3 after correcting it(thanks, HakerH) Explanation b%s%>{s}M|-%1= b copy the two inputs %s%> is the first's length...
Introduction The Pell(no, not Bell) Numbers are a simple, Fibonacci-like sequence, defined by the following relation: $P_n=\begin{cases}0&\mbox{if }n=0;\\1&\mbox{if }n=1;\\2P_{n-1}+P_{n-2...