I cannot find a way to flip the characters written to the stage. In the example attached I write a decimal number in binary format from right to left but the characters are inverted respect to the x-axis .I tried using the 'set rotation style' and the 3-buttons above the scripting area but never got what I wanted. I would appreciate any suggestions. Thanks
do you want it flipped like, 1101001 becomes 1001011?
Several ways. The first point is that you really want the sprite facing East in order to get the characters right.
The easiest way conceptually is to back the sprite up after writing each character:
Another way would be to store the digits back to front and then write them all at once:
But the best way is to write a reporter BINARY NUMERAL that takes a number as input and reports a string of ones and zeros, separating that from the process of displaying them.
Hi, thanks for your suggestion. Adding a 'move' block with a negative number along the x-axis is doing what I wanted (see image below).
In any case I don't understand why pointing the sprite in a specific direction (-90 in this case) would flip and mirror the characters. Reading an old post form github https://github.com/jmoenig/Snap/issues/314 looks like there should be an easy way to run flip as you wish but I don't see how.
It'll make more sense if you look at what WRITE does when the sprite is pointed at 45 degrees. The text is tilted so that its baseline is the line through which the sprite moves. The same is true in your case; it's not "flipping" the characters, but rather, drawing them on the baseline through which the sprite moves.
I got it. I was wrongly assuming that the 'point in direction' block would not rotate the characters to write. I thought it would be more like changing how the cursor moves without affecting the orientation of what you write. Assumption probably related to me being a user that started with old ascii terminals.
Thanks for your help again, I am just starting with snap! and I really appreciate your answers. Snap is a great teaching application that I plan to use with my kids and others starting to code.
You're very welcome! Check out our curriculum at bjc.edc.org.