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 »

Posts by Lundin‭

61 posts
60%
+1 −0
Meta Microcontroller-involving challenges and the rules.

For this to work, I think we need to rule out all start-up code (the C runtime) but also the register maps. So I think answers should be a void main (void){ ... } (or equivalent) function solution ...

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

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%
+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%
+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
Challenges Keyword golfing

C (gcc), 358 bytes static inline _Noreturn float f(union u);extern _Thread_local _Complex long double*restrict B;main(void){_Atomic register enum {A};typedef _Alignas(unsigned char)struct S;_Sta...

posted 2y ago by Lundin‭  ·  edited 1y ago by Lundin‭

Answer
50%
+0 −0
Challenges Make a frequency table (histogram)

C (gcc), 45, 42 bytes t[9999];f(s,a)int*a;{for(;s;)t[a[--s]]++;} Try it online! Assumptions: Passing the array size to a function can be used as a means to deal with empty arrays (not s...

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

Answer
50%
+0 −0
Challenges "Hello, World!"

C (gcc), 30 bytes main(){puts("Hello, World!");} Try it online! This is using GNU C extensions. GNU C allows main() over int main(), ss well as using puts without including stdio.h.

posted 6mo ago by Lundin‭

Answer
50%
+0 −0
Challenges Display a Progress Bar

C (gcc), 88 bytes char a[53]={91},*p=a+1,i;f(n,d){for(;i<50;)p[i++]=1.*n/d<=i/50.?45:124;p[i]=93;puts(a);} Try it online! There's two approaches to this in C that I came up with - eith...

posted 19h ago by Lundin‭

Answer
40%
+0 −1
Meta What is the Q&A category for?

I was thinking the same thing. Maybe instead there should be one category for code golf and leave the main Q&A is for other types of challenges and puzzles?

posted 4y ago by Lundin‭

Answer
37%
+1 −3
Meta Rules for function submissions

Function parameters should not be allowed to be used in place of a return value. Reasons: Terms like return value and function result are explicitly specified as a specific, formal language i...

posted 2y ago by Lundin‭

Answer