midnightleopard, since comment blocks are not supported in v1.2.1, importing sprites with them seems to cause an error in scratch.
Since this comment has nothing to do with this project, it would have been better to have raised in in the "All about Scratch" forum.
kevin, I downloaded a progect with comment blocks int it, exported the sprite with comments so I can use them, but when I imported the sprite, the scratch image came up and was all: message not understood
Printing numbers with the stamp tool.
This program has a single sprite called digit, which responds to messages print_number, and print_scientific. It uses four global variables: print_x, print_y, print_after_decimal, and print_number to communicate parameters.
When print_number is broadcast, the digit sprite
prints out the number by stamping the digits with the bottom right of the final number at print_x, print_y. This version can print up to 15 places to the right of the decimal point, controlled by print_after_decimal.
When print_scientific is called, the number is printed in "scientific" notation, with a power of 10 after the letter E (unless the exponent is 0, then the output is the same as print_decimal).
After the call, print_number is 0 and print_x is to the left of the printed number. print_y is unchanged.
There is a simple test script on the stage:
clicking on s broadcasts print_scientific, d broadcasts print_number, while space clears the display.
Comments
You need to be logged in to post comments
Add a Comment
Nope, I can't join any of the Scratch "companies"---I have neither the time nor the inclination to do so.
midnightleopard, since comment blocks are not supported in v1.2.1, importing sprites with them seems to cause an error in scratch. Since this comment has nothing to do with this project, it would have been better to have raised in in the "All about Scratch" forum.
kevin, I downloaded a progect with comment blocks int it, exported the sprite with comments so I can use them, but when I imported the sprite, the scratch image came up and was all: message not understood
i love it:) i was learning about scientific notation not too long back, and this caught my eye:)
excellent, I love single-sprite projects, and this is a particularly nifty one!
Great! Another handy capability.
It's no wonder you started a math gallery!!
This updates the older print_decimal project athttp://scratch.mit.edu/projects/kevin_karplus/2951