Skip to content

Add min and max block to true-fantom/math.js #2202

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LSPECTRONIZTAR
Copy link

@LSPECTRONIZTAR LSPECTRONIZTAR commented Aug 4, 2025

Not only do we need this, but I literally don't know an official extension in the gallery that has this block.

block_8_4_2025-2_30_53 PM

@github-actions github-actions bot added the pr: change existing extension Pull requests that change an existing extension label Aug 4, 2025
@LSPECTRONIZTAR
Copy link
Author

!format

Comment on lines +641 to +647
min_or_max_block(args) {
if (args.MIN_OR_MAX === "min") {
return Math.min(args.A, args.B);
} else {
return Math.max(args.A, args.B);
}
}
Copy link
Contributor

@Brackets-Coder Brackets-Coder Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just do this:

Suggested change
min_or_max_block(args) {
if (args.MIN_OR_MAX === "min") {
return Math.min(args.A, args.B);
} else {
return Math.max(args.A, args.B);
}
}
min_or_max_block(args) {
return Math[args.MIN_OR_MAX](args.A, args.B);
}

oh wait just realized accept reporters was true never mind it won't work

This means you should use Scratch.Cast.toString()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: change existing extension Pull requests that change an existing extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants