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
 
60%
+1 −0
Challenges Operation "Find The Operator"

Japt, 16 bytes Takes the result as the first input and the other 2 values as an array as the second input. Uses z for floor division & p for exponentiation and outputs " if there's no match (c...

posted 3y ago by Shaggy‭

Answer
60%
+1 −0
Meta Reactions on Code Golf Codidact

New reactions are up "Works for me" is gone, "Outdated" is now invalid, and "Dangerous" has stayed the same.

posted 3y ago by Quintec‭

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

Booleans are replaceable Java, like Python, has pretty convenient yet nasty ways to golfing down code through comparison operators. Especially this case, this time with booleans. You can compare i...

posted 3y ago by General Sebast1an‭

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

A clever way to replace Math functions You can shorten if-else statements through the a?b:c syntax, where a is the statement of if, b is the result of if, and c is the result of else. static vo...

posted 3y ago by General Sebast1an‭  ·  edited 3y ago by General Sebast1an‭

Answer
60%
+1 −0
60%
+1 −0
Challenges Collatz conjecture; Count the tries to reach $1$

AWK, 46 bytes {c=0;for(n=$0;n-1;c++)n=n%2?n*3+1:n/2;print c} Try it online!

posted 3y ago by smlckz‭

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

dc, 16 bytes [Hello, World!]p Try it online!

posted 3y ago by smlckz‭

Answer
60%
+1 −0
Challenges "Hello, {name}!"

AWK, 21 bytes {print"Hello, "$0"!"} Try it online!

posted 3y ago by smlckz‭

Answer
60%
+1 −0
Challenges 1, 2, Fizz, 4, Buzz!

C (gcc), 103 bytes Using a different approach than my previous solution, therefore posting as new answer as suggested here. i;main(){while(i++<100){char s[]="FizzBuzz",*t=s+4*!!(i%3);if(i%5)...

posted 3y ago by celtschk‭

Answer
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 Cumulative Counts

Ruby, 31 bytes ->a{a.map{$*[_1]=1.+$*[_1]||0}} Try this online! $* is a global variable, so calling this lambda multiple times (in a single process) would give wrong result. A 32 bytes vers...

posted 3y ago by radarek‭  ·  edited 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 Write a Deadfish Interpreter

Ruby, 70 67 66 bytes ->c{a=0;c.bytes{|b|a,=[b<106?a+b/3-34:b<112?p(a):a*a,0]-[-1,256]}} Test 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