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
Edit Post #285592 Post edited:
over 1 year ago
Edit Post #286079 Initial revision about 2 years ago
Answer A: Solve Goldbach's Conjecture
Ruby, 62 bytes require&#39;prime&#39;;f=-&gt;n,k=0{n.prime?&amp;&amp;k.prime?? [n,k]:f[n-1,k+1]} Attempt This Online!
(more)
about 2 years ago
Edit Post #285629 Post edited:
about 2 years ago
Edit Post #285629 Post edited:
about 2 years ago
Comment Post #285743 @#53310 Thanks for spotting it. Fixed.
(more)
about 2 years ago
Edit Post #285743 Post edited:
about 2 years ago
Edit Post #285743 Initial revision about 2 years ago
Answer A: Golf a FRACTRAN interpreter
Ruby, 44 bytes -&gt;p,n{n=I while I=p.find{1n%1==0};n.toi} Attempt This Online!
(more)
about 2 years ago
Edit Post #285708 Initial revision about 2 years ago
Answer A: Stairs? Stairs! Stairs.
Ruby, 50 bytes -&gt;n{n.times{puts (&#39; &#39;(n-1)+&#39;/&#39;+&#39;##&#39;1)[3..]}} Attempt This Online!
(more)
about 2 years ago
Edit Post #285496 Post edited:
about 2 years ago
Edit Post #285707 Initial revision about 2 years ago
Answer A: Operation "Find The Operator"
Ruby, 57 bytes -&gt;a,b,c{%w[+ - / % ].select{c==a.send(1,b)rescue p}} Attempt This Online!
(more)
about 2 years ago
Comment Post #285331 However, your code and mine suggestion don't work with input `*,0,*` (division by 0). The error must by properly handled.
(more)
about 2 years ago
Comment Post #285692 Unfortunately this does not work for input 0, 2 and 0, 2. ``` f=->a,b{a|b==2?5:a+b} f[0, 2] # => 5 ```
(more)
about 2 years ago
Edit Post #285706 Initial revision about 2 years ago
Answer A: Make $2 + 2 = 5$
Ruby, 20 bytes -&gt;a,b{4[a]4[b]+a+b} Attempt This Online!
(more)
about 2 years ago
Edit Post #285592 Post edited:
about 2 years ago
Edit Post #285605 Post edited:
about 2 years ago
Edit Post #285496 Post edited:
about 2 years ago
Edit Post #285668 Post edited:
about 2 years ago
Edit Post #285668 Initial revision about 2 years ago
Answer A: Given the preorder and the inorder of a tree, output the postorder
Ruby, 75 72 bytes f=-&gt;((e,r),n){(i=n.index e)?f[r[0,i],n[...i]]+f[r[i..],n[i+1..]]+[e]:n} Attempt This Online!
(more)
about 2 years ago
Edit Post #285667 Initial revision about 2 years ago
Answer A: Compute the determinant
Ruby, 35 bytes -&gt;m{require&#39;matrix&#39;;Matrix[m].det} Attempt This Online!
(more)
about 2 years ago
Edit Post #285618 Post edited:
about 2 years ago
Edit Post #285659 Initial revision about 2 years ago
Answer A: Prime Difference
Ruby, 56 bytes ```ruby ->n{require'prime';Prime.eachcons(2).find{2-1>=n}[0]} ``` Attempt This Online!
(more)
about 2 years ago
Edit Post #285630 Post edited:
about 2 years ago
Edit Post #285630 Post edited:
about 2 years ago
Edit Post #285629 Post edited:
about 2 years ago
Comment Post #283012 @#53607 Ok, make sense.
(more)
about 2 years ago
Comment Post #285618 @#55346 nice catch! Thanks.
(more)
about 2 years ago
Edit Post #285655 Post edited:
about 2 years ago
Edit Post #285655 Post edited:
about 2 years ago
Edit Post #285655 Post edited:
about 2 years ago
Edit Post #285655 Initial revision about 2 years ago
Answer A: Merge two strings
Ruby, 40 bytes ```ruby f=->a,b{b.index(a)==0?b:a[/./m]+f[$',b]} ``` Attempt This Online! If we could assume that string contains only letters and numbers (or to be more specific, no characters like `\t\n\v\f\r \#$()+-.?[\\]^{|}`) then it could be improved to 36 bytes: ```ruby f=->a,b{b...
(more)
about 2 years ago
Comment Post #281542 What characters can strings include? Only letters (like in examples)? New lines can be included? What about other characters?
(more)
about 2 years ago
Edit Post #285622 Post edited:
about 2 years ago
Edit Post #285622 Post edited:
about 2 years ago
Edit Post #285622 Post edited:
about 2 years ago
Edit Post #285622 Post edited:
about 2 years ago
Edit Post #285622 Post edited:
about 2 years ago
Edit Post #285622 Post edited:
about 2 years ago
Edit Post #285622 Post edited:
about 2 years ago
Edit Post #285622 Post edited:
about 2 years ago
Edit Post #285632 Initial revision about 2 years ago
Answer A: A number adder, not a death adder
Ruby, 25 bytes ```ruby puts"p #{gets}+gets.toi" ``` P1 - Try this online! P2 - Try this online!
(more)
about 2 years ago