-
-
Notifications
You must be signed in to change notification settings - Fork 273
Vectors #2074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Vectors #2074
Conversation
timeutills V1
there is no block for deleting vectors? |
also please run !format |
!format |
Yes, just stop using a vector |
!format |
!format |
!format |
@fath11 there is now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to literally just be a weird way of storing 2 dictionary's, what is the point of this extension, you can't even do any operations?
@@ -0,0 +1,169 @@ | |||
(function (Scratch) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're missing the header data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
< >, Imma re-add that Ig
opcode: "vectorCreate", | ||
blockType: Scratch.BlockType.COMMAND, | ||
text: Scratch.translate( | ||
"create vector with ID [ID], direction [DIRECTION] and magnitude [MAGNITUDE]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have inconsistent capitalization across the blocks, the blocks should be written starting with lowercase. they are NOT sentences.
} | ||
|
||
vectorCreate(args) { | ||
const id = args.ID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't cast anything, this is poor practice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aren't they numbers, you can not put strings in there, and if you could, who would?
} | ||
|
||
// Vectors storage | ||
const ids = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why can't this be a set
|
||
// Vectors storage | ||
const ids = []; | ||
const directions = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should be Object.create(null); or a Map
|
||
vectorMag(args) { | ||
const id = args.ID; | ||
return magnitudes[id] ?? Scratch.translate("vector not found"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should return an empty string or 0 here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do I want people to wonder why their shit isn't working? if you said yes then you are wrong, the answer is no.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do I want people to wonder why their shit isn't working? if you said yes then you are wrong, the answer is no.
@GarboMuffin said to chill the language
|
||
vectorDir(args) { | ||
const id = args.ID; | ||
return directions[id] ?? Scratch.translate("vector not found"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Maps are < >, it does what it needs to do very well |
!format |
it would be wonderful if you would be more reasonable with your language on this issue tracker |
it already does what it needs to do, I don't want to spend multiple hours rewriting the entire extension |
Vectors is a extension for Vectors
Blocks: Create vector with ID,direction and magnitude: creates a vector, vector direction, returns direction of the vector based on ID, vector magnitude, returns magnitude of the vector based on ID, Change Magnitude and direction, changes magnitude and direction of the vector based on ID, and List of IDs, lists all elements in IDs