Timeline for Tips for Code Golfing in Desmos
Current License: CC BY-SA 4.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 13, 2023 at 8:57 | comment | added | Aiden Chow | For more information on how Desmos equations are scored, please see this relevant meta post. | |
May 13, 2023 at 8:51 | comment | added | Aiden Chow |
If you type in the keystrokes 0^k^2 into the Desmos editor and copy paste the result out of Desmos, you would see 0^{k^{2}} , which, after some syntax golfing, results in 0^{k^2} (this is the code that is considered when counting the bytes of Desmos code, not 0^k^2 ).
|
|
May 13, 2023 at 8:48 | comment | added | Aiden Chow |
@Neil Didn't see this comment until now lol, idk why I didn't get a notification. Desmos is scored on the text that you copy-paste into the Desmos editor verbatim, not the amount of "keystrokes" or "presses" that it takes to type in the expression. In this case, if you copy paste the exact text 0^k^2 into Desmos (make sure you have k initialized elsewhere), it will not paste in what you expect. Instead, 0^{k^2} , or the shortened version 0^{kk} , would copy-paste into Desmos correctly.
|
|
Apr 6, 2023 at 7:28 | comment | added | Neil |
Ah, so typing 0^x^2 actually results in 0^{x^2} ? I couldn't work out how to copy what the underlying text actually was.
|
|
Apr 6, 2023 at 1:28 | comment | added | Aiden Chow |
@Neil Actually if you put that exact expression into an online \$\LaTeX\$ editor like Overleaf, you will find that the underlying error is that double subscripts aren't allowed, and that under the hood it is parsed as 0^k{}^2 , which is essentially 0^{k2} , in order to bypass the error.
|
|
Apr 6, 2023 at 1:14 | comment | added | Aiden Chow |
@Neil You can actually try this yourself by going onto Desmos, and copy-pasting 0^k^2 into the first expression box to see what happens. Now try 0^{k^2} and see the difference (Note that 0^{kk} would be shorter and achieves the same thing`).
|
|
Apr 5, 2023 at 23:00 | comment | added | Neil |
@AidenChow 0^x^2 looks as if it should work.
|
|
Mar 8, 2022 at 7:53 | comment | added | Aiden Chow |
I just noticed something. Because we only care about the sign of x as opposed to its actual value, we can do 0^{xx} instead of 0^{abs(x)} .
|
|
Jun 20, 2021 at 20:35 | history | edited | user | CC BY-SA 4.0 |
deleted 73 characters in body
|
Jun 20, 2021 at 20:34 | comment | added | user | @AidenChow Whoops, missed that | |
Jun 20, 2021 at 20:29 | comment | added | Aiden Chow |
\left|x\right| --> abs(x) , making it shorter than your 2nd version.
|
|
Jun 20, 2021 at 20:19 | history | answered | user | CC BY-SA 4.0 |