Conversation
| } | ||
| Scratch.extensions.register(new ScratchComplex()); | ||
| })(Scratch); No newline at end of file | ||
| })(Scratch); |
There was a problem hiding this comment.
what do you mean format only works if the very last line is empty??????????????????????
|
Interesting, I also made one of the same thing, but for personal use. |
- fix breakage when diff contains very long line (#1861) - unhardcode repository - add more logging
- fix breakage when diff contains very long line (TurboWarp#1861) - unhardcode repository - add more logging
There was a problem hiding this comment.
Haven't tested this fully yet, but it loads and seems to work
If this is your first extension, nice job! Here's just a few tips to make it better:
Avoid using the master branch, create a new branch for each pull request you'd like to submit for organization purposes.
| } | ||
|
|
||
| class ScratchComplex { | ||
| constructor() {} |
There was a problem hiding this comment.
if constructor is empty may I ask why it's here? Maybe just a clarification thing
| complexSyntaxMode: { | ||
| acceptReporters: false, | ||
| items: ["simple (faster)", "advanced (slower)"], | ||
| }, |
There was a problem hiding this comment.
Menus should be translated as well, use this structure for each item:
item: {
text: Scratch.translate("simple"),
value: "simple",
}
| "itchio", | ||
| "gamejolt", | ||
| "obviousAlexC/newgroundsIO", | ||
| "BonesYT/ScratchComplex", |
There was a problem hiding this comment.
Why'd you put this at the bottom? It doesn't really matter but you could put it near other similar extensions
There was a problem hiding this comment.
Images aren't supposed to have text because of translation but I guess this is okay...
There was a problem hiding this comment.
Github did something weird with displaying the diff... but sure
|
Hi @BonesYT !
I may or may not made something similar (like, with more blocks and such...) see #2113 for more :D
Anyways, I'm working on updating my extension, because it's wierd with every letter. Plus, I found how to implement Quaternions, and maybe have more optimization ideas for it, maybe too many...
I liked how you tackled some problems in the file. But that's not why I am here.
I was recently told about your existence, and looks like your extension has more power than mine (altho I have more blocks >:D but that's not the point either). From mathematician to cool guy, wanna work together? (or maybe we should call @penta-quark-neutro to see what optimizations he used!) |
|
There are fairly simple ways to get better performance. In the case of my extension, I simply rewrote the operations to avoid classes or calling functions. Using vectors is very efficient, but I imagine that your extension should return a string. |

I couldn't find an extension dedicated to complex numbers, you know... sqrt(-1) and stuff like that, so I made one.
This is also my first extension, and it kinda works pretty well!
All features:
Construct a complex number with real and/or imaginary component
Get the real and imaginary components of that value
Boolean to check if a number is real or not
Addition, subtraction, multiplication, division and exponentiation. And modulo.
Functions with single input, with extra: conjugate, flip, sign, atan2.
Toggle between simple and advanced syntax, for perfomance reasons. Maybe simple mode is at least slightly faster.
Examples