|
|
|
|
|
by Adam13531
2454 days ago
|
|
> What's the rationale for excluding sqrt? That's a great question, and one with a non-obvious answer! For any potential function in Bot Land, including utility functions like Math.sqrt and Math.pow, I purposely wanted to provide as few as possible until someone expressed a desire for them, that way I could ask about the scenario they were trying to accomplish (as you saw in this thread). From there, I try to figure out if there's an even easier way of supporting their scenario so that everyone (i.e. even Blockly users) could enjoy it. For example, if we find out that Math.sqrt was needed solely to find distance and that getDistanceTo was sufficient, then I could treat it as an education problem on behalf of Bot Land. In other words, I may want to include more snippets that use "getDistanceTo" or maybe make more tutorial content around that function. Another philosophy would be to just add whatever functions I can think of and see what users do with it. That would probably have worked too; I'm not saying mine is better, it's just what I was thinking. |
|
One thing that confused me though, when I was trying to figure out how to square root is that one of your code blocks seems to translate into Math.pow, which made me think that I could use it too.
For the same reason you gave, equality between block-based and text-based programmers, I'd suggest any function that the blocks translate into should be allowed.
If it would help you I can find the specific block I'm referring to latter today.