Activity for celtschk
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #284397 |
Post edited: Added a note that the order in the output does not matter |
— | about 3 years ago |
Edit | Post #284339 |
Post edited: |
— | about 3 years ago |
Edit | Post #284421 | Initial revision | — | about 3 years ago |
Question | — |
Encode and decode floating point integers Imagine you have only one byte (8 bits) to store a value, but need to store values from $0$ to $4032$. Impossible, until you are also told that an error of 1/64 of the exact value does not matter. With that knowledge, you decide to design a floating point integer type, which is defined as follows:... (more) |
— | about 3 years ago |
Edit | Post #284418 | Initial revision | — | about 3 years ago |
Answer | — |
A: Truthify an array [Python 3], 75 bytes lambda a:[[i,k]for i in r(l(a))for k in r(l(a[0]))if ai] r=range;l=len Try it online! (more) |
— | about 3 years ago |
Edit | Post #284417 | Initial revision | — | about 3 years ago |
Answer | — |
A: "Hello, World!" [Unlambda], 40 bytes `````````````.H.e.l.l.o.,. .W.o.r.l.d.!i Try it online! (more) |
— | about 3 years ago |
Edit | Post #284185 |
Post edited: Turned link-only footnote into direct links |
— | about 3 years ago |
Suggested Edit | Post #284185 |
Suggested edit: Turned link-only footnote into direct links (more) |
helpful | about 3 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) |
— | about 3 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) |
— | about 3 years ago |
Edit | Post #284397 |
Post edited: |
— | about 3 years ago |
Edit | Post #284397 |
Post edited: Fixed test case thanks to @Moshi |
— | about 3 years ago |
Edit | Post #284104 |
Post edited: I had accidentally deleted the links |
— | about 3 years ago |
Edit | Post #284104 |
Post edited: Saved two bytes thanks to @Moshi in the comments |
— | about 3 years ago |
Comment | Post #284401 |
But `if a>0 or b>0:` is exactly as long as `if(a>0)|(b>0):`. (more) |
— | about 3 years ago |
Edit | Post #284391 |
Post edited: Corrected LaTeX correction |
— | about 3 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) |
— | about 3 years ago |
Edit | Post #284397 |
Post edited: |
— | about 3 years ago |
Edit | Post #284397 | Initial revision | — | about 3 years ago |
Article | — |
Find good coalitions [FINALIZED] As you might know, there were elections in Germany, and now the parties have to form a government coalition. Let's help them with it! A good coalition has the strict majority of seats (that is, more seats than the opposition). Moreover you don't want more parties than necessary in a coalition, tha... (more) |
— | about 3 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) |
— | about 3 years ago |
Edit | Post #283865 |
Post edited: |
— | about 3 years ago |
Edit | Post #284391 | Initial revision | — | about 3 years ago |
Question | — |
Convert integer to English Given a non-negative integer up to $999\\,999\\,999$, write it in English. The input number can be in any form other than English (though you'll typically want to use the native integer type of your language). The numbers must be formatted as follows: Two-digit numbers must be written wit... (more) |
— | about 3 years ago |
Edit | Post #284383 | Initial revision | — | about 3 years ago |
Answer | — |
A: Define a mathematical expression in English [C (gcc)], 774 bytes #define S strcat(o, #define I(s)if(n)S s);else{S" ");return;} #define B);break;case n,N,s;chari,o[999],d[]={"zero ","one ","two ","three ","four ","five ","six ","seven ","eight ","nine ","ten ","eleven ","twelve ","thir","four","fif","six","seven","eigh... (more) |
— | about 3 years ago |
Edit | Post #284088 |
Post edited: fixed nested list markdown |
— | about 3 years ago |
Suggested Edit | Post #284088 |
Suggested edit: fixed nested list markdown (more) |
helpful | about 3 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) |
— | about 3 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) |
— | about 3 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) |
— | about 3 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) |
— | about 3 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) |
— | about 3 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) |
— | about 3 years ago |
Edit | Post #284339 |
Post edited: |
— | about 3 years ago |
Edit | Post #284339 |
Post edited: |
— | about 3 years ago |
Edit | Post #284339 |
Post edited: |
— | about 3 years ago |
Edit | Post #284339 |
Post edited: |
— | about 3 years ago |
Edit | Post #284339 | Initial revision | — | about 3 years ago |
Article | — |
Encode and decode floating point integers [FINALIZED] Imagine you have only one byte (8 bits) to store a value, but need to store values from $0$ to $4032$. Impossible, until you are also told that an error of 1/64 of the exact value does not matter. With that knowledge, you decide to design a floating point integer type, which is defined as follows:... (more) |
— | about 3 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) |
— | about 3 years ago |
Edit | Post #284277 | Initial revision | — | about 3 years ago |
Answer | — |
A: Reverse your quine [Python 3], 69 bytes i="))43,]1-::[i,43,73(%ci(tnirp;%c%s%c=i";print(i%(37,34,i[::-1],34)) Try it online! (more) |
— | about 3 years ago |
Comment | Post #284159 |
Thank you, adopted. (more) |
— | about 3 years ago |
Edit | Post #284159 |
Post edited: Got rid of a whitespace character, spotted by @MarkGiraffe |
— | about 3 years ago |
Edit | Post #284214 |
Post edited: |
— | about 3 years ago |
Edit | Post #284214 | Initial revision | — | about 3 years ago |
Answer | — |
A: Tips for golfing in Python Replace `n+1` with `-n` and `n-1` with `-n` For integers, `n+1` and `-n` have the same value, as have `n-1` and `-n`. While the expressions themselves have the same lengths, the replacements often allow to save space by allowing either to remove whitespace or to omit parentheses due to differen... (more) |
— | about 3 years ago |