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 »

Activity for Razetime‭

Type On... Excerpt Status Date
Answer A: Multiply complex numbers.
[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.
(more)
almost 3 years ago
Question Leaderboard bug: recognizing inline code blocks
There's a small problem with the leaderboard: Shaggy n It seems to be recognizing the first `` block in the answer rather than the first `` block in the answer. The byte count is correct since it's taken from the title.
(more)
almost 3 years ago
Answer A: Add two negabinary integers
[Ruby], 75 bytes ->t,u{g=->a{a.reduce{-21+2}};('%b'%(g[t]+g[u]+(y=43690)^y)).toi.digits} Try it online! Uses latest ruby features, so tio link will look different. Takes two digit arrays, and returns an array which represents the negabinary integer. Borrows from a conversion...
(more)
almost 3 years ago
Answer A: Shuffle a subset of a list
APL(Dyalog Unicode), 13 bytes SBCS ``` {⍵[?⍨≢⍵]}@⎕⊢⎕ ``` Try it on APLgolf! A tradfn submission which takes both lists on STDIN, second input is 1-indexed.
(more)
almost 3 years ago
Answer A: Leaderboards are live
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, maybe?). Another thing I'd like to see is the ability to hide the leaderboard, preferably by click...
(more)
almost 3 years ago
Answer A: Evens or Odds - you know this one
[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.
(more)
almost 3 years ago
Answer A: Word Count Tool
[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 of the `tr`.
(more)
almost 3 years ago
Answer A: Are they abundant, deficient or perfect?
[Husk], 10 bytes kSo±-ȯΣhḊḣ Try it online! `keyon` is very nice here, but it's still a bit too long, sadly.
(more)
almost 3 years ago
Question Diagonalized alphabet
Task Print the following: ``` ABDFHJLNPRTVXZ CABDFHJLNPRTVX ECABDFHJLNPRTV GECABDFHJLNPRT IGECABDFHJLNPR KIGECABDFHJLNP MKIGECABDFHJLN OMKIGECABDFHJL QOMKIGECABDFHJ SQOMKIGECABDFH USQOMKIGECABDF WUSQOMKIGECABD YWUSQOMKIGECAB ``` and nothing else. You may return a multiline string o...
(more)
almost 3 years ago
Answer A: Evaluation order of an APL n-train
[Husk], 8 bytes ηÖ↔mo⌈½ŀ Try it online! Same idea as xash's answer from CGCC.
(more)
almost 3 years ago
Answer A: Backspace an array
[Husk], 6 bytes Fo+hx0 Try it online! there's got to be a smarter way to do this with grouping.
(more)
almost 3 years ago
Answer A: Juggler sequences
[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 with the following two functions: Ṡ^ take the previous result ...
(more)
almost 3 years ago
Question Golf a FRACTRAN interpreter
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 in order, for a rational number \$p/q\$ such that \$n×p/q\$ is an integer. - Then n is replaced ...
(more)
about 3 years ago
Answer A: Merge two strings
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. Fun challenge.
(more)
about 3 years ago
Answer A: Make my number a set
[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.
(more)
about 3 years ago
Answer A: Really Cool Numbers
[Husk], 9 bytes ΛöS=⌊AhḊḊ Try it online! or Verify all testcases returns number of divisors + 1 for true and 0 for false.
(more)
about 3 years ago
Answer A: Beaver Code Decryption
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 small improvement over unicode.
(more)
about 3 years ago
Answer A: Beaver Code Decryption
[Husk], 8 bytes ΣTm?I₀ε½ Try it online! It's jelly but reversed. 1 byte lesser due to a single byte halve.
(more)
about 3 years ago
Answer A: Cumulative Counts
[Husk], 4 bytes Sz#ḣ Try it online! Explanation ``` Sz#ḣ Sz zip the input ḣ with its prefixes # using the count function
(more)
about 3 years ago
Question Allow linking account with Code Golf Stack Exchange
In my user preferences in "Edit Profile", under the "Link Stack Exchange Account" heading, this shows up: You can't link a Stack Exchange account to your account on this site because there is no associated Stack Exchange site from which to transfer your content. An association with Code Golf Sta...
(more)
about 3 years ago
Question Word Set Square
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 o o o l l l l e e HelloolleH ``` Which ...
(more)
about 3 years ago
Answer A: Ratio limits of fibonacci-like series
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: u reciprocal n+ add the input
(more)
about 3 years ago
Answer A: Is it a near-anagram?
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 < second? {s}M if so, swap the two |- multiset difference % ...
(more)
about 3 years ago
Question The Pell Numbers
Introduction The Pell(no, not Bell) Numbers are a simple, Fibonacci-like sequence, defined by the following relation: \$Pn=\begin{cases}0&\mbox{if }n=0;\\\\1&\mbox{if }n=1;\\\\2P{n-1}+P{n-2}&\mbox{otherwise.}\end{cases}\$ They also have a closed form: \$Pn=\frac{\left(1+\sqrt2\right)^n-\l...
(more)
about 3 years ago
Article Word Set Square[FINALIZED]
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 o o o l l l l e e HelloolleH ``` Which ...
(more)
about 3 years ago
Article The Pell Numbers[FINALIZED]
Introduction The Pell(no, not Bell) Numbers are a simple, Fibonacci-like sequence, defined by the following relation: \$Pn=\begin{cases}0&\mbox{if }n=0;\\\\1&\mbox{if }n=1;\\\\2P{n-1}+P{n-2}&\mbox{otherwise.}\end{cases}\$ They also have a closed form: \$Pn=\frac{\left(1+\sqrt2\right)^n-\l...
(more)
about 3 years ago
Answer A: Solve Goldbach's Conjecture
[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 satisfies: Σ sum = equals ⁰ input?
(more)
about 3 years ago
Answer A: Create an Alphabet Diamond
Stax, 12 bytes ç ∩<▬%▌ê▓jFo Run and debug it Same method as the Canvas answer.
(more)
about 3 years ago
Answer A: Create an Alphabet Diamond
Canvas, 10 7 6 bytes Z[]/┼┼ Try it here! Creates the top portion, centers it, and mirrors it. -3 bytes from dzaima's hint. -1, found the 6 byter! Explanation ``` Z[]/++ Z push the alphabet [] get all prefixes / diagonalize by padding each line with ...
(more)
about 3 years ago
Question Write a Deadfish Interpreter
A rewrite of this SE question with a simpler input format and guidelines. Challenge Deadfish uses a single accumulator, on which all commands are to be performed. It has the following commands: |Command|Description |-|- |`i`|increment the accumulator |`d`|decrement the accumulator |`s...
(more)
about 3 years ago
Article Write a Deadfish Interpreter[FINALIZED]
A rewrite of this question with a simpler input format and guidelines. Challenge Deadfish uses a single accumulator, on which all commands are to be performed. It has the following commands: |Command|Description |-|- |i|increment the accumulator |d|decrement the accumulator |s|square ...
(more)
over 3 years ago
Question Truthify an array
Jelly has an atom called untruth, which when given indices, creates an array with 1s at those places: `[2,4] → [0,1,0,1]`. You are required to perform the inverse of this. Given a 2D boolean array, find the indices of the true values in it. Challenge You will be given a single 2D boolean arr...
(more)
over 3 years ago
Question Posting guidelines modifications
Currently, the posting guidelines for Code Golf are the defaults on Codidact. Posting Tips: ¶ Your title should be a one sentence summary of your question. ¶ Break different topics up into paragraphs. Multiple paragraphs are easier to read than a wall of text. ¶ Use clear, simple language. Be spec...
(more)
over 3 years ago
Question Calculate a person's age
Challenge Given a date with day, month and year, calculate how old a person born on that day would be today. Input can be in any reasonable format(params, array, date object). Input will never be invalid. Output must consist of years, months and days in any order you specify. Date and Ti...
(more)
over 3 years ago
Question Golf me a polygonal loader
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 regular polygons: ``` ...
(more)
over 3 years ago
Answer A: The Camelot Wheel
[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 the compression, but works correctly. In both circles, the notes come in the form `A...
(more)
over 3 years ago
Answer A: Output 256 in many different ways
[Husk], 9 solutions 1. Classic ``` 256 ``` Try it online! 2. Squaring ``` □□4 ``` Try it online! 3. Incrementing ``` →→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→...
(more)
over 3 years ago
Question Towering Cistercian Representation
SE Sandbox Link, Codidact Sandbox Link Inspired by this video. Given a positive integer, draw its Cistercian representation as ascii art. ![enter image description here][1] The Challenge Cistercian numerals are a decimal-based number representation system which use simple line based dr...
(more)
over 3 years ago
Answer A: 1, 2, Fizz, 4, Buzz!
[RoadLang], 340 bytes ``` wagwan my slime x is 0 rip dat bong till x bigger den 99 n dat x is x n 1 ayy bossman (x leftova 15) be 0 init bruv man say"FizzBuzz" yeah init bruv ayy bossman (x leftova 5) be 0 init bruv man say"Buzz" yeah init bruv ayy bossman (x leftova 3) be 0 init b...
(more)
over 3 years ago
Answer A: Reverse an ASCII string
[Ruby], 14 bytes ->s{s.reverse} Try it online! a straightforward builtin.
(more)
over 3 years ago
Answer A: Longest Increasing Subsequence
[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 differences <0 are negative ►L max by length L length of that
(more)
over 3 years ago
Answer A: "Hello, World!"
[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 lad's lost the plot", so I think this is the most minimal answer I can get here....
(more)
over 3 years ago
Question Weave Strings Together
Given a list of strings(and optionally, their length) as input, weave the strings together. Intro Your goal is to mimic the `WV` operator in Pip. Take a list of strings and alternate between their characters like so: ``` hello, world, → hwc,eoo,lrd,lle,od → hwceoolrdlleod code ``` Effec...
(more)
over 3 years ago
Answer A: Tile pyramids on top of each other!
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) + join with previous iteration r center the whole thing
(more)
over 3 years ago
Answer A: Who should the temporary moderators be?
I nominate Jo King, as they were already voted as moderator by the community earlier. They have proven to be an active and trustworthy moderator, who is also a consistent contributor to the code golf community.
(more)
over 3 years ago
Question Length of a Sumac Sequence
Heavily based on this closed challenge from SE. Description A Sumac sequence starts with two non-zero integers \$t1\$ and \$t2.\$ The next term, \$t3 = t1 - t2\$ More generally, \$tn = t{n-2} - t{n-1}\$ The sequence ends when \$tn ≤ 0\$. All values in the sequence must be positive. ...
(more)
over 3 years ago
Article Weave strings together[FINALIZED]
Given a list of strings(and optionally, their length) as input, weave the strings together. Intro Your goal is to mimic the `WV` operator in Pip. Take a list of strings and alternate between their characters like so: ``` hello, world, → hwc,eoo,lrd,lle,od → hwceoolrdlleod code ``` Effec...
(more)
over 3 years ago
Article Golf me a polygonal loader
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 regular polygons: ``` ...
(more)
over 3 years ago
Answer A: Partial Sums of Harmonic Series
Stax, 9 bytes Ç≈f♠É↔X+ö Run and debug it Explanation(Unpacked): ``` wii{um|+;< w iterate until a falsy result is reached: ii push iteration number i twice {um map range [1..i] to their reciprocals |+ sum that list ;< compare to the input(get...
(more)
over 3 years ago
Article Towering Cistercian representation [FINALIZED]
Inspired by this video. Given a positive integer, draw its Cistercian representation as ascii art. ![enter image description here][1] The Challenge Cistercian numerals are a decimal-based number representation system which use simple line based drawings to represent 4-digit numerals. ...
(more)
over 3 years ago