Activity for Lundinâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #283267 | Initial revision | — | over 2 years ago |
Answer | — |
A: Tips for golfing in C For the sake of code golf, you first need to decide if you wish to compete in strictly conforming ("real") C, in which case you can't rely on non-standard extensions, poorly-defined behavior or obsolete features. Or you can compete in non-standard extensions (gcc/GNU etc), when whatever binary the... (more) |
— | over 2 years ago |
Edit | Post #283137 |
Post edited: |
— | over 2 years ago |
Edit | Post #283137 |
Post edited: |
— | over 2 years ago |
Comment | Post #283137 |
@#53588 Oh I misunderstood it then. Means I can easily shave this down some more. (more) |
— | over 2 years ago |
Edit | Post #283138 |
Post edited: |
— | over 2 years ago |
Comment | Post #283137 |
@#53588 No idea what you mean. The task is to print a string "true" or "false". (more) |
— | over 2 years ago |
Comment | Post #283138 |
Headers would have given it away, it was already quite easy 🙂 The answer is C or C++. Compiles with gcc default settings. C++ does not need iso646.h I believe. (more) |
— | over 2 years ago |
Edit | Post #282965 |
Post edited: |
— | over 2 years ago |
Suggested Edit | Post #282965 |
Suggested edit: (more) |
helpful | over 2 years ago |
Edit | Post #283138 | Initial revision | — | over 2 years ago |
Answer | — |
A: Guess the language! (Cops' Thread) C or C++ (gcc) 220 bytes, cracked by Razetime %: %: define cops(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) if(not false and k%:%:f%:%:d%:%:l(& (not true) )) %: main() Try it online! Output: ``` Cops and Robbers ``` Some explanation/de-obfuscation: - `%:` ... (more) |
— | over 2 years ago |
Edit | Post #283137 | Initial revision | — | over 2 years ago |
Answer | — |
A: It's Hip to be Square [C (gcc)], 57 64 bytes x,s;main(){scanf("%d",&x);s=sqrt(x);printf("%d",ss==x);} Try it online! (more) |
— | over 2 years ago |
Comment | Post #282482 |
@#8046 I think the most sensible implementation would be that each community can decide which categories that should use rep or not. Meta being one (perhaps set to no rep by default?), another example is sandbox categories like here on Code Golf. (more) |
— | almost 3 years ago |
Comment | Post #282477 |
@#54114 If you post it under Code Review, there doesn't need to be a specific problem to solve. Rather you are expected to post complete & working code. If you are extra curious about for example portability or performance or style etc you can mention it in the question though, as that tells reviewer... (more) |
— | almost 3 years ago |
Comment | Post #282491 |
@#53501 Except it is listed as C (clang). And with the new scoreboard system, it bumps away all solutions that _are_ actually C (clang). (more) |
— | almost 3 years ago |
Comment | Post #282491 |
@#54114 In this case you should add the function/function-like macro used. Otherwise anyone can just use the "`M` library" from my example for any single challenge. (more) |
— | almost 3 years ago |
Comment | Post #282239 |
Couldn't we have Codidact-specific challenges. Recreating the [Mathematics logo](https://codidact.com/community-assets/math/logo-large.png) sounds like fun but tricky challenge. (more) |
— | almost 3 years ago |
Comment | Post #282482 |
@Monica Cellio Isn't the issue here rather that the various metas shouldn't count rep of the main site. The posts proposed here would sit on meta. Other than that, I don't have any problem personally with giving a lot of rep to someone who makes the effort to draft up these rules in detail per langua... (more) |
— | almost 3 years ago |
Comment | Post #282477 |
There's a lot of issues with the library - most notably you should never define functions inside header files. I'd recommend to post it for Code Review at https://software.codidact.com/categories/44 (more) |
— | almost 3 years ago |
Edit | Post #282491 | Initial revision | — | almost 3 years ago |
Answer | — |
A: 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 though... you'd be golfing "single player". Your answer here is doesn't use the library and is agains... (more) |
— | almost 3 years ago |
Edit | Post #282446 |
Post edited: Better solution |
— | almost 3 years ago |
Edit | Post #282446 | Initial revision | — | almost 3 years ago |
Answer | — |
A: Evens or Odds - you know this one [C (gcc)], 20 bytes f(a){puts("!"+a%2);} Try it online! Function solution. Prints `!` in case of even numbers, otherwise just new line. (more) |
— | almost 3 years ago |
Comment | Post #282345 |
I posted a solution too, just for reference. Would this challenge be interesting in other languages too? (more) |
— | almost 3 years ago |
Edit | Post #282345 |
Post edited: |
— | almost 3 years ago |
Edit | Post #282345 |
Post edited: |
— | almost 3 years ago |
Edit | Post #282345 |
Post edited: |
— | almost 3 years ago |
Comment | Post #282345 |
Curious to see how this turns out. Wasn't sure if I should restrict it to 15 or go with 100. The snippets would turn rather long in that case. Is this challenge sensible in a lot of different languages? The language won't need a line number counting feature, though it probably helps. (more) |
— | almost 3 years ago |
Edit | Post #282345 | Initial revision | — | almost 3 years ago |
Article | — |
FizzBuzz based on line count Background The normal "FizzBuzz" task is to create an up-counting loop which prints "Fizz" in case the count is divisible by 3 or "Buzz" in case the count is divisible by 5. Consequently, "FizzBuzz" for numbers like 15 that are divisible by both. Task The task is to write a solution which pr... (more) |
— | almost 3 years ago |
Comment | Post #281029 |
CD is an abbreviation for Codidact now? :( Aargh... I'm allergic to strange abbreviations. Especially of the kind that are already taken by Compact Disc. (more) |
— | almost 3 years ago |
Comment | Post #281542 |
You need to specify if these strings are taken as program input or if they can be constants. For example in C, you can merge two string literals by just typing `"ABC" "DEF"`. But to merge strings taken as input in run-time, it turns much more intricate. (more) |
— | about 3 years ago |
Comment | Post #279722 |
@trichoplax. This one already went live [here](https://codegolf.codidact.com/posts/279820). And we still need a way to formalize moving things from sandbox to live challenge... guess I should mark it as "finalized" like some people do. As for the link, Roman numbers should be common knowledge really.... (more) |
— | about 3 years ago |
Edit | Post #280766 |
Post edited: |
— | about 3 years ago |
Edit | Post #280766 |
Post edited: |
— | about 3 years ago |
Edit | Post #280766 | Initial revision | — | about 3 years ago |
Answer | — |
A: 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 where the register map is included but not counting as part of the solution. Other than that, ban all ... (more) |
— | about 3 years ago |
Edit | Post #280668 |
Post edited: |
— | about 3 years ago |
Edit | Post #280668 | Initial revision | — | about 3 years ago |
Answer | — |
A: Write a Deadfish Interpreter [C (gcc)], 153 bytes a,b;f(chars){for(charc,o="idso";s;s++)for(c=o;c;c++)s==c&&(b=c-o,a+=!b,a-=b==1,b==2?a=a:0,b==3&&printf("%d%c",a,s[1]?44:10),a==-1|a==256?a=0:0);} Try it online! Function solution, misc gcc abuse. (more) |
— | about 3 years ago |
Comment | Post #280408 |
@Hakerh400 Ok. I have a feeling overall that these requirements would rule out a lot of languages, why I never posted it. (more) |
— | over 3 years ago |
Comment | Post #280408 |
@Hakerh400 How so? It's pretty clear what a comment consists of in most languages? (more) |
— | over 3 years ago |
Comment | Post #280408 |
The only requirement is that the symbols must visually appear as "ABC..." etc and the underlying encoding symbol table doesn't matter. (more) |
— | over 3 years ago |
Comment | Post #280408 |
@DJMcMayhem†Yeah it won't be possible to solve this challenge in Brainfuck and similar languages. (more) |
— | over 3 years ago |
Comment | Post #280408 |
@Razetime I think we should allow any source code format? (more) |
— | over 3 years ago |
Comment | Post #280408 |
Curious to know how if the 26 line requirement holds in plenty enough different languages or if too many languages enforces either stand-alone symbol-only lines, or non-alphabetic order (for example VB `Private Sub... End` wouldn't work since that language enforces line feed formatting with `End` on ... (more) |
— | over 3 years ago |
Edit | Post #280408 | Initial revision | — | over 3 years ago |