Activity for trichoplax
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #287403 |
Post edited: Add back in test cases excluded by post length limit |
— | about 1 year ago |
Edit | Post #287403 |
Post edited: Add test cases and clarifications |
— | about 1 year ago |
Comment | Post #287403 |
Having written some code to generate test cases, the negative inputs take significantly more time to solve, so if I include them I will keep the size of inputs that you are required to accept fairly small. (more) |
— | about 1 year ago |
Edit | Post #287403 |
Post edited: Remove ambiguity for prefix and suffix calculation explanation |
— | about 1 year ago |
Edit | Post #287403 |
Post edited: Apply consistent full stops for lists of sentences |
— | about 1 year ago |
Edit | Post #287403 |
Post edited: Use more consistent ordering for negative input example |
— | about 1 year ago |
Edit | Post #289956 |
Post edited: Mark as finalized |
— | about 1 year ago |
Edit | Post #289996 | Initial revision | — | about 1 year ago |
Question | — |
Single digit Roman numeral Given a single character, which is a valid Roman numeral, output its value. Values There are 7 valid single character Roman numerals, with the following values: Character | Value | ----: I | 1 V | 5 X | 10 L | 50 C | 100 D | 500 M ... (more) |
— | about 1 year ago |
Edit | Post #287403 |
Post edited: Include negative input and zero input |
— | about 1 year ago |
Comment | Post #287403 |
Now that I have noticed this, I am inclined to include both zero and negative integers as possible inputs, but I'll wait to see if anyone has reason to avoid either/both. (more) |
— | about 1 year ago |
Comment | Post #287403 |
Standard Roman numerals only support positive integers.
This particular generalisation of Roman numerals happens to be able to represent zero and negative integers. Should code be required to support these, or should inputs only be positive integers?
## Examples
- `VVX` is **10** - (**5** + **... (more) |
— | about 1 year ago |
Edit | Post #287403 |
Post edited: Use table instead of code block for definition section |
— | about 1 year ago |
Edit | Post #289956 |
Post edited: Right align numbers in table |
— | about 1 year ago |
Edit | Post #289956 | Initial revision | — | about 1 year ago |
Article | — |
Single character Roman numeral [FINALIZED] Now posted: Single digit Roman numeral Given a single character, which is a valid Roman numeral, output its value. Values There are 7 valid single character Roman numerals, with the following values: Character | Value | ----: I | 1 V | 5 X | 10 L | 50... (more) |
— | about 1 year ago |
Comment | Post #289926 |
I hadn't though of `or`. Even better. (more) |
— | about 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) |
— | about 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) |
— | about 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) |
— | about 1 year ago |
Edit | Post #289926 |
Post edited: Typos |
— | about 1 year ago |
Suggested Edit | Post #289926 |
Suggested edit: Typos (more) |
helpful | about 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) |
— | about 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) |
— | about 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) |
— | about 1 year ago |
Edit | Post #289921 |
Post edited: Link to definition of coprime for more than 2 numbers |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Mark as finalized |
— | about 1 year ago |
Edit | Post #289921 | Initial revision | — | about 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) |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Make outputs consistently title case |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Add randomly generated test cases including inputs up to and including 127 |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Make parameter names consistent |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Mention example code is in Python |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Add syntax highlighting |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Add non-golfed example code |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Placeholder for non-golfed example implementation |
— | about 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) |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Improve definition wording |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Specify inputs cannot be assumed to be sorted |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Mention Borromean rings |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Specify input upper limit |
— | about 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) |
— | about 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) |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Permute some test cases |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Fix potentially misleading wording of third example |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Simplify |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Make second example more distinct from the first |
— | about 1 year ago |
Edit | Post #289866 |
Post edited: Remove superfluous input rule |
— | about 1 year ago |
Edit | Post #289866 | Initial revision | — | about 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) |
— | about 1 year ago |