Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Activity for celtschk‭

Type On... Excerpt Status Date
Comment Post #284396 You can get rid of even more bytes by moving the repeating `teen` and `ty` from the constant into the final expression. [Try it online!](https://tio.run/##dZLfboIwFIev9SlOmphQcLOg@yNaXsRwYbCMJqyY9qh1y56dnYLcLFkvaPvl@50eKOc7Np1Z9/1J1VBHnufzmZOM7Y6SfSnbQWcU4K0DbKxSUHcXC7W@KnDag1NXZUDpjwbB6CCGbTtQvKm...
(more)
over 2 years ago
Comment Post #284407 Maybe the challenge could be named: **Find the operation, if any, that results in a true equation**
(more)
over 2 years ago
Comment Post #284407 Is division supposed to be integer division or real division? In other words, should `10 3 3` give true for division (because with integer division, 10/3 gives 3), or false (because in reals, 10/3 gives a fraction that definitely isn't 3). Also, different languages give different results for modulo o...
(more)
over 2 years ago
Comment Post #284407 Instead of two values, I suggest to output only the second value, but with the condition that it is none of the operation symbols if no operator works.
(more)
over 2 years ago
Comment Post #284401 But `if a>0 or b>0:` is exactly as long as `if(a>0)|(b>0):`.
(more)
over 2 years ago
Comment Post #284397 <del>Then you didn't read the specification correctly: > A good coalition has the strict majority of seats (that is, more seats than the opposition). Clearly 20 is not more than 20.</del> Sorry, I misread your correct coalition. Actually, you're right. I'll fix the test case.
(more)
over 2 years ago
Comment Post #284396 You can get rid of a few characters by replacing the two `and` with multiplication. [Try it online!](https://tio.run/##VZLRboMwDEWfy1d4kSaVlWpAu02jS3@k4qGlYUSCMCVhhU379s5OQqflIb52fY9N1I/JNr3aXK9nUUO9HOMiWhjO2O7ID@xL6J4lrFcCb3shbRstKKv7QVOQn5QZOdItPoXCKOR7YzEq6Y2@2IZf7UW0zmQbqa1wNaLNUtZBIXRWZA3awb0...
(more)
over 2 years ago
Comment Post #284088 Can you please be more specific? What do you let pass? A final newline? Occasional other trailing whitespace? Leading whitespace? Occasional double spaces? All of them? Some of them? And what about the supposed behaviour on input characters not in the specification?
(more)
over 2 years ago
Comment Post #284088 I'm not talking about a newline (well, I get that, too, since I use the C function `puts` for output, but I assumed that would be OK; if not, I'll replace it by `printf` at the cost of 2 characters), I'm talking about a space character (ASCII code 32), which my code currently in *some* cases adds at ...
(more)
over 2 years ago
Comment Post #284088 Is it OK to sometimes have a trailing space in the output? Also, may I assume that the input is always a valid input (that is, never contains any characters not in the specification)?
(more)
over 2 years ago
Comment Post #284088 On testing my code for this (not yet finished), I've noticed that three-digit numbers are not tested; also the number zero is easy to get wrong. I suggest adding the following test cases: ``` 500 five hundred 129 one hundred and twenty-nine 0+0=0 zero plus zero equals zero 0 -- 0 = 0 ...
(more)
over 2 years ago
Comment Post #282795 A Turing machine has a **very strict definition,** and that definition includes the tape and what it is. Note that if your language has stdin, it definitely does **not** describe a Turing machine.
(more)
over 2 years ago
Comment Post #284326 Copyright is independent of making money. There are some fair use exceptions, but those are for commenting on the text. I don't think this use is covered (but then, I am not a lawyer). And even if it is covered by fair use, the copyright holder (or, more likely, some organisation representing the ...
(more)
over 2 years ago
Comment Post #284326 I believe that text is still copyrighted. I'm not sure it is a good idea to use it for a challenge, especially given that the music industry in particular is very active in copyright issues.
(more)
over 2 years ago
Comment Post #284159 Thank you, adopted.
(more)
over 2 years ago
Comment Post #284195 Thanks, edited.
(more)
over 2 years ago
Comment Post #284180 Oops, yes, it's supposed to be code golf. I'll edit.
(more)
over 2 years ago
Comment Post #283865 @#53196 It was referring to the individual three-digit group.
(more)
over 2 years ago
Comment Post #284158 Thanks; actually I hadn't been aware of the number before keyword case. I'll add this.
(more)
over 2 years ago
Comment Post #284136 Oops, right, thank you again. I'll immediately fix this.
(more)
over 2 years ago
Comment Post #284088 Is it intentional that the standalone number is in words, but the numbers in expressions are in digits (except for the “negative” prefix)?
(more)
over 2 years ago
Comment Post #284136 Oops, thank you for catching this. I'll fix and also add the extra test cases.
(more)
over 2 years ago
Comment Post #284028 Good one. You could also mention that this also applies for different operators, for example `a<b>c` is valid and equivalent to `a<b and b>c`.
(more)
over 2 years ago
Comment Post #283990 Indeed, +1. This special case really adds some complexity, doesn't it?
(more)
over 2 years ago
Comment Post #283990 For the value 0, this returns the empty string instead of the string `0`.
(more)
over 2 years ago
Comment Post #283982 Thanks, I hadn't been aware of that.
(more)
over 2 years ago
Comment Post #283865 OK, I've changed both the reference implementation and the wording, and added more test cases. Can you please check again (in particular the wording; English is not my native language, therefore any suggestions for improvement are welcome)?
(more)
over 2 years ago
Comment Post #283865 Well, actually that is a case I didn't consider. On one hand, the wording is obviously misleading because that's not what it was referring to, on the other hand I think “one million and one” is the reasonable result here. I'll have to think about how to adapt the rules/reference implementation accord...
(more)
over 2 years ago
Comment Post #283948 Actually not all your test cases are equations; better use the term “mathematical expression”.
(more)
over 2 years ago
Comment Post #283865 OK, I now made a concrete specification and a reference implementation. The inconsistent dashes in ninety-nine however simply were typos, than you for catching them.
(more)
over 2 years ago
Comment Post #283989 Are leading zeros in the output allowed?
(more)
over 2 years ago
Comment Post #283982 I'm just too used to write C++ code that requires it, so I tend to write them without even noticing. Thanks for catching that.
(more)
over 2 years ago
Comment Post #283978 BTW, I just found you can reduce by two further bytes by using `enumerate` in the loop. While the `enumerate` expression itself is a bit longer, that is more than made up by replacing `x[i]` with `c` in the loop. And no semicolon this time ;-) [Try it online!](https://tio.run/##JcnBCoMwDADQe7@ieEq...
(more)
over 2 years ago
Comment Post #283978 @#54114 Actually it was the semicolon that I forgot to delete when I deleted the statement after it.
(more)
over 2 years ago
Comment Post #283978 And another golfing opportunity: the `if i:` can be replaced by multiplying `x[i]` with `bool(i)`, and then the whole line can be combined into a single string, getting rid also of the `end=`. This brings down the byte count to 92. [Try it online!](https://tio.run/##LcpBCsMgEEDRvaeQrGYUF2l3Fk8Ssmj...
(more)
over 2 years ago
Comment Post #283978 I've now noticed that you can dramatically shorten the code again by using Python's slicing syntax. Just replace the complete first loop with `x+=x[-2::-1]` and then remove the now unused variable `j`. This brings the byte count down to 103. [Try it online!](https://tio.run/##RckxCsMwDADAOXqFyCS18...
(more)
over 2 years ago
Comment Post #283978 You can save quite a few bytes here. First, you can replace `print(" ",end='')` with `print(end=" ")`, saving 3 bytes. But then, you can replace the whole `j` loop with `print(end=" "*(k-2))`. Then you can merge the two `print` statements into one: `print(x[i],end=" "*(k-2))`. Since now the `if` c...
(more)
over 2 years ago
Comment Post #283917 I think is is better to separate the tags. After all, if a draft introduces a new tag, but doesn't get to Challenges, then IMHO the tag shouldn't be in main either. Ideally, the tags in the Sandbox would be the union of the tags on Challenges and Sandbox-only tags. But I don't think the software s...
(more)
over 2 years ago
Comment Post #283782 @#53588 Thank you. Since the JS solution is too different, changing to that now would seem to me like cheating, but I'll use the 31 byte solution.
(more)
over 2 years ago
Comment Post #283649 I just noticed that you put the encryption tag on this challenge. That is not appropriate; encryption means to encode a message so that only people with the correct decryption key can decode it. Decoding binary doesn't need a decryption key.
(more)
over 2 years ago
Comment Post #283652 Actually I started with a loop containing a single printf statement (but no width specifications; just a lot of `%1$s` style stuff), but then found that putting the singular/plural logic into a separate function saves more space because I essentially repeated the same logic for `i-1` as I couldn't de...
(more)
over 2 years ago
Comment Post #283649 If you don't care about negative integers, the best option would be to say that it may be assumed that the code is only called on non-negative integers.
(more)
over 2 years ago
Comment Post #283649 What about negative integers?
(more)
over 2 years ago
Comment Post #283649 You might want to restrict the input to disallow a “converter” that takes the number in binary and copies it to output unchanged.
(more)
over 2 years ago
Comment Post #283649 Why does the integer have to be named n?
(more)
over 2 years ago
Comment Post #283603 As long as you explicitly state that the second factor is passed in first, I'd consider that acceptable. I've edited the post accordingly.
(more)
over 2 years ago
Comment Post #279854 Figuring that out was intended to be part of the challenge? I would never have guessed *that.* The one single most important thing about a challenge is to be crystal clear on what is expected from a solution. Up to now, my comments were about things where people could be misled by reasonable assumpti...
(more)
over 3 years ago
Comment Post #279854 On the `{n}=2n`: That's just an observation/extrapolation from the examples given. But the order you describe implies `m<n => {m} < {n]`, which means that when `{5} > {6}` then your mapping does not respect your order. While there's of course not a requirement to respect the order, it is what I woul...
(more)
over 3 years ago
Comment Post #279854 According to the task description, the task is to return a string, not a set. I took it that your algorithm gives that string. So what you are saying is that the algorithm only gives *some* representation of the set, and the program has to then calculate the set from that representation, and then to ...
(more)
over 3 years ago
Comment Post #279854 Also, what number corresponds to the set `{{{}, {{{}}}}}` (that is, `{5}`)? Up to n=4, the sets {n} seem to have ascending numbers (`{0}=1`, `{1}=2`, `{2}=4`, `{3}=6`, `{4}=8`), but then the next single-element set is `{6}=12`. Indeed, from those examples, it seems that `{n}=2n`, but `10={1,3}≠{5}`.
(more)
over 3 years ago