Timeline for Sandbox for Proposed Challenges
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 12, 2020 at 2:33 | comment | added | Jo King Mod |
Can negation be stacked? i.e. is 1 - - - 1 a valid input? Doesn't negation in the output kinda negate (heh) the point of it being postfix, because it it prefix?
|
|
Mar 12, 2020 at 2:17 | comment | added | Bubbler |
The linked challenge explicitly assumes left-associativity for all operators ^ * / + - (that is, 1 - 2 + 3 = (1 - 2) + 3 , 4 / 5 * 6 = (4 / 5) * 6 , and 7 ^ 8 ^ 9 = (7 ^ 8) ^ 9 ), but ^ is mathematically right-associative (7 ^ 8 ^ 9 = 7 ^ (8 ^ 9) != (7 ^ 8) ^ 9 ). Which one should we use?
|
|
Mar 12, 2020 at 2:13 | comment | added | Bubbler |
The second line in "clarifications" is unnecessary because "postfix notation" implies no parentheses. For the floating-point output, do you have a reason to demand adding .0 to integer values? A floating-point number 4 can be printed as 4 , 4. , or 4.0 , and all of them represent the same value anyway.
|
|
Mar 12, 2020 at 1:47 | comment | added | Bubbler | For code-golf scoring, scoring by bytes is preferred over characters. (I believe there must be a more persuasive argument somewhere...) | |
Mar 12, 2020 at 1:34 | comment | added | Bubbler |
And you didn't explain why you want to handle unary negation in a different way (which is essentially changing the underlying expression, which seems against "You should not evaluate any expression"). By using a different symbol for unary minus (say ~ ), it is possible to translate the example to postfix as 4.0 2.0 3.0 / ^ 9.0 * 3.0 * 4.0 ~ 6.0 * - .
|
|
Mar 12, 2020 at 1:27 | comment | added | Bubbler |
To reiterate my comment on the original question: 1. Using the word "twist" is not recommended. 2. Don't ban exec/eval just because you don't like it. The task isn't about evaluating the value, so it is unnecessary and pretty much arbitrary. 3. You say "prefix notation", but 4.0 2.0 3.0 / ^ 9.0 * 3.0 * -4.0 6.0 * - is in postfix, not prefix. You should fix either the description or the example result.
|
|
Mar 12, 2020 at 1:09 | history | answered | Si Random | CC BY-SA 4.0 |