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 »

Activity for Lundin‭

Type On... Excerpt Status Date
Answer A: 1, 2, Fizz, 4, Buzz!
C (gcc), 108 bytes ```c h,i;main(){for(;i++<100;){char s[]="%dFizzBuzz ",b=i%5;h=s+2;printf(s+(i%3?b?h=32,0:6:b?h[1]=32,2:2),i);}} ``` Godbolt. Works on clang too. Contains some serious abuse of all that is holy: gcc extensions, misaligned writes, endianess, poorly-defined behavior... New...
(more)
over 3 years ago
Comment Post #279479 Then maybe the Q&A category needs to be "seeded" with some example questions so that people understand what it's for. The current help for categories and FAQ on this site isn't helpful.
(more)
over 3 years ago
Comment Post #279467 Seems to me like the majority of such questions should be asked on meta rather than Q&A. Otherwise this site has main site + 2 layers of meta...
(more)
over 3 years ago
Edit Post #279466 Initial revision over 3 years ago
Answer A: 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?
(more)
over 3 years ago
Comment Post #279382 But essentially they are lying just to pose and feel good about themselves. If you post an ill-formed, non-conforming program in "language X", that also relies on non-standard extensions, you are actually not programming in language X but in something else. That gives them an unfair advantage to thos...
(more)
over 3 years ago
Comment Post #279408 default-rules then?
(more)
over 3 years ago
Edit Post #279461 Post edited:
over 3 years ago
Edit Post #279461 Initial revision over 3 years ago
Answer A: Bytes to Segfault
C (compliant), 19 bytes (`gcc -std=c18 -pedantic-errors`) ```c int main(){main();} ``` Godbolt
(more)
over 3 years ago
Comment Post #279408 This sounds reasonable enough, especially if help files can get kept up to date to match community consensus on meta. Maybe "code-golf-rules" or "challenge-rules" are better tag names though? Since standards might be confused with formal language standards.
(more)
over 3 years ago
Comment Post #279426 Apart from using deprecated gcc extensions, this is non-conforming/ill-formed C++ with several constraint violations.
(more)
over 3 years ago
Comment Post #279382 Again, "it generated a binary" is a horrible rationale, particularly in C and C++ languages. [What must a C compiler do when it finds an error?](https://software.codidact.com/q/277340).
(more)
over 3 years ago
Comment Post #279382 @moony So code golf is all about abusing undefined behavior then find some crapiler that will crapile the code into a non-conforming binary in another non-standard language than the one stated?
(more)
over 3 years ago
Comment Post #279382 @Quintec‭ Nope, it's too much spyware for me. Anyway, other users might want to read these comments too.
(more)
over 3 years ago
Comment Post #279382 @dzaima Freestanding mode doesn't mean changing the system or standard lib behavior. It means running programs without the need for an OS, or run a program that is the OS. For this reason, such programs are not called by an OS, but by hardware, such as a power-on reset interrupt vector. This means th...
(more)
over 3 years ago
Comment Post #279382 "UB doesn't matter if the answer works" The very definition of UB is that you can't prove that something isn't UB with "it seems to be working just fine". [What is undefined behavior and how does it work?](https://software.codidact.com/q/277486)
(more)
over 3 years ago
Comment Post #279382 "but won't actually compete with GCC/clang" Sure, just run a freestanding port of gcc, which is not a special compiler option, but one of two modes supported: hosted and freestanding. GCC defaults to hosted on hosted systems, but not necessarily so on freestanding systems. `x(){puts("Hello, World!")...
(more)
over 3 years ago
Comment Post #279382 "it works fine on GCC and clang" No it doesn't, it produces numerous diagnostics on both compilers. See [What must a C compiler do when it finds an error?](https://software.codidact.com/q/277340). What they are executing is not C, but non-standard extensions.
(more)
over 3 years ago
Comment Post #279386 My point is - your lambda won't run as-is, you need to wrap it in some other code not present. How is that different from calling a function not present?
(more)
over 3 years ago
Comment Post #279382 And then C has also since the dawn of time allowed freestanding systems with implementation-defined forms to replace main(). So I just need to find some embedded system's compiler that uses the form `x()` instead of main() and now I will win every competition. I can't do that if programs are to be _s...
(more)
over 3 years ago
Comment Post #279386 With that rationale, what prevents me from just posting a `stuff()` function call as an answer to everything and claim that the implementation of that function is found in another part of the project? Because a single function containing nothing but a function call to another function is very valid i...
(more)
over 3 years ago
Comment Post #279382 As for the "hello world" example in C, it is a perfect example. On SE code golf you have `main(){puts("Hello, World!");}` highly up-voted. But it will not compile on a single reasonable C compiler ever made, because it lacks `#include <stdio.h>`. Furthermore, it will not compile on any modern standar...
(more)
over 3 years ago
Comment Post #279382 First of all: says who? Where is this written? I can't find anything in a help file anywhere. Specifically, we can't use silent or written community consensus of some other (non-Codidact) community as basis for how to ask questions on this new community here.
(more)
over 3 years ago
Edit Post #279375 Initial revision over 3 years ago
Question What are the rules of programming language compliance?
Code Golf seems like a fun idea to me, since I'm a programmer by trade and "language lawyer" nerd as a hobby. But every time I checked the code golf site on SE, I dismissed it as nonsense, because the vast majority of all programs that were posted & highly up-voted there won't even compile on the...
(more)
over 3 years ago