Activity for trichoplax
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #289926 |
I hadn't though of `or`. Even better. (more) |
— | over 1 year ago |
Comment | Post #289926 |
This applies in python, because `and` has lower precedence than the comparison operators, while `&` has higher precedence than the comparison operators.
I'm not familiar with SageMath but if it uses [the same operator precedence rules as python](https://docs.python.org/3/reference/expressions.html... (more) |
— | over 1 year ago |
Comment | Post #289926 |
In general they will take the same number of bytes in cases where `&` requires parentheses for operator precedence but `and` does not:
```python
(X)&(Y) # 7 bytes
X and Y # 7 bytes
```
However, in the specific case where `and` follows a digit, the space before the `and` can be omitted ... (more) |
— | over 1 year ago |
Comment | Post #289926 |
I know that sounds counterintuitive. In python the parentheses are redundant with `and`, because it has lower precedence than the comparison operators. (more) |
— | over 1 year ago |
Edit | Post #289926 |
Post edited: Typos |
— | over 1 year ago |
Suggested Edit | Post #289926 |
Suggested edit: Typos (more) |
helpful | over 1 year ago |
Comment | Post #289926 |
[Rules for function submissions](https://codegolf.codidact.com/posts/286366/286367#answer-286367) suggests that in a language where a function can be used without naming it, the naming does not need to be included in the answer.
In your case, if SageMath allows using a lambda directly (such as usi... (more) |
— | over 1 year ago |
Comment | Post #289926 |
In testing my example code for the challenge wording I discovered the same problem - the `gcd` function would only accept 2 arguments. It turned out I was using an old version of Python. [From version 3.9 onwards it supports arbitrarily many arguments](https://docs.python.org/3.9/library/math.html#ma... (more) |
— | over 1 year ago |
Comment | Post #289925 |
From the challenge wording:
> You will also take an integer `i` as input and then either:
> - Output the `i`<sup>th</sup> term (0-indexed or 1-indexed, but please specify) of the `n`-based sequence,
> - Output the the first `i` terms of that sequence, or,
> - Forego taking `i` as input and outp... (more) |
— | over 1 year ago |
Edit | Post #289921 |
Post edited: Link to definition of coprime for more than 2 numbers |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Mark as finalized |
— | over 1 year ago |
Edit | Post #289921 | Initial revision | — | over 1 year ago |
Question | — |
Borromean coprimes Given 3 positive integers, indicate whether they are Borromean coprimes. Definition 3 positive integers are called Borromean coprimes if both of the following are true: - Their greatest common divisor is 1. - The greatest common divisor of every pair is greater than 1. In summary, the triple... (more) |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Make outputs consistently title case |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Add randomly generated test cases including inputs up to and including 127 |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Make parameter names consistent |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Mention example code is in Python |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Add syntax highlighting |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Add non-golfed example code |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Placeholder for non-golfed example implementation |
— | over 1 year ago |
Comment | Post #289866 |
Good idea - for this challenge even the non-golfed code should be short. I have an implementation in Rust that I've been using to check test cases, but maybe I'll write some example code in Python to include in the challenge wording. (more) |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Improve definition wording |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Specify inputs cannot be assumed to be sorted |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Mention Borromean rings |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Specify input upper limit |
— | over 1 year ago |
Comment | Post #289866 |
Thank you!
For the largest input I might go with 255 or 127 for 8 bit integers, or maybe 65535 or 32767 for 16 bit integers. I'll have a think.
Whichever upper bound I settle on, I'll include some test cases that include it. (more) |
— | over 1 year ago |
Comment | Post #289866 |
Good question. I'm now torn between
- allowing input to be already sorted, to reduce the challenge down to its simplest form
- requiring code to handle input in any order, to create competition between approaches that don't require sorting, and approaches that require sorting but where the cost of ... (more) |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Permute some test cases |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Fix potentially misleading wording of third example |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Simplify |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Make second example more distinct from the first |
— | over 1 year ago |
Edit | Post #289866 |
Post edited: Remove superfluous input rule |
— | over 1 year ago |
Edit | Post #289866 | Initial revision | — | over 1 year ago |
Article | — |
Borromean coprimes [FINALIZED] Now posted: Borromean coprimes Given 3 positive integers, indicate whether they are Borromean coprimes. Definition 3 positive integers are called Borromean coprimes if both of the following are true: - Their greatest common divisor is 1. - The greatest common divisor of every pair is gre... (more) |
— | over 1 year ago |
Edit | Post #284894 |
Post edited: Typo in title |
— | over 1 year ago |
Comment | Post #287139 |
Thank you! And thanks for the saved byte - it made me realise I should adjust my generating code to sort by fruit length in bytes (which resulted in a similar replacement to your suggestion, for the same number of bytes). (more) |
— | over 1 year ago |
Edit | Post #287139 |
Post edited: Move golfing credit to immediately after the code |
— | over 1 year ago |
Edit | Post #287139 |
Post edited: Save 1 byte thanks to msb's comment |
— | over 1 year ago |
Comment | Post #289782 |
One thought which makes me lean towards keeping it a single question:
The line between different types is not always clear. Some languages have floating point for non-integer values, other languages have fixed point, or an arbitrary precision decimal or rational type. Since there might be some ove... (more) |
— | over 1 year ago |
Comment | Post #289782 |
So I think splitting answers will be needed even if this is split into more questions. I don't personally see a need to split this question, but I don't see a problem with splitting it either. (more) |
— | over 1 year ago |
Comment | Post #289782 |
Similarly if an answer gives 2 rules for string length, they cannot be separately voted on. For example, if someone says "string inputs only have to be supported up to N characters" but also says "for language X it's M characters" then someone may agree with the general rule but not with the exceptio... (more) |
— | over 1 year ago |
Comment | Post #289782 |
I was commenting as a hint to answerers. I don't see a problem with several related rules being discussed under one question - that's similar to how the other "default-rules" questions work.
The concepts you have listed in the question are all very closely related, so I like them being in one ques... (more) |
— | over 1 year ago |
Comment | Post #289782 |
It might be easier to see community consensus if each proposed rule is posted in its own answer to allow separate voting. This will then be similar to the other Meta questions tagged "default-rules". (more) |
— | over 1 year ago |
Edit | Post #289782 |
Post edited: Make title clearer and add default rules tag |
— | over 1 year ago |
Suggested Edit | Post #289782 |
Suggested edit: Make title clearer and add default rules tag (more) |
helpful | over 1 year ago |
Comment | Post #289679 |
That's a good point. Currently the only restriction I can find is against non-free languages, and that only applies to one challenge type (so not to code golf):
- [How free is "free" for cops and robbers?](https://codegolf.codidact.com/posts/282856)
This doesn't change my opinion (I would still... (more) |
— | over 1 year ago |
Suggested Edit | Post #284894 |
Suggested edit: Typo in title (more) |
helpful | over 1 year ago |
Comment | Post #289679 |
It's tempting to think that multiplying by 4 would always be enough, but in general the duration on one computer will not scale linearly to the duration on another computer. For different code the scaling factor will be different (even for different solutions to the same challenge).
I agree it cou... (more) |
— | over 1 year ago |
Comment | Post #289679 |
The time limit is a big part of my concern. Everyone can agree on how many bytes there are, but different computers will have different speeds and therefore different outputs if based on run duration. (more) |
— | over 1 year ago |
Edit | Post #287082 |
Post edited: Tidy up intro wording |
— | over 1 year ago |