Activity for celtschk
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #286427 |
What should the content of the generated image be? As written, one might completely ignore the image content and generate a blank image of the required size.
And what exactly counts as metadata stored in the image that is used to help the program? If the image format explicitly contains the image ... (more) |
— | over 2 years ago |
Edit | Post #286526 | Initial revision | — | over 2 years ago |
Answer | — |
A: Roll n fair dice [Python 3], 59 bytes lambda n,m:sum(choices(range(m),k=n))+n from random import Try it online! (more) |
— | over 2 years ago |
Comment | Post #286424 |
You don't need the `Floor` here. When dividing an even integer by 2, Mathematica automatically gives an integer. Also, the space in `3 #` is unnecessary. And `#!=1` can be replaced by `#>1`. (more) |
— | over 2 years ago |
Comment | Post #286377 |
I've now added a [separate question](https://codegolf.codidact.com/posts/286401) about whether the tag would be appropriate. (more) |
— | over 2 years ago |
Edit | Post #286401 | Initial revision | — | over 2 years ago |
Question | — |
Does Looping Counter qualify as kolmogorov-complexity? Lundin just suggested in a comment under another question that I tag the challenge Looping Counter as kolmogorov-complexity. Now I'm not sure if it actually qualifies for that tag, for the following reasons: It is an infinite loop producing an infinite output, unlike the existing challenges ... (more) |
— | over 2 years ago |
Comment | Post #286283 |
I just let it run on TIO, and it outputted two of the lines switched. You can easily fix that without changing the length by replacing `&` with `;` which removes the concurrency. (more) |
— | over 2 years ago |
Comment | Post #286377 |
Does kolmogorov-complexity apply to infinite loop output?
Anyway, this question, while referring that specific challenge, is more general: The same would apply e.g. to a challenge where you are asked to calculate something based on a single input variable, and the solution takes a second argument ... (more) |
— | over 2 years ago |
Edit | Post #286377 | Initial revision | — | over 2 years ago |
Question | — |
Under which condition is a function that takes arguments other than those specified by the challenge by itself a valid solution to a challenge? On my challenge Looping Counter there are several entries like this which contains a function which needs to be called with the right parameters to give the correct output. In this particular case, you get the desired output if and only if the function is called as `f(3,2)`; any other call gives a wr... (more) |
— | over 2 years ago |
Edit | Post #286240 |
Post edited: finalized |
— | over 2 years ago |
Edit | Post #286280 | Initial revision | — | over 2 years ago |
Question | — |
Looping counter Looping counter Create an infinite loop that outputs lines of asterisks, with each line containing one more asterisk. Instead of the asterisk, any printable, non-whitespace character can be used. However all lines need to use the same character. The beginning of the output looks like this: ```... (more) |
— | over 2 years ago |
Edit | Post #286239 |
Post edited: Added explanation |
— | over 2 years ago |
Edit | Post #286244 | Initial revision | — | over 2 years ago |
Answer | — |
A: Reverse an ASCII string SOS, 76 bytes +>+>????????{>!!!!!!!!<<-) (more) |
— | over 2 years ago |
Edit | Post #286240 |
Post edited: Edited to allow characters other than asterisk |
— | over 2 years ago |
Comment | Post #286240 |
Any printable, non-whitespace character should do. I'll edit accordingly. (more) |
— | over 2 years ago |
Edit | Post #286240 |
Post edited: Mark the output as text |
— | over 2 years ago |
Edit | Post #286240 | Initial revision | — | over 2 years ago |
Article | — |
Looping counter [FINALIZED] Looping counter Create an infinite loop that outputs lines of asterisks, with each line containing one more asterisk. Instead of the asterisk, any printable, non-whitespace character can be used. However all lines need to use the same character. The beginning of the output looks like this: ```... (more) |
— | over 2 years ago |
Edit | Post #286239 |
Post edited: Fixed formatting |
— | over 2 years ago |
Edit | Post #286239 | Initial revision | — | over 2 years ago |
Answer | — |
A: "Hello, World!" SOS, 155 Bytes !+!-!!+!-!!!!+!!-!!+!-!+!-!+!!-!+!!-!!!+!!-!+!!-!!!+!!-!+!!!!-!!+!-!+!!-!!!!+!-!!!!!!+!-!+!-!+!!!-!+!!-!+!!!!-!+!!!-!!+!-!!+!!-!+!!-!!!+!!-!!+!-!!+!-!!!!+! Explanation: Each `!` outputs a single bit. That bit is 0 if the current stack is empty, and 1 otherwise. Initially t... (more) |
— | over 2 years ago |
Edit | Post #285805 | Initial revision | — | almost 3 years ago |
Article | — |
Word wrap a string Given a string `s` of text and a line length `l`, your task is to word-wrap that text to that line length. Concretely, the given string consists of words separated by single spaces, with no leading or trailing space. The task is then to replace spaces by newlines such that in each line, there are ... (more) |
— | almost 3 years ago |
Comment | Post #285479 |
The straightforward `n%(i*i)==0` would be shorter than your double equality. Moreover, you then could remove the `==0` by replacing `1in` with `0in`, saving another 3 bytes. (more) |
— | almost 3 years ago |
Comment | Post #285479 |
Well, it is a code golf challenge, not a run time challenge.
BTW, I suspect that dividing by all the single factors (your re-assignment of `n`) does *not* make your code faster, but slower. Anyway, it definitely makes it longer. (more) |
— | almost 3 years ago |
Comment | Post #285477 |
I've added a few. (more) |
— | almost 3 years ago |
Comment | Post #285477 |
Thanks for pointing this out; I've added the link to the post. (more) |
— | almost 3 years ago |
Edit | Post #285477 |
Post edited: Added reference to OEIS and test cases |
— | almost 3 years ago |
Edit | Post #285340 |
Post edited: finalized |
— | almost 3 years ago |
Edit | Post #285477 | Initial revision | — | almost 3 years ago |
Question | — |
Determine whether an integer is square-free An integer is called square-free if it is not a multiple of a perfect square other than 1. For example, 42 is square-free, but 44 is not because it is a multiple of the perfect square 4 = 2². Your task is to write a program or function that takes a positive integer, and returns a truthy value if t... (more) |
— | almost 3 years ago |
Edit | Post #285340 | Initial revision | — | almost 3 years ago |
Article | — |
Determine whether an integer is square-free [FINALIZED] An integer is called square-free if it is not a multiple of a perfect square other than 1. For example, 42 is square-free, but 44 is not because it is a multiple of the perfect square 4 = 2². Your task is to write a program or function that takes a positive integer, and returns a truthy value if t... (more) |
— | almost 3 years ago |
Comment | Post #285231 |
If I read the Wikipedia article correctly, there does *not* exist a finite projective plane for each $n$ up to $11$. In particular, $n=6$ and $n=10$ are cases that are known not to work. (more) |
— | almost 3 years ago |
Comment | Post #285273 |
@m90: Thanks, adopted. (more) |
— | almost 3 years ago |
Edit | Post #285273 |
Post edited: Saved 2 bytes thanks to @m90 |
— | almost 3 years ago |
Edit | Post #285139 |
Post edited: Fixed a typo |
— | almost 3 years ago |
Edit | Post #285273 | Initial revision | — | almost 3 years ago |
Answer | — |
A: Find the IP address class [C (gcc)], 64 62 bytes Saved 2 bytes thanks to m90 in the comments. i;f(chars){i=atoi(s)>>4;return'A'+(i&8?i&4?i&2?i%2+3:2:1:0);} Try it online! (more) |
— | almost 3 years ago |
Suggested Edit | Post #285139 |
Suggested edit: Fixed a typo (more) |
helpful | almost 3 years ago |
Comment | Post #284994 |
Your capitalisation is wrong. That's easy to fix in “Hole in one”, but changing the capitalisation of “Double bogey”/“Triple bogey” without changing “Bogey” as well surely makes the code longer. (more) |
— | almost 3 years ago |
Comment | Post #284952 |
Thank you, applied. (more) |
— | almost 3 years ago |
Edit | Post #284952 |
Post edited: Saved two bytes thanks to @m90 in the comments |
— | almost 3 years ago |
Comment | Post #284952 |
I tried it and it doesn't work. Probably because pointer increments cause the wrong address increment that way. (more) |
— | almost 3 years ago |
Edit | Post #284952 | Initial revision | — | almost 3 years ago |
Answer | — |
A: Golf golf challenge [C (gcc)], 133 131 bytes f(p,s){chart="Hole in one\0Albatross\0Eagle\0Birdie\0Par\0Bogey\0Double bogey\0Triple bogey";for(--s?s+=5-p:0;s-=!t++;);puts(t);} Saved two bytes thanks to m90 in the comments. Try it online! (more) |
— | almost 3 years ago |