Activity for celtschk
| Type | On... | Excerpt | Status | Date |
|---|---|---|---|---|
| Edit | Post #294816 | Initial revision | — | 11 months ago |
| Answer | — |
A: Ways to make a cooperative King of the Hill contest What about the following rule: You get points, but your score is not your own points, but the points of the best player below you, or 0 if you are the worst player. Obviously if you are the worst player, you want to increase your own points. But if you are the best player, you definitely want ... (more) |
— | 11 months ago |
| Comment | Post #284061 |
Using the walrus operator for this, you save even more, e.g. instead of `print(*reversed(x),*reversed(y))`, write `print(*(r:=reversed)(x),*r(y))`. (more) |
— | 11 months ago |
| Edit | Post #289921 |
Post edited: One testcase didn't conform to the advertised format (a space was missing) |
— | over 1 year ago |
| Suggested Edit | Post #289921 |
Suggested edit: One testcase didn't conform to the advertised format (a space was missing) (more) |
helpful | over 1 year ago |
| Edit | Post #293263 | Initial revision | — | over 1 year ago |
| Answer | — |
A: Borromean coprimes Python, 89 Bytes ``` import math as m def f(n):return m.gcd(n)==1and all(m.gcd(a,b)!=1for a in n for b in n) ``` Note: The outdated Python interpreter at tio.run won't run this code (nor the ungolfed example code) because it doesn't support gcd with more than 2 arguments. (more) |
— | over 1 year ago |
| Comment | Post #292936 |
I don't like the challenge terms to be changed after examples have been posted (except to clarify the task if the original text was unclear). Even if the change doesn't invalidate examples, it penalises those who took care to implement the previous specification correctly. Definitely in terms of ... (more) |
— | almost 2 years ago |
| Edit | Post #293012 | Initial revision | — | almost 2 years ago |
| Answer | — |
A: Category migration and the sandbox Some additional cosiderations on using the sandbox: First, a migration mechanism might encourage good behaviour, for example by migration being only possible if the post has a minimal score, and/or after the post has been long enough in the sandbox to allow other users a chance to see it (of c... (more) |
— | almost 2 years ago |
| 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) |
— | almost 2 years ago |
| Edit | Post #292945 | Initial revision | — | almost 2 years 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) |
— | almost 2 years 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... (more) |
— | almost 2 years ago |
| Edit | Post #292893 | Initial revision | — | almost 2 years 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 commo... (more) |
— | almost 2 years 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) |
— | almost 2 years ago |
| Edit | Post #292788 |
Post edited: Improved Python code |
— | almost 2 years ago |
| Comment | Post #287082 |
What are the *exact* directions those compass points correspond to? (more) |
— | almost 2 years 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) |
— | almost 2 years ago |
| Comment | Post #292000 |
What is he range of z values? (more) |
— | almost 2 years ago |
| Comment | Post #292000 |
What should happen when two spheres are hit at the same distance? (more) |
— | almost 2 years ago |
| Edit | Post #292788 |
Post edited: Completed title |
— | almost 2 years ago |
| Edit | Post #292788 | Initial revision | — | almost 2 years 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$. Wha... (more) |
— | almost 2 years ago |
| Edit | Post #292762 | Initial revision | — | almost 2 years 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) |
— | almost 2 years ago |
| Edit | Post #292761 |
Post edited: Added a bit more explanation |
— | almost 2 years ago |
| Edit | Post #292761 |
Post edited: |
— | almost 2 years ago |
| Edit | Post #292761 | Initial revision | — | almost 2 years 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... (more) |
— | almost 2 years 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) |
— | almost 2 years 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 cove... (more) |
— | almost 2 years ago |
| Edit | Post #291896 | Initial revision | — | about 2 years 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... (more) |
— | about 2 years ago |
| Comment | Post #287387 |
What character set are you using that those three characters fit in three bytes?
(more) |
— | almost 4 years ago |
| Edit | Post #287392 |
Post edited: Explanation |
— | almost 4 years ago |
| Edit | Post #287392 | Initial revision | — | almost 4 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 ... (more) |
— | almost 4 years ago |
| Edit | Post #287391 | Initial revision | — | almost 4 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) |
— | almost 4 years ago |
| Edit | Post #287294 |
Post edited: |
— | almost 4 years ago |
| Edit | Post #287294 | Initial revision | — | almost 4 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... (more) |
— | almost 4 years ago |
| Comment | Post #287054 |
This gives 3 for input 10: should be 2. (more) |
— | almost 4 years ago |
| Edit | Post #287052 | Initial revision | — | almost 4 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) |
— | almost 4 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 th... (more) |
— | almost 4 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) |
— | almost 4 years ago |
| Comment | Post #287044 |
This doesn't correctly handle the unary special case. (more) |
— | almost 4 years ago |
