Activity for Lundin
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #282491 | Initial revision | — | over 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 doesn't use the library and is against t... (more) |
— | over 3 years ago |
Edit | Post #282446 |
Post edited: Better solution |
— | over 3 years ago |
Edit | Post #282446 | Initial revision | — | over 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) |
— | over 3 years ago |
Comment | Post #282345 |
I posted a solution too, just for reference. Would this challenge be interesting in other languages too? (more) |
— | over 3 years ago |
Edit | Post #282345 |
Post edited: |
— | over 3 years ago |
Edit | Post #282345 |
Post edited: |
— | over 3 years ago |
Edit | Post #282345 |
Post edited: |
— | over 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) |
— | over 3 years ago |
Edit | Post #282345 | Initial revision | — | over 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) |
— | over 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) |
— | over 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) |
— | over 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) |
— | over 3 years ago |
Edit | Post #280766 |
Post edited: |
— | almost 4 years ago |
Edit | Post #280766 |
Post edited: |
— | almost 4 years ago |
Edit | Post #280766 | Initial revision | — | almost 4 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) |
— | almost 4 years ago |
Edit | Post #280668 |
Post edited: |
— | almost 4 years ago |
Edit | Post #280668 | Initial revision | — | almost 4 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) |
— | almost 4 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) |
— | almost 4 years ago |
Comment | Post #280408 |
@Hakerh400 How so? It's pretty clear what a comment consists of in most languages? (more) |
— | almost 4 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) |
— | almost 4 years ago |
Comment | Post #280408 |
@DJMcMayhem Yeah it won't be possible to solve this challenge in Brainfuck and similar languages. (more) |
— | almost 4 years ago |
Comment | Post #280408 |
@Razetime I think we should allow any source code format? (more) |
— | almost 4 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) |
— | almost 4 years ago |
Edit | Post #280408 | Initial revision | — | almost 4 years ago |
Article | — |
Print the alphabet using alphabetic source The task is to write a program that takes no input and prints the English alphabet in upper-case letters. It can be printed either as a single line `ABCDEFGHIJKLMNOPQRSTUVWXYZ`, or as letters separated by spaces, or as letters separated by new line. This is code golf, so the shortest program in e... (more) |
— | almost 4 years ago |
Comment | Post #279883 |
Covid 19 holidays happened unfortunately, I had no time to post this before xmas. (more) |
— | almost 4 years ago |
Edit | Post #280390 |
Post edited: |
— | almost 4 years ago |
Edit | Post #280390 | Initial revision | — | almost 4 years ago |
Answer | — |
A: Truthify an array [C (gcc)], 100 bytes i,j;f(x,y,p)intp;{puts("[");for(;i<x;i++)for(j=0;j<y;j++)p++&&printf("[%d,%d],",i,j);puts("\b]");} Try it online! Note that TIO console doesn't handle backspace properly. (more) |
— | almost 4 years ago |
Comment | Post #280343 |
"We can't currently vary properties of post types per category" This is strange though. The various metas shouldn't give rep IMO and that's a much bigger issue than the sandbox category on some sites. (more) |
— | almost 4 years ago |
Comment | Post #280242 |
I think test cases (such as examples of input/output) should not only be encouraged but mandatory. An example snippet of a non-golfed version in some common programming language is encouraged, as discussed [here](https://codegolf.codidact.com/posts/279635). (more) |
— | almost 4 years ago |
Edit | Post #280306 | Initial revision | — | almost 4 years ago |
Answer | — |
A: Tile pyramids on top of each other! C (compliant), 106 bytes char r,i,s[80];void f(int n){memset(s,32,79);for(;r<n;puts(s),r++)for(i=0;i++<n2;s[n-r-1]=47,s[n+r]=92);} Try it online! Standard C compliant function solution. (more) |
— | almost 4 years ago |
Comment | Post #279883 |
@Razetime That's kind of the core of this whole silly joke :) Tannenbaum = Christmas tree in German, though it could as well have been the name of some less famous computer scientist :) O Tannenbaum refers to a famous Christmas carol, etc. (more) |
— | almost 4 years ago |
Comment | Post #279883 |
Would appreciate some feedback on this! Is it too confusing? Too silly? Could I clarify it? Or draw ASCII art prettier somehow? (more) |
— | almost 4 years ago |
Edit | Post #279883 | Initial revision | — | almost 4 years ago |
Article | — |
The Tannenbaum series A series of 7 single digits, that if added in sequence to create an unbalanced binary search tree, is considered a Tannenbaum series, in case: - the left branch of the root has depth 3 and consists of ever-increasing numbers, and - the right branch of the root has depth 3 and consists of ever-de... (more) |
— | almost 4 years ago |
Edit | Post #279856 |
Post edited: Save 1 space by moving return inside the x macro list |
— | almost 4 years ago |
Comment | Post #279856 |
Amusingly, this is "Y macros", not "X macros"... because X didn't sit well with Roman numerals. I got trouble in one version of the code that used `X(10,X)` :) (more) |
— | almost 4 years ago |
Edit | Post #279856 | Initial revision | — | almost 4 years ago |
Answer | — |
A: Integer to Roman numeral C (compliant), 197 198 bytes. Golfed version of the function in the question, using X macros: ```c #define L Y(1000,M)Y(900,CM)Y(500,D)Y(400,CD)Y(100,C)Y(90,XC)Y(50,L)Y(40,XL)Y(10,X)Y(9,IX)Y(5,V)Y(4,IV)Y(1,I)return r; #define Y(n,R)for(;v>=n;v-=n)strcat(r,#R); char r[99];charf(int v)... (more) |
— | almost 4 years ago |
Edit | Post #279820 | Initial revision | — | almost 4 years ago |
Question | — |
Integer to Roman numeral The task is to take a decimal integer as input and print the corresponding Roman numeral with capital letters. The program must handle all positive integer numbers between 1 and 1000. Input can be assumed to be correct and no error handling is necessary. Example data: ``` Input Output 1 ... (more) |
— | almost 4 years ago |
Edit | Post #279817 | Initial revision | — | almost 4 years ago |
Answer | — |
A: "Hello, World!" LOLCODE, 37 bytes HAI 1 VISIBLE "Hello, World!" KTHXBYE Try it online! (more) |
— | almost 4 years ago |