Activity for celtschkâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #287387 |
What character set are you using that those three characters fit in three bytes?
(more) |
— | over 1 year ago |
Edit | Post #287392 |
Post edited: Explanation |
— | over 1 year ago |
Edit | Post #287392 | Initial revision | — | over 1 year ago |
Answer | — |
A: Digit antitranspose [Python 3], 35 bytes lambda m:list(zip(m[::-1]))[::-1] Try it online! The format is a list of tuples. The content of the tuples could be any type; in my tests I used single-digit strings because I was lazy when writing the testing code. `seq[::-1]` reverses a sequence (tuple ot l... (more) |
— | over 1 year ago |
Edit | Post #287391 | Initial revision | — | over 1 year ago |
Answer | — |
A: Encode with ROT13.5 [Bash], 31 bytes tr a-zA-Z0-9 n-za-mN-ZA-M5-90-4 Try it online! (more) |
— | over 1 year ago |
Edit | Post #287294 |
Post edited: |
— | over 1 year ago |
Edit | Post #287294 | Initial revision | — | over 1 year ago |
Answer | — |
A: Thoughts on hiding challenge sections with expandable details tags I think everything strictly needed to write or judge a solution should never be hidden. If you feel it is too large, think about how to shorten it. Information that is not strictly necessary can be hidden if large. This includes background information that, while in principle necessary for the cha... (more) |
— | over 1 year ago |
Comment | Post #287054 |
This gives 3 for input 10: should be 2. (more) |
— | over 1 year ago |
Edit | Post #287052 | Initial revision | — | over 1 year ago |
Answer | — |
A: Presumptuous base conversion [C (gcc)], 117 bytes b,r;f(chars){charp=s;for(;p;p++)p-=47+7(p>57),b=b<p?p:b;if(b<2)return p-s;for(;s;s++)r=b,r+=s-1;return r;} Try it online! (more) |
— | over 1 year ago |
Comment | Post #287050 |
It is customary here that if you improve the code, you show the previous byte count in strike-through before the new byte count. See e.g. [Shaggy's JavaScript answer](https://codegolf.codidact.com/posts/287035/287045#answer-287045) for an example. Note that the leaderboard correctly identifies the va... (more) |
— | over 1 year ago |
Comment | Post #287044 |
Indeed, it can be seen from the description of the code: The result with ordinary conversion is zero if and only if all digits are zero. In that case, the second operand of or applies, which is just the length. Very clever.
(more) |
— | over 1 year ago |
Comment | Post #287044 |
This doesn't correctly handle the unary special case. (more) |
— | over 1 year ago |
Comment | Post #287040 |
I think it would make sense to set a limit on the inputs the program needs to handle. For example, a limit on the maximal length of the input, or on the maximal produced numerator and denominator. (more) |
— | over 1 year ago |
Comment | Post #287026 |
Note that there's [another meta post](https://codegolf.codidact.com/posts/283917) relevant in this context.
(more) |
— | over 1 year ago |
Comment | Post #287005 |
My take on the sandbox questions:
* I think empty input should be allowed, with truthy value.
* I think allowing other forms of input is a good idea. In particular, I would allow lists/arrays of strings, and 2D arrays of characters.
* An upper limit in the size the program needs to han... (more) |
— | over 1 year ago |
Comment | Post #287005 |
You didn't specify what should happen if there are more than two letters in the input, e.g.
```
aabbcc
aabbcc
```
I guess the intention is that this would be a falsy result, but you didn't specify.
**Edit:** I now notice that there are test cases for that; however explicitly stating it would ... (more) |
— | over 1 year ago |
Comment | Post #286989 |
Can't you make an exhaustive list of all potential solutions? (more) |
— | over 1 year ago |
Comment | Post #286882 |
How is this 5 bytes?
I count 12 letters, each of which requires one byte. (more) |
— | over 1 year ago |
Comment | Post #286362 |
But the task asks for integers ($\mathbb Z$), not natural numbers ($\mathbb N$). Thus the code should give $(-2)+(-2)=-4$ while yours gives $(-2)+(-2)=5$. (more) |
— | over 1 year ago |
Edit | Post #286804 | Initial revision | — | over 1 year ago |
Answer | — |
A: Cumulative Counts [Python 3], 74 bytes def f(a): d={x:0 for x in a};r=[] for x in a:d[x]+=1;r+=[d[x]] return r Try it online! (more) |
— | over 1 year ago |
Edit | Post #283974 |
Post edited: Saved two bytes |
— | almost 2 years ago |
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) |
— | almost 2 years ago |
Edit | Post #286526 | Initial revision | — | almost 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) |
— | almost 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) |
— | almost 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) |
— | almost 2 years ago |
Edit | Post #286401 | Initial revision | — | almost 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) |
— | almost 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) |
— | almost 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) |
— | almost 2 years ago |
Edit | Post #286377 | Initial revision | — | almost 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) |
— | almost 2 years ago |
Edit | Post #286240 |
Post edited: finalized |
— | about 2 years ago |
Edit | Post #286280 | Initial revision | — | about 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) |
— | about 2 years ago |
Edit | Post #286239 |
Post edited: Added explanation |
— | about 2 years ago |
Edit | Post #286244 | Initial revision | — | about 2 years ago |
Answer | — |
A: Reverse an ASCII string SOS, 76 bytes +>+>????????{>!!!!!!!!<<-) (more) |
— | about 2 years ago |
Edit | Post #286240 |
Post edited: Edited to allow characters other than asterisk |
— | about 2 years ago |
Comment | Post #286240 |
Any printable, non-whitespace character should do. I'll edit accordingly. (more) |
— | about 2 years ago |
Edit | Post #286240 |
Post edited: Mark the output as text |
— | about 2 years ago |
Edit | Post #286240 | Initial revision | — | about 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) |
— | about 2 years ago |
Edit | Post #286239 |
Post edited: Fixed formatting |
— | about 2 years ago |
Edit | Post #286239 | Initial revision | — | about 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) |
— | about 2 years ago |