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 »

Posts by snail_‭

32 posts
60%
+1 −0
Challenges Evens or Odds - you know this one

Ruby, 8 bytes ->n{n%2} Generic mod-in-a-lambda solution. Alternately, for 2.7+: ->{_1%2} Try it online!

posted 4y ago by snail_‭

Answer
60%
+1 −0
Challenges In The Jailhouse Now

Ruby, 53 bytes ->n{n-=3;[?╔+?╦*n+?╗,*[?╠+?╬*n+?╣]*(n+1),?╚+?╩*n+?╝]} Try it online!

posted 4y ago by snail_‭

Answer
60%
+1 −0
Challenges Make $2 + 2 = 5$

Ruby, 23 bytes ->a,b{a==2&&b==2?5:a+b} Try it online!

posted 4y ago by snail_‭

Answer
60%
+1 −0
Challenges Make my value binary

Ruby, 11 bytes ->n{"%b"%n} Simple string formatting. Try it online!

posted 3y ago by snail_‭

Answer
60%
+1 −0
Challenges Golf a FRACTRAN interpreter

Ruby, 51 50 bytes -1 from Razetime ->p,n{while i=p.find{(_1*n).to_f%1==0} n*=i end n} Try it online!

posted 3y ago by snail_‭  ·  edited 3y ago by snail_‭

Answer
60%
+1 −0
Q&A Tips for golfing in Ruby

Omitting parens on function calls You can omit parentheses on function calls in many cases. foo(bar,baz) foo bar,baz This is even true if a function call doesn't have any parameters. (This is...

posted 3y ago by snail_‭  ·  edited 3y ago by snail_‭

Answer
50%
+0 −0
Challenges Evaluate a single variable polynomial equation

BQN, 13 bytes {+´(𝕨⋆↕≠𝕩)×𝕩} { } # fn +´ # sum reduce (𝕨⋆↕≠𝕩) # x^i for each term ×𝕩 # times each coefficient Try it

posted 3y ago by snail_‭  ·  edited 3y ago by snail_‭

Answer