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 snail_‭

Type On... Excerpt Status Date
Edit Post #283915 Post edited:
control flow diagram
over 2 years ago
Edit Post #283915 Initial revision over 2 years ago
Answer A: Make my value binary
[Ahead], 20 bytes ```ahead I>:2%r vn:/2\}KO@ ``` Control flow goes like this: Ahead program flow diagram ``` orange path: init I # read number green path: main loop > # go east (start of loop) : # dup input 2% # take mod 2 (get lowest bit) r # go south, then east (enter th...
(more)
over 2 years ago
Edit Post #283914 Initial revision over 2 years ago
Answer A: Make my value binary
[Ruby], 11 bytes ```ruby ->n{"%b"%n} ``` Simple string formatting. Try it online!
(more)
over 2 years ago
Edit Post #283806 Initial revision over 2 years ago
Answer A: Output 256 in many different ways
[Ruby], 7 solutions ```ruby 256 44 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------0 1...
(more)
over 2 years ago
Edit Post #283792 Post edited:
Link formatting
over 2 years ago
Edit Post #283794 Initial revision over 2 years ago
Answer A: Make $2 + 2 = 5$
[Ruby], 23 bytes ```ruby ->a,b{a==2&&b==2?5:a+b} ``` Try it online!
(more)
over 2 years ago
Edit Post #283792 Initial revision over 2 years ago
Question Tips for golfing in Ruby
If you have any tips for golfing in [Ruby], share them as answers to this post.
(more)
over 2 years ago
Edit Post #283767 Initial revision over 2 years ago
Answer A: Roll n fair dice
[Ruby], 28 bytes ->n,m{(1..n).sum{rand(m)+1}} Try it online!
(more)
over 2 years ago
Edit Post #283765 Initial revision over 2 years ago
Answer A: In The Jailhouse Now
[Ruby], 53 bytes ```ruby ->n{n-=3;?╔+?╦n+?╗,[?╠+?╬n+?╣,?╚+?╩n+?╝]} ``` Try it online!
(more)
over 2 years ago
Edit Post #283263 Initial revision over 2 years ago
Answer A: It's Hip to be Square
[Ruby], 16 bytes ```ruby ->n{n0.5%1==0} ``` Try it online!
(more)
over 2 years ago
Comment Post #283103 I can agree with making this rule a requirement on specific challenge types, or allow authors to specify it in the rules, but I'm not sure if the concerns apply universally. Also, I didn't see the default loophole you refer to. Do you have a link/quote?
(more)
almost 3 years ago
Edit Post #283101 Initial revision almost 3 years ago
Question Answering challenges with languages newer than the challenge
Somewhere Else, there was a long-standing rule that to answer a challenge, you couldn't use languages, language versions, or features that were created or introduced after the challenge was posted. If you did, the answer would have to be flagged as "non-competing." After some time, the rule was seemi...
(more)
almost 3 years ago
Edit Post #283012 Post edited:
-2 bytes
almost 3 years ago
Edit Post #283012 Initial revision almost 3 years ago
Answer A: Gamer Meme Creator
[Ruby], 67 65 bytes -2 from Razetime ```ruby ->s,a{[s.center(l=a.map(&:size).max),a,"BOTTOM TEXT".center(l)]} ``` Takes the art and outputs as a list of lines. Try it online!
(more)
almost 3 years ago
Edit Post #282944 Initial revision almost 3 years ago
Answer A: Cumulative Counts
[Ruby], 36 bytes ```ruby ->a{i=-1;a.map{a[0..i+=1].count 1}} ``` Try it online! The code in the TIO link is 2 bytes longer because `n` block parameter names are not supported on TIO's Ruby instance yet. It will work the same, however. The code is: ```ruby ->a{i=-1;a.map{a[0..i+=1].count ...
(more)
almost 3 years ago
Edit Post #282736 Initial revision almost 3 years ago
Answer A: Make my number a set
[Ruby], 27 bytes ```ruby ->n{x=[];n.times{xn{ } # lambda taking n x=[]; # set x to empty array n.times{ }; # repeat n times x<<x1 # append x with a copy of itself x # return x...
(more)
almost 3 years ago
Edit Post #282454 Initial revision almost 3 years ago
Answer A: Evens or Odds - you know this one
[Ruby], 8 bytes ```ruby ->n{n%2} ``` Generic mod-in-a-lambda solution. Alternately, for 2.7+: ```ruby ->{1%2} ``` Try it online!
(more)
almost 3 years ago
Comment Post #280829 @Moshi don't want to change the rules now, you should change your answer
(more)
about 3 years ago
Edit Post #280829 Initial revision about 3 years ago
Question Is it a near-anagram?
Two words are anagrams of each other if the letters of one can be reordered to spell the other; e.g. ADOBE and ABODE are anagrams. An alternate way of describing it is that both words contain the same count of each letter. If you were to make a table: ADOBE ABODE ----- ----- A: 1 ...
(more)
about 3 years ago
Edit Post #280739 Post edited:
finalizing
about 3 years ago
Comment Post #280739 Question: does the strings being different lengths make the question more interesting or just more complicated?
(more)
about 3 years ago
Edit Post #280739 Initial revision about 3 years ago
Article Is it a near-anagram? [FINALIZED]
Two words are anagrams of each other if the letters of one can be reordered to spell the other; e.g. ADOBE and ABODE are anagrams. An alternate way of describing it is that both words contain the same count of each letter. If you were to make a table: ADOBE ABODE ----- ----- A: 1 ...
(more)
about 3 years ago
Edit Post #280301 Initial revision over 3 years ago
Answer A: Tile pyramids on top of each other!
[Ruby], 43 bytes ->n{(1..n).map{|i|" "(n-i)+?/i+?\\i}$/} ->n{ } # lambda (1..n).map{|i| } # map over 1 to n " "(n-i)+?/i+?\\i # spaces plus / plus \ ...
(more)
over 3 years ago
Edit Post #280141 Initial revision over 3 years ago
Answer A: Evaluate a single variable polynomial equation
Ruby, 38 bytes Simple map and sum over the coefficients. No TIO link, this uses numbered lambda parameters which require Ruby 2.7. ```ruby ->l,x{l.eachwithindex.sum{1x2}} ```
(more)
over 3 years ago
Comment Post #279645 Input is pushed to the stack one character at a time. When it's printed the last character is the top of the stack, so it's popped and printed first.
(more)
over 3 years ago
Edit Post #279645 Initial revision over 3 years ago
Answer A: Reverse an ASCII string
[Ahead], 3 bytes SW@ S Slurp entire input to stack W Write entire stack @ End Try it online!
(more)
over 3 years ago