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 »

Search

Advanced Search Options

To further refine your search, you can use additional qualifiers such as score:>0.5. For example, the search score:>=0.5 created:<1y grammar would return only posts mentioning "grammar" that have a score >= 0.5 and were created less than a year ago.

Further help with searching is available in the help center.

Quick hints: tag:tagname, user:xxx, "exact phrase", post_type:xxx, created:<N{d,w,mo,y}, score:>=0.5

Filters
1.6k posts
 
60%
+1 −0
Challenges A number adder, not a death adder

Ruby, 28 bytes puts"puts #{gets}+gets.to_i" puts"puts # print P2, which prints #{gets} # P1's input value, interpolated +gets.to_i" ...

posted 3y ago by snail_‭

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 3y ago by radarek‭  ·  edited 3y ago by radarek‭

Answer
60%
+1 −0
Challenges Golf golf challenge

Python 3, 108 bytes lambda p,s:"Hole in one:Albatross:Eagle:Birdie:Par:Bogey:Double bogey:Triple bogey".split(':')[s-1and s-p+4] Try it online!

posted 3y ago by dino‭

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 3y ago by radarek‭  ·  edited 3y ago by radarek‭

Answer
60%
+1 −0
Challenges Determine whether an integer is square-free

BQN, 13 bytesSBCS ∧´0≠⊢|˜·×˜2+↕ Run online! A train submission. It's 2 bytes shorter than the lambda version {∧´0≠𝕩|˜×˜2+↕𝕩}, due to omitting curly braces. The idea is similar to ruby: ran...

posted 3y ago by Razetime‭

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 3y ago by radarek‭

Answer
60%
+1 −0
Challenges Word Set Square

Ruby, 70 bytes ->s{s+=s.reverse;s[..-2].gsub(/./){t=$&+' '*$.+$/;t[-2]=$&;$.+=1;t}+s} Try this online!

posted 3y ago by radarek‭

Answer
60%
+1 −0
Challenges Diagonalized alphabet

Ruby, 52 51 bytes 13.times{puts:YWUSQOMKIGECABDFHJLNPRTVXZ[12-_1,14]} Attempt This Online!

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

Answer
60%
+1 −0
Challenges Small integer swapping

Ruby, 24 bytes gets=~/ /;puts$`,$'*2+$` Try this online!

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

Answer
60%
+1 −0
Challenges Are All Elements Equal?

Ruby, 14 bytes ->{_1|[]in[_]} Alternative solution: ->a{!(a|a)[1]} Try this online! Couple of other solutions I developed: ->a{!a.uniq[1]} # 15 bytes ->{!(_1|[])[1]} # 15...

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

Answer
60%
+1 −0
Challenges Weave Strings Together

Ruby, 48 45 bytes ->w{([p].*w*''=~/$/).zip(*w.map(&:chars))*''} Try this online! It could be improved to 32 bytes, if every string is represented as an array of characters: ->w{([p]...

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

Answer
60%
+1 −0
Challenges Multiply complex numbers.

J, 2 bytes */ Try it online! For complex numbers with 0 as the second part, J will represent them as ints, but they are treated the same.

posted 3y ago by south‭

Answer
60%
+1 −0
Challenges Are All Elements Equal?

J, 4 bytes -:|. Try it online! Checks if the input array matches itself reversed. This is a tacit form and is executed monadically as x f (g x).

posted 3y ago by south‭

Answer
60%
+1 −0
Challenges "Hello, World!"

J, 15 bytes 'Hello, World!' Or if you prefer to beat around the bush...76 bytes. {:a.{~-:^:_1@:|.~&2 S:0<@:<\50 16.5 36 50.5 54 54 55.5 22 16 43.5 55.5 57 54 Try it online!

posted 3y ago by south‭

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

J, 11 9 bytes /@(>:@i.) Attempt it online!

posted 3y ago by south‭  ·  edited 2y ago by south‭

Answer
60%
+1 −0
Challenges Compute the determinant

J, 5 bytes -/ .* Try it online! For the determinant conjunction, the space before u is necessary, so there is no shaving a byte here. If you want to read more about this conjunction, check out...

posted 3y ago by south‭

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

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

posted 3y ago by sampersand‭

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

J, 7 9 bytes ++2&=@+.~ Try it online! Dyadic fork that executes with the form (x + y) + (2 = x +. y). Thanks to torres for pointing out the obvious flaw.

posted 3y ago by south‭  ·  edited 2y ago by south‭

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

J, 10 7 bytes +/>:?#/ Try it online! +/>:?#/ #/ : Inserts dyadic # into an array n m Creates n copies of m ? : Roll from 0..y >: : Increment +/ : S...

posted 3y ago by south‭  ·  edited 2y ago by south‭

Answer
60%
+1 −0
Challenges Reverse an ASCII string

J, 2 bytes |. Try it online!

posted 3y ago by south‭

Answer
60%
+1 −0
Challenges Operation "Find The Operator"

Ruby, 57 bytes ->a,b,c{%w[+ - * / % **].select{c==a.send(_1,b)rescue p}} Attempt This Online!

posted 3y ago by radarek‭

Answer
60%
+1 −0
Challenges Partial Sums of Harmonic Series

J, 23 bytes >:@]^:(>1#.1%1+i.)^:_&1 Try it online! >:@]^:(...)^:_&1 Increments from 1 while >1#.1%1+i. the harmonic sum up to that is less than the input

posted 3y ago by Bubbler‭

Answer
60%
+1 −0
Sandbox Word wrap a string

posted 3y ago by celtschk‭

Article code-golf string
60%
+1 −0
Challenges Make my value binary

J, 2 bytes #: Try it online! Antibase two

posted 3y ago by south‭

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

dc, 4 bytes 2o?p Try it online!

posted 3y ago by orthoplex‭

Answer