Content-Length: 255809 | pFad | https://github.com/microsoft/pxt-microbit/issues/5579

BE "Games: Tug of LED": Missing 'Math' category in Toolbox in Python and JavaScript tutorials · Issue #5579 · microsoft/pxt-microbit · GitHub
Skip to content

"Games: Tug of LED": Missing 'Math' category in Toolbox in Python and JavaScript tutorials #5579

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

Closed
v-katherine opened this issue Apr 2, 2024 · 4 comments · Fixed by microsoft/pxt#10552
Assignees

Comments

@v-katherine
Copy link

Describe the bug
"Games: Tug of LED": Missing 'Math' category in Toolbox in Python and JavaScript tutorials

Steps to reproduce the behavior
1.Navigate to https://makecode.microbit.org/beta.
2.Games->Tug of LED->Python or JavaScript Start Tutorial.
3.Go to step6 and click 'rounded' in content.

Actual behavior:
Missing 'Math' category in Toolbox so that there is no response when click 'rounded'.

Expected behavior:
Open Math category in Toolbox.

Screenshot:
missingmath

Additional context:
1.OS: Mac OS 13.6.6
2.makecode.microbit,org version: 7.0.4
3.Microsoft MakeCode version: 10.0.11

@ganicke
Copy link
Collaborator

ganicke commented Jul 10, 2024

The Math category doesn't appear due to Math.round() not being part of the Toolbox blocks when in Python or JavaScript editor modes.

@ganicke
Copy link
Collaborator

ganicke commented Apr 29, 2025

@abchatra, @riknoll - either we need Math.round() added to the JS/Python Math category or the hint code will need to change from Math.round(rope) to something dumb like rope - (rope % 1).

Because, Math.round() isn't available from the list, therefore the Math category won't appear in the tutorial run:

Image

Update: this is because Math.round() is not part of monacoSnippets.ts.

Could it be added?

{
    name: "Math.round",
    snippetName: "round",
    snippet: `Math.round(1.2)`,
    pySnippet: `round(1.2)`,
    attributes: {
        weight: 73,
        blockId: "math_js_round",
        jsDoc: lf("Returns an integer closest to the number")
    },
    retType: "number"
},

@riknoll
Copy link
Member

riknoll commented Apr 29, 2025

yeah, huh. we must have missed it the first time around. i'll open a pr to add it

@ganicke
Copy link
Collaborator

ganicke commented Apr 29, 2025

Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/microsoft/pxt-microbit/issues/5579

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy