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
 
75%
+4 −0
Challenges Partial Sums of Harmonic Series

Stax, 9 bytes Ç≈f♠É↔X+ö Run and debug it Explanation(Unpacked): wii{um|+;< w iterate until a falsy result is reached: ii push iteration number i twice {um map r...

posted 4y ago by Razetime‭

Answer
75%
+4 −0
Challenges Length of a Sumac Sequence

Python 3, 49 47 44 35 bytes a=lambda x,y:+(x>=0)and(1+a(y,x-y)) Try it online! -3 bytes thanks to @Hakerh400‭ -9 bytes thanks to @Jo King‭ Python 2, 50 bytes x,y=input() a=0 while...

posted 4y ago by Quintec‭  ·  edited 4y ago by Quintec‭

Answer
75%
+4 −0
Challenges Length of a Sumac Sequence

Raku, 19 bytes {(|@_,*-*...0>*)-1} Try it online! { } # Anonymous code block ... # Create a sequence |@_ # Starting with the input ...

posted 4y ago by Jo King‭

Answer
75%
+7 −1
Meta Who should the temporary moderators be?

I nominate Jo King, as they were already voted as moderator by the community earlier. They have proven to be an active and trustworthy moderator, who is also a consistent contributor to the code g...

posted 4y ago by Razetime‭

Answer
75%
+4 −0
Challenges Tile pyramids on top of each other!

The task Given a positive integer as input, output tiled pyramids of this height. How? Let's say the inputted integer was n. From there, we output n lines of output, each having: A decreasing...

9 answers  ·  posted 4y ago by Dion‭  ·  last activity 3y ago by emanresu A‭

Question code-golf ascii-art
75%
+4 −0
Challenges 1, 2, Fizz, 4, Buzz!

JavaScript (Node.js), 64 bytes for(n=0;101>++n;)console.log([['Fizz'][n%3]]+[['Buzz'][n%5]]||n) Try it online!

posted 4y ago by Hakerh400‭

Answer
75%
+4 −0
Meta What are the rules of programming language compliance?

Regarding because the vast majority of all programs that were posted & highly up-voted there won't even compile on the most basic, compliant compiler for that language. Code Golf allows f...

posted 4y ago by Quintec‭

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

goruby, 1 byte f Okay, so that's a bit unfair. 😂 The definition of f from golf_prelude.rb (which is what goruby embeds) is quite golfy in itself: def f(m = 100) 1.upto(m){|n|puts'FizzBuzz ...

posted 4y ago by C. K. Young‭  ·  edited 4y ago by C. K. Young‭

Answer
75%
+4 −0
Challenges Reverse an ASCII string

Japt, 1 byte w Uh... yeah. Probably similar solutions for many other golf langs. Try it

posted 4y ago by Quintec‭

Answer
75%
+4 −0
Challenges Reverse an ASCII string

C (gcc), 62 bytes main(){char b[99],*p=strchr(gets(b),0);for(;p-->b;)putch(*p);} This relies on the usual gcc extension abuse. It assumes that max user input is 98 characters + null term, si...

posted 4y ago by Lundin‭  ·  edited 3y ago by Lundin‭

Answer
75%
+4 −0
Challenges Roll n fair dice

Python 3, 61 bytes lambda n,m:sum(randint(1,m)for i in[0]*n) from random import* Try it online! This is not an interesting answer as it is just a copy of your code. I tried to do it with ch...

posted 3y ago by bastolski‭

Answer
75%
+4 −0
Challenges Make $2 + 2 = 5$

Vyxal s, 5 bytes 2=A[5 Try it Online! You're not the only one who can abuse flags, Shaggy... 2= # Foreach, is it equal to to? A[ # If all are 2 5 # Push a 5. # (s flag) sum...

posted 3y ago by emanresu A‭

Answer
75%
+4 −0
Challenges Make my value binary

C (gcc), 35 32 bytes Saved 3 bytes thanks to Lundin f(n){n&&f(n/2);putchar(n&1|48);} This solution exploits that leading zeros, while not required, are also not forbidden by the ...

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

Answer
75%
+4 −0
Meta Posting guidelines modifications

Since no one has posited anything yet... I think everything but the last three bullets can be kept. Other than that, we could add in the tips about challenge specifications. Challenges Posting...

posted 3y ago by Moshi‭

Answer
75%
+4 −0
Sandbox Expand a polynomial [FINALIZED]

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

75%
+4 −0
Q&A Tips for golfing in Python

If you print some string s without a newline character at the end, instead of print(s,end="") write print(end=s) to save two bytes. Note that this only works for strings, not for other typ...

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

Answer
75%
+4 −0
Challenges When The Ternary Is Balance

Inspired by this Rosetta Code article. Introduction Balanced Ternary is a method of representing integers using -1, 0 and 1 in base 3. Decimal 11 = (1 * 32) + (1 * 31) + (−1 * 30) = [1,1,-1] or ...

3 answers  ·  posted 3y ago by Razetime‭  ·  last activity 3y ago by Moshi‭

Question code-golf number base
75%
+4 −0
Challenges Create an Alphabet Diamond

JavaScript (Node.js), 78 bytes (m=(a,b=26,c=a(--b))=>b?[c,...m(a,b),c]:[c])=>m(a=>m(b=>(c=25-a-b)<0?32:c+65)) Try it online!

posted 4y ago by Hakerh400‭

Answer
75%
+4 −0
Challenges Create an Alphabet Diamond

Japt -R, 14 13 bytes ;Bãê kb'A û ê Test it Takes all substrings of the alphabet, palindromizes them, and then takes only the ones starting with A and centers and mirrors that too. -1 byte tha...

posted 4y ago by Quintec‭  ·  edited 4y ago by Quintec‭

Answer
75%
+4 −0
Challenges Create an Alphabet Diamond

Canvas, 10 7 6 bytes Z[]/┼┼ Try it here! Creates the top portion, centers it, and mirrors it. -3 bytes from dzaima's hint. -1, found the 6 byter! Explanation Z[]/++ Z push the al...

posted 4y ago by Razetime‭  ·  edited 4y ago by Razetime‭

Answer
75%
+4 −0
Challenges Create an Alphabet Diamond

Stax, 12 bytes ç ∩<▬%▌ê▓jFo Run and debug it Same method as the Canvas answer.

posted 4y ago by Razetime‭

Answer
75%
+4 −0
Challenges Win a War (or at least a few battles)

You have an army of size $n$ that you need to split up to fight $k$ battles simultaneously against an opposing army $A$. In each battle, the army with the most troops present wins - no one wins a t...

2 answers  ·  posted 4y ago by Quintec‭  ·  edited 3y ago by General Sebast1an‭

Question code-golf optimization
75%
+4 −0
Challenges "Hello, World!"

C# 9, 38 bytes System.Console.Write("Hello, World!"); C# Version 9 introduced Top level statements.

posted 4y ago by strom‭

Answer
75%
+4 −0
Challenges "Hello, World!"

QBASIC, 17, 16 bytes ?"Hello, World!" This should work on almost any BASIC interpreter. Thanks to manassehkatz, for the space.

posted 4y ago by strom‭  ·  edited 4y ago by strom‭

Answer