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

31 posts
50%
+0 −0
Challenges Generalized Sort

Ruby, 25 bytes Credits goes to @Shaggy and his JavaScript solution. ->a,l{l.map{a.sort! &_1}} Try this online! The other solution which not mutate original array

posted 2y ago by radarek‭

Answer
60%
+1 −0
Challenges Reduce over the range [1..n]

Ruby, 22 bytes ->{(1.._2).reduce &_1} Try this online! Without using reduce (28 bytes): f=->g,n{n<2?n:g[n,f[g,n-1]]} Try this online!

posted 2y ago by radarek‭

Answer
60%
+1 −0
Challenges Golf golf challenge

Ruby, 100 96 bytes According to the rules, trailing white spaces and line feed are allowed and my program uses that: ->p,s{"Par Bogey Double bogey Triple bogey Hole in one Albatross Eagl...

posted 2y ago by radarek‭  ·  edited 2y ago by radarek‭

Answer
60%
+1 −0
Challenges Roll n fair dice

Ruby, 27 24 bytes ->n,m{eval'-~rand(m)'*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 ...

posted 2y ago by radarek‭  ·  edited 2y ago by radarek‭

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

Ruby, 29 bytes ->l,x{a,*b=l;a ?a+x*f[b,x]:0} Try it online

posted 2y ago by radarek‭  ·  edited 2y ago by radarek‭

Answer
66%
+2 −0
Challenges Determine whether an integer is square-free

Ruby, 27 bytes ->n{(2..n).all?{n%_1**2>0}} Try it online

posted 2y ago by radarek‭  ·  edited 2y ago by radarek‭

Answer