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 radarekā€­

Type On... Excerpt Status Date
Answer A: Golf golf challenge
Ruby, 100 96 bytes According to the rules, trailing white spaces and line feed are allowed and my program uses that: ```ruby ->p,s{"Par Bogey Double bogey Triple bogey Hole in one Albatross Eagle Birdie".lines[s<2?4:s-p]} ``` Try this online!
(more)
over 2 years ago
Edit Post #285496 Initial revision over 2 years ago
Answer A: Roll n fair dice
Ruby, 27 24 bytes -&gt;n,m{eval&#39;-rand(m)&#39;n} Attempt This Online! If we change the order of `n, m` parameters to `m, n` then following 23 bytes version work, but only in ruby 2.7 (it does not work in 3.x - bug or feature?): ```ruby ->{eval'-rand(1)'2} ```
(more)
over 2 years ago
Edit Post #285480 Post edited:
over 2 years ago
Edit Post #285482 Post edited:
over 2 years ago
Edit Post #285482 Post edited:
over 2 years ago
Edit Post #285482 Initial revision over 2 years ago
Answer A: Evaluate a single variable polynomial equation
Ruby, 29 bytes ```ruby ->l,x{a,b=l;a ?a+xf[b,x]:0} ``` Try it online
(more)
over 2 years ago
Edit Post #285480 Post edited:
over 2 years ago
Edit Post #285480 Post edited:
over 2 years ago
Edit Post #285480 Post edited:
over 2 years ago
Edit Post #285480 Initial revision over 2 years ago
Answer A: Determine whether an integer is square-free
Ruby, 27 bytes ```ruby ->n{(2..n).all?{n%12>0}} ``` Try it online
(more)
over 2 years ago
Comment Post #285404 @#53310 Good catch, thanks!
(more)
over 2 years ago
Comment Post #285331 ```ruby ->a,b,c{%w[+ - * / % **].select{eval"a#{_1}b==c"}} ```
(more)
over 2 years ago
Comment Post #285404 You can make it 1b shorter by using `$><<` to output value in P2: ``` puts"$><<#{gets}+gets.to_i" ```
(more)
over 2 years ago