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 The holeyest base

Vyxal, 19 18 bytes 16Ḣλ»≤ṪḢ»3τ?nτİ∑;∴ Try it Online! The link goes to a program which has every test case. -1 thanks to Steffan Explained (old) 16Ḣλ?$τ»≤ṪḢ»3τ$İ∑;O 16Ḣ # Th...

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

Answer
60%
+1 −0
Challenges 8 coexisting queens

J, 20 bytes '01'{~#:2^2842 A.i.8 Attempt This Online! Non-tacit program that outputs implicitly in a REPL. Shoutout to Raul (Miller)#5220 in the APL farm discord for thinking of this cool idea...

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

Answer
60%
+1 −0
Meta What would this community like to see in a Codidact API?

I've now posted on Codidact Meta How should a Codidact public API work? I'll still be taking into account any discussion here if you have Code Golf specific thoughts, but for general API discussio...

1 answer  ·  posted 2y ago by trichoplax‭  ·  edited 1y ago by trichoplax‭

Question discussion
60%
+1 −0
Q&A Up to date JavaScript Try-It-Online

Try it online doesn't support the latest JavaScript features such as optional chaining or null coalescence, which are very useful character-saving operators. Is there another site like TIO, but whi...

1 answer  ·  posted 2y ago by Moshi‭  ·  last activity 2y ago by trichoplax‭

Question try-it-online
60%
+1 −0
Challenges 55 fruit salad: choose your own Kolmogorov complexity

Python 3, 325 322 bytes -3 bytes thanks to steffan153‭! from base64 import* n=int.from_bytes(b85decode('8C^#Z9Uor=^}*nk`yLA}A<z=aTm_V+z!I{Y1+v7z89f>WmC>M4TN(sPp`fvySOeqafPpzk0!*=hK2{h9D...

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

Answer
60%
+1 −0
Challenges 55 fruit salad: choose your own Kolmogorov complexity

Python 3, 326 bytes print("fig gấc abiu açaí bael date lime lulo neem noni pear pili plum rimu sloe sorb yuzu ackee akebi apple araza cacao caqui carob etrog grape guava ilama jagua kokum kubal ...

posted 2y ago by steffan153‭

Answer
60%
+1 −0
Challenges 55 fruit salad: choose your own Kolmogorov complexity

Vyxal, 244 bytes `↔ė ¹¢ Ṁṙ ṫ₁ λǎ ȧ₴ ¶Ŀ ¯¡ ɾ⟨ ²ǒ aǍ₄ b₴⟩ l℅₆ n꘍ƒ pƛṖ pṁ‹ p⋏µ p⇧Ż r⋏⅛ s⇧⁋ s⋎Ė ≈•꘍₈ ak↳⁼ …⋎꘍⇩ ₴ꜝza Ǎṁ…℅ ǍŀṪṄ •øĊ¯ ∞¨Ċ¯ ∧¡ǎŀ Ǎ§Ċ¯ ⟇⁺Ċ¯ ₃Ẏ꘍⁼ ṙ†ð‛ ṙ†Ṗ₃ ...

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

Answer
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 2y 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