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
Comment Post #284049 @#56561 Indeed. This answer is using gcc as indicated and isn't a strictly conforming answer.
(more)
almost 2 years ago
Comment Post #286377 The challenge explicitly said to produce an infinite loop. Any answer implementing a size parameter is therefore not following the requirement, for that reason alone. I remember misunderstanding it at first and making a solution based on a finite counter based on user input. Perhaps it should have be...
(more)
almost 2 years ago
Edit Post #286293 Post edited:
TIO example contained lots of whitespace for some reason
about 2 years ago
Edit Post #286293 Initial revision about 2 years ago
Answer A: Looping counter
[C (gcc)], 47 bytes i,n;f(){for(i=n+++2;i--;)putchar(i?42:13);f();} Try it online!
(more)
about 2 years ago
Edit Post #285929 Initial revision about 2 years ago
Answer A: Can you give me half?
[C (gcc)], 8 7 unique cos(cos-cos)/(cos(cos-cos)-(-cos(cos-cos))) Try it online! -1 unique character thanks to @orthoplex‭
(more)
about 2 years ago
Edit Post #285263 Post edited:
about 2 years ago
Edit Post #285821 Initial revision about 2 years ago
Question Keyword golfing
Many programming languages have the concept of keywords, special syntax items that are not just identifiers reserved by some library, but words reserved by the language itself. The challenge is to write a minimal program for a language with such keywords, with as few characters as possible (code ...
(more)
about 2 years ago
Comment Post #285675 Sounds fun, I take it the ASCII art will expand in width and size depending on size? I think it probably needs some twist so that it isn't as easy as counting the number of rows and columns. Maybe include different shirt models? Or tops, if shirt models are too tricky to draw in ASCII art? As in "is ...
(more)
over 2 years ago
Edit Post #285263 Initial revision over 2 years ago
Article Keyword golfing [FINALIZED]
Many programming languages have the concept of keywords, special syntax items that are not just identifiers reserved by some library, but words reserved by the language itself. The challenge is to write a minimal program for a language with such keywords, with as few characters as possible (code ...
(more)
over 2 years ago
Comment Post #285064 @#8046 https://tio.run/# for info (click logo upper left corner). They are as far as I can tell a non-profit open source organization just like us, so they should have more in common with Codidact than with SE. I could poke around (they have a chat on SE), but it's probably better if an official repr...
(more)
over 2 years ago
Comment Post #285064 The most common answer form we use here is the tio.run "Code Golf Submission (Stack Exchange)". We could ask them if they would be so kind to update this part to "Code Golf Submission (Stack Exchange or Codidact.com)". A small change that doesn't seem unreasonable and we get free advertising whenever...
(more)
over 2 years ago
Comment Post #284951 @#53588 I suppose these are names (of scores) so the first word should be a capital letter.
(more)
over 2 years ago
Comment Post #284952 A minor (non-conforming) improvement for gcc would be to swap the `char*` with an `int*`. `*t="the whole string";f(p,s){ ...` shaves down 4 bytes.
(more)
over 2 years ago
Edit Post #284951 Initial revision over 2 years ago
Question Golf golf challenge
The task is to create a program which displays a golf score as text. It takes 2 numbers as input, separated by space or new line: - The first number is the par of the specific hole. - The second number is the score that the player got. The program should print the textual golf term for the re...
(more)
over 2 years ago
Edit Post #284852 Post edited:
over 2 years ago
Comment Post #284852 Yes par can only ever be 3, 4 or 5.
(more)
over 2 years ago
Comment Post #284852 @#8056 Thanks, I added one.
(more)
over 2 years ago
Edit Post #284852 Post edited:
over 2 years ago
Edit Post #284852 Initial revision over 2 years ago
Article Golf golf challenge [FINALIZED]
The task is to create a program which displays a golf score as text. It takes 2 numbers as input, separated by space or new line: - The first number is the par of the specific hole. - The second number is the score that the player got. The program should print the textual golf term for the re...
(more)
over 2 years ago
Edit Post #284705 Initial revision over 2 years ago
Answer A: Reactions on Code Golf Codidact
None of these are applicable at least not for Code Golf challenges. I think this community should "opt out" of reactions unless we can come up with more relevant ones. - "Works for me". Answers are supposed to live up to the challenge specification - if they don't, then one should use comments to ...
(more)
over 2 years ago
Edit Post #284534 Post edited:
over 2 years ago
Edit Post #284534 Initial revision over 2 years ago
Answer A: Operation "Find The Operator"
[C (gcc)], 147 151 bytes #define L(X)X(+,a+b)X(-,a-b)X(,ab)X(/,b&&a/b)X(%,b&&a%b)X(^,pow(a,b)) #define M(o,d)printf("%s",d==c?#o" ":z++==5?".":""); z;s[99];f(a,b,c){L(M)} Try it online! Somewhat naive solution with X macros that builds up a string before printing. The `...
(more)
over 2 years ago
Comment Post #284407 In case multiple operators match, shouldn't it print all operators that would give the result. That is, the correct output from `2 2 4` should be `+ *`, or perhaps optionally `* +` (the order doesn't matter as long as it prints all results). This would make quite the difference for the algorithm, sin...
(more)
over 2 years ago
Comment Post #282795 @#8056 But what if the language has it but doesn't use it in the specific program. "Turing machine" is not a description of a programming language, but of a program running on a computer. Also there's the terminology confusion with Turing complete. Again, too vague.
(more)
over 2 years ago
Comment Post #284326 @#8056 That might be true. I just wanted something fairly repetitive, so that it would make sense to "optimize" certain parts of the string printing. Regardless, since Codidact is a non-profit organization and earns no money from the site, I'm not sure how copyright matters long as you state the sour...
(more)
over 2 years ago
Edit Post #284326 Initial revision over 2 years ago
Article Bird is the word
Make a program that prints the lyrics of the first verse of Surfin' Bird by the Trashmen: > A-well-a everybody's heard about the bird B-b-b-bird, b-bird's the word A-well, a bird, bird, bird, bird is the word A-well, a bird, bird, bird, well-a bird is the word A-well, a bird, bird, b...
(more)
over 2 years ago
Edit Post #284106 Initial revision over 2 years ago
Answer A: Repeat the characters
[C (gcc)], 56 bytes i;f(s,n)chars,n;{for(;s;s++)for(i=n;i--;putchar(s));} Try it online! My attempt at recursion ended up at 61 bytes: o;f(s,n)chars,n;{for(o=n;s&&n--;putchar(s));s&&f(++s,o);} I still think there's probably a more elegant way to solve both loops wit...
(more)
over 2 years ago
Comment Post #284084 @#53503 No, or you would be able to read them with an input function the first thing you do when launching a program. Stdin is kind of an artificial concept too, mostly related to old terminal I/O.
(more)
over 2 years ago
Edit Post #284087 Initial revision over 2 years ago
Answer A: Can we have [popularity-contest]s?
Well... maybe not in combination with a code golf challenge, but more like an artistic challenge with some theme, similar to screenshot of the month? For reference see for example Outdoors photo contest or Writing challenges. So rather than giving a detailed specification of what the program must ...
(more)
over 2 years ago
Edit Post #279657 Post edited:
over 2 years ago
Edit Post #279657 Post edited:
over 2 years ago
Comment Post #283946 Not sure what a popularity contest is in this context. Do you mean a leader board based on vote score rather than characters used? Answers are already sorted by vote score by default, I believe.
(more)
over 2 years ago
Edit Post #284084 Initial revision over 2 years ago
Answer A: Default Rules: Code Golf I/O
Command-line arguments may be used as input instead of stdin Languages/systems that support reading input from command-line arguments may use those as input instead of reading from stdin.
(more)
over 2 years ago
Comment Post #282792 I disagree, this isn't necessarily printed anywhere meaningful. I think each challenge needs to explicitly specify that this is are allowed, or it shouldn't be allowed.
(more)
over 2 years ago
Comment Post #282795 While I agree in principle for languages without convenient input, this is too vague to actually be helpful. For example the "tape" could be a previously defined constant, in which case languages which do support stdin would be free to abuse that rather than taking input. Example of such abuse in C l...
(more)
over 2 years ago
Comment Post #284049 @#53588 You can't store input in thin air, you need to allocate memory for it. Otherwise the program might crash arbitrary. Also `[];` isn't valid C.
(more)
over 2 years ago
Edit Post #284049 Initial revision over 2 years ago
Answer A: "Hello, {name}!"
[C (gcc)], 43 bytes a[99];main(){printf("Hello, %s!",gets(a));} Try it online!
(more)
over 2 years ago