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 Expected value of highest dice rolled

Dyalog APL, 16 bytes {(+/÷≢)⌈/¨,⍳⍵/6} Explanation: ,⍳⍵/6 generate a list of all the possible sets of rolls ⌈/¨ find the maximum of each +/÷≢ find the average (sum up all values and divide ...

posted 1y ago by RubenVerg‭  ·  edited 1y ago by RubenVerg‭

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

Python, 16 bytes lambda s:s[::-1] Attempt This Online!

posted 1y ago by qwr‭

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

I'd like to post king-of-the-hill contests that read code directly from answers Essentials This is the only feature I would need in order to start posting contests. The answer content for each...

posted 2y ago by trichoplax‭

Answer
60%
+1 −0
Challenges The holeyest base

Ruby, 63 bytes ->n{(2..16).max_by{|x|n.digits(x).sum{45088003.digits(3)[_1]}}} Attempt This Online!

posted 2y ago by steffan153‭

Answer
60%
+1 −0
Challenges The holeyest base

Jelly, 20 bytes ³b‘ị“ḃṘ¤’b3¤S ⁴ḊÇÐṀḢ Try it online!

posted 2y ago by steffan153‭

Answer
60%
+1 −0
Challenges 8 coexisting queens

Vyxal, 9 bytes ×»∇ḂẆ»f꘍§ Try it Online! Uses spaces for empty and asterisks for queen. Add a › at the end to replace spaces with zeros. ×»∇ḂẆ»f꘍§ »∇ḂẆ»f # 13572064 as a list of digits × ...

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

Answer
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 "Hello, {name}!"

JavaScript, 28 bytes alert(`Hello, ${prompt()}!`) Try it online!

posted 3y ago by Shaggy‭

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 Find the IP address class

C (gcc), 64 62 bytes Saved 2 bytes thanks to m90 in the comments. i;f(char*s){i=atoi(s)>>4;return'A'+(i&8?i&4?i&2?i%2+3:2:1:0);} Try it online!

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

Answer