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
 
50%
+1 −1
Meta Default Rules: Extensions

Implementation defines the language, so if you use extensions to a language, you should add + ... extensions to the header. E.g. for a C post using gcc extensions, the header begin with # C (gcc...

posted 3y ago by Moshi‭

Answer
50%
+1 −1
Meta Default Rules: Extensions

The C (gcc) implies extensions - it will only work with that specific compiler under it's default setting GNU17 (equivalent to -std=gnu17), which is mostly a superset of standard C. This also inclu...

posted 3y ago by Lundin‭

Answer
50%
+0 −0
Meta Add detailed wikis and usage info on these tags

graphical-output Usage info: Graphical output challenges involve outputting images or illustrations using graphics. Detailed wiki: (uses text from CGCC's) Graphical output challenges invol...

posted 3y ago by General Sebast1an‭

Answer
50%
+0 −0
Challenges Evaluate a single variable polynomial equation

Python 3, 167 127 118 117 94 63 bytes def f(a,b): y=0 for z in range(len(a)):y+=a[z]*b**z print(y) Try it online! Close gap to @user's lambda answer! Golfed 40 bytes thanks to @user's...

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

Answer
50%
+0 −0
Challenges Getting perfect squares, differently

C (clang), 47 45 43 bytes i,j;main(){for(;printf("%i ",i-=~j);j+=2);} Try it online! Golfed 2 bytes from inspiration of @Shaggy's answer. Golfed 2 bytes by @m90.

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

Answer
50%
+0 −0
Q&A Tips for golfing in C

Abuse (as few) libraries (as possible) We don't want to use too much libraries when playing challenges. Sometimes, libraries aren't used at all in some answers in C. What if we want to shorten so...

posted 3y ago by General Sebast1an‭

Answer
50%
+0 −0
Challenges Getting perfect squares, differently

Python 3, 34 bytes x=0;y=1 while 1:x+=y;print(x);y+=2 Try it online! 1 is the int equivalent to True, which helps save bytes.

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

Answer
50%
+0 −0
Meta Allow linking account with Code Golf Stack Exchange [duplicate]

In my user preferences in "Edit Profile", under the "Link Stack Exchange Account" heading, this shows up: An association with Code Golf Stack Exchange needs to be added for this site.

1 answer  ·  posted 3y ago by Razetime‭  ·  closed as duplicate 3y ago by Mithical‭

Question support discussion
50%
+0 −0
Challenges Bytes to Segfault

Swift 5.4, 17 bytes func f(){f()};f() Pretty simple. It just calls itself until it stack overflows. You need to compile and run it, not just do it in the REPL, because the REPL just drops you b...

posted 3y ago by forestbeasts‭

Answer
50%
+0 −0
Challenges Shape of an array

JavaScript (Node.js), 51 bytes n=[];f=(a)=>a&&a.map?(n.push(a.length),f(a[0]),n):n Run f on your input, e.g. f([[],[]]). Explanation: n=[]; // make a global array to hold the res...

posted 3y ago by forestbeasts‭

Answer
50%
+0 −0
Challenges Prime Difference

JavaScript (Node.js), 81 bytes d=(p,i=2)=>i<p?!(p%i)||d(p,i+1):0 f=(n,a=2,p=a+1)=>d(p)?f(n,a,p+1):p-a<n?f(n,p):a Try it online! Explanation: d is a helper function that returns t...

posted 4y ago by Moshi‭

Answer
50%
+0 −0
Challenges Prime Difference

C (gcc), 126 129 bytes N=9999;f(n){int p[N],i,j,P;memset(p,1,N);for(i=P=2;i*i<N;i++)if(p[i]){for(j=i*i;j<N;j+=i)p[j]=0;i-P>=n?j=N:(P=i);}e:return P;} Try it online! This is an integer...

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

Answer
50%
+0 −0
Challenges Backspace an array

Husk, 6 bytes Fo+hx0 Try it online! there's got to be a smarter way to do this with grouping.

posted 3y ago by Razetime‭

Answer
50%
+0 −0
Challenges Evaluation order of an APL n-train

Husk, 8 bytes ηÖ↔mo⌈½ŀ Try it online! Same idea as xash's answer from CGCC.

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

Answer
50%
+0 −0
Challenges Backspace an array

Japt, 9 bytes ô rÈÔÅÔcY Try it or run all test cases ô rÈÔÅÔcY :Implicit input of array ô :Split on falsey elements (i.e., 0) r :Reduce by È :Passing...

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

Answer
50%
+0 −0
Challenges Prime Difference

Japt, 15 14 bytes @§XnÈj}aX+j}a2 Try it or run all test cases @§XnÈj}aX+j}a2 :Implicit input of integer U @ :Function taking an integer X as argument § ...

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

Answer
50%
+0 −0
Sandbox Recreate modulo [cancelled]

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

Article code-golf math
50%
+0 −0
Challenges Create a Sudoku

Japt, 10 bytes Outputs a 2D-array. 9õ ñu3 £éX Try it 9õ ñu3\n£éX 9õ :Range [1,9] ñ :Sort by u3 : Mod 3 of each \n :Assign to variabl...

posted 3y ago by Shaggy‭

Answer
50%
+0 −0
Challenges Evens or Odds - you know this one

Python 3, 51 25 bytes n=int(input());print(n%2) Try it online! Golfed 26 bytes using the technique from my PHP answer.

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

Answer
50%
+1 −1
Meta Is my extension-like library allowed to be used in answers?

If you actually use the library, sure, I guess. How you are going to get it running on online compilers, I have no idea. It's very uninteresting for others to view some code using a custom library ...

posted 3y ago by Lundin‭  ·  edited 6mo ago by Timwi‭

Answer
50%
+0 −0
Challenges Reverse an ASCII string

Standard ML, 23 bytes implode o rev o explode

posted 1y ago by qwr‭

Answer
50%
+0 −0
Challenges Digit Sum Integer Sequence (working title)

Dyalog APL, 23 bytes {⍵+(⌈/+⌊/)10⊥⍣¯1⊢⍵}⍣⎕⊢1­⁡​‎‎⁡⁠⁢⁢⁢‏⁠‎⁡⁠⁢⁢⁣‏‏​⁡⁠⁡‌⁢​‎⁠⁠‎⁡⁠⁢⁡⁤‏⁠‎⁡⁠⁢⁢⁡‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁢‏⁠‎⁡⁠⁣‏‏​⁡⁠⁡‌⁤​‎⁠‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏⁠‎⁡...

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

Answer
50%
+0 −0
Sandbox Single character Roman numeral [FINALIZED]

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

50%
+0 −0
Sandbox A word suggester [FINALIZED]

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