Activity for celtschkâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #292936 |
I don't know how to test this (in the linked web site, I don't see an execute button, nor a place to put the arguments), but from the description, I doubt that it gets the rounding right. Does 2/3 really give the output from Example 2, not one bar less? (more) |
— | 10 days ago |
Edit | Post #292945 | Initial revision | — | 11 days ago |
Answer | — |
A: Display a Progress Bar [Python 3], 48 bytes def f(n,d):return f"[{(50n+d//2)//d'|':-<50}]" Try it online! (more) |
— | 11 days ago |
Comment | Post #292920 |
I think it is too restricting: You might not use a built-in rounding (and there might not be any defined to begin with; for example, C always truncates on converting to int; esoteric programming languages may not even have floating point to begin with). I think the challenge should just allow for any... (more) |
— | 15 days ago |
Edit | Post #292893 | Initial revision | — | 24 days ago |
Answer | — |
A: Advice for hosting a language agnostic King of the Hill contest Contestants should read from standard input and write to standard output. This is because almost all programming languages, including most esoteric programming languages, allow reading from standard input and writing to standard output. Especially for esoteric programming languages, this is commonly ... (more) |
— | 24 days ago |
Comment | Post #288397 |
Main disadvantage would be that it restricts to languages that tio.run supports. Which certainly is a lot of them, but not all of them. What if you want to add a Scratch entry? (more) |
— | about 1 month ago |
Edit | Post #292788 |
Post edited: Improved Python code |
— | about 1 month ago |
Comment | Post #287082 |
What are the *exact* directions those compass points correspond to? (more) |
— | about 1 month ago |
Comment | Post #292000 |
It can happen e.g. if one sphere has the negative x value from the other, y, z and r are equal for both, and they are large enough to overlap. I didn't check any test cases for this. (more) |
— | about 1 month ago |
Comment | Post #292000 |
What is he range of z values? (more) |
— | about 1 month ago |
Comment | Post #292000 |
What should happen when two spheres are hit at the same distance? (more) |
— | about 1 month ago |
Edit | Post #292788 |
Post edited: Completed title |
— | about 1 month ago |
Edit | Post #292788 | Initial revision | — | about 1 month ago |
Article | — |
Product of polynomials modulo 2 in integer representation Your task is to implements the product of polynomials modulo 2 $(\mathbb F2[x]$) in integer representation. Background The field $\mathbb F2$ represents the integers modulo 2, or equivalently, the lowest bit of the binary representation of an integer; it only has the values $0$ and $1$. What I ... (more) |
— | about 1 month ago |
Edit | Post #292762 | Initial revision | — | about 1 month ago |
Answer | — |
A: Multiplicative perfection [C (gcc)], 53 bytes This uses the shortcut behaviour of logical or (`||`) to only multiply if it is a divisor; the loop end condition then makes sure it's a proper divisor. i=1;p=1;f(n){for(;i<n;++i)(n%i)||(p=i);return p==n;} Try it online! (more) |
— | about 1 month ago |
Edit | Post #292761 |
Post edited: Added a bit more explanation |
— | about 1 month ago |
Edit | Post #292761 |
Post edited: |
— | about 1 month ago |
Edit | Post #292761 | Initial revision | — | about 1 month ago |
Answer | — |
A: How many odd digits? [C (gcc)], 37 bytes This takes an integer as input. It uses the fact that the last digit is odd if and only if the number is odd, and that integer division by 10 removes the last digit. Testing if the number is odd is by doing bitwise and with 1, which conveniently gives 1 for odd and 0 for eve... (more) |
— | about 1 month ago |
Comment | Post #292376 |
I think you also want to exclude comments, otherwise the simplest solution is to have a single comment containing the full alphabet. That is, the shortest Python solution would be:
```python
#abcdefghijklmnopqrstuvwxyz
``` (more) |
— | about 1 month ago |
Comment | Post #292376 |
Many esoteric languages are obviously excluded. The most obvious example is Peat, which doesn't even characters in the first place, or Whitespace, where all programs consist of, well, whitespace. But also languages with single-letter commands are usually excluded because they typically don't cover th... (more) |
— | about 1 month ago |
Edit | Post #291896 | Initial revision | — | 5 months ago |
Answer | — |
A: The 50 substrings that validate any string of Roman numerals [Bash], 205 bytes for s in C{C{CC,D,M},DC,MC} {CM,DC,D}{D,M} I{C,D,I{II,V,X},L,M,VI,X{C,I,L,V,X}} L{C,D,L,M,XC,XL} MMMM V{C,D,IV,IX,L,M,V,X} X{C{C,D,L,M,X},D,LX,M,X{C,L,XX}} do echo $1|grep -q $s&&echo $s&&exit done echo T The golfing is done mostly in the list of 50 ... (more) |
— | 5 months ago |
Comment | Post #287387 |
What character set are you using that those three characters fit in three bytes?
(more) |
— | about 2 years ago |
Edit | Post #287392 |
Post edited: Explanation |
— | about 2 years ago |
Edit | Post #287392 | Initial revision | — | about 2 years 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) |
— | about 2 years ago |
Edit | Post #287391 | Initial revision | — | about 2 years 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) |
— | about 2 years ago |
Edit | Post #287294 |
Post edited: |
— | about 2 years ago |
Edit | Post #287294 | Initial revision | — | about 2 years 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) |
— | about 2 years ago |
Comment | Post #287054 |
This gives 3 for input 10: should be 2. (more) |
— | about 2 years ago |
Edit | Post #287052 | Initial revision | — | about 2 years 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) |
— | about 2 years 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) |
— | about 2 years 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) |
— | about 2 years ago |
Comment | Post #287044 |
This doesn't correctly handle the unary special case. (more) |
— | about 2 years 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) |
— | about 2 years ago |
Comment | Post #287026 |
Note that there's [another meta post](https://codegolf.codidact.com/posts/283917) relevant in this context.
(more) |
— | about 2 years 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) |
— | about 2 years 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) |
— | about 2 years ago |
Comment | Post #286989 |
Can't you make an exhaustive list of all potential solutions? (more) |
— | about 2 years ago |
Comment | Post #286882 |
How is this 5 bytes?
I count 12 letters, each of which requires one byte. (more) |
— | over 2 years 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 2 years ago |
Edit | Post #286804 | Initial revision | — | over 2 years 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 2 years ago |
Edit | Post #283974 |
Post edited: Saved two bytes |
— | over 2 years ago |