ProgrammingBlock : List of Blocks


This is the list of blocks that you can use in the Normal mode. In the Novice mode, you can use only some of these blocks. The Novice mode blocks are marked "*" in the list.
"R0" can be changed to "R1"-"R9". Also the input fields that are in the lower half of blocks can be changed to Variables ("R0"-"R9").
To change the input field to a Variable, double-tap the block in the Programming area to make the block editable. (An "Editable" block is larger then the normal size. )
Then tap the input field and tap "R" button that appears when you tap the input field.

Drawing blocks: Draws lines or shapes in the Drawing area. Drawing area is the large white rectangle in the upper part of the screen.
Move Forward (*)
Set Position (*)
Moves the blue triangle in the Drawing area.
The first one moves forward in the current direction. The second one moves to the specified coordinates.
If you set "Yes" to Draw, the triangle draws a line while moving. If you set "No", it just moves without drawing a line. To see the coordinates of the drawing area, tap the drawing area to show the control panel and tap the Mesh button() in the control panel.
Rotate (*)
Set Angle
These rotates the blue triangle without changing the position.
The first one rotates by degrees relative to the current angle. The direction of rotation can be specified as "Right" (clockwise) or "Left" (counter clockwise).
The second one rotates by specifying the absolute angle, regardless of the current angle. Up is 0°, right is 90°, down is 180°, left is 270° (or -90°).
Select Color
Select Width
It sets the color or the width of the line that the blue triangle draws.
It affects the lines that the blue triangle draws from there. Also, it affects the rectangle and ellipse of the Rectangle block and the Ellipse Block.
Get coordinates It gets the coordinates of the blue triangle in the Drawing area and set them to the Variables(The X coordinate to R0, the Y coordinate to R1 ).
Ellipse(frame)
Ellipse(fill)
Draws an ellipse at the position of the blue triangle. The first one only draws ellipse, the second one draws and fills with the same color.
"W" is the width and "H" is the height of the ellipse. If you want to draw a circle, put the same value into both of the boxes.
Drawing direction of the ellipse is the current direction of the blue triangle. This block does not move the blue triangle.
You can change the color or the width of the frame by "Select Color" or "Select Width" blocks.
Rectangle(frame)
Rectangle(fill)
Draws a rectangle at the position of the blue triangle. The first one only draws rectangle, the second one draws and fills with the same color.
"W" is the width and "H" is the height of the rectangle. If you want to draw a square, put the same value into both of the boxes.
Drawing direction of the rectangle is the current direction of the blue triangle. This block does not move the blue triangle.
You can change the color or the width of the frame by "Select Color" or "Select Width" blocks.
Clear Drawing Clears all the lines and the shapes in the Drawing area.
Calculation blocks:Does a calculation and set the result to the Variable
Set a value Just set a value to the Variable R0.

Add (*)
Subtract (*)
Multiply (*)
Divide (*)
For instance, "Add" calculates the first value + the second value and set it to R0.
As for the "Divide" block, if the first value is indivisible by the second value, the result is a decimal value even if the two values are integers.
Remainder
Power
The first one calculates the remainder when the 1st value is divided by the 2nd value. The second one calculates the 1st value to the power of the 2nd value. And sets the result to R0.
Square root Calculate the square root of the value and set the result to the variable R0.
Random number Set a random integer number to the variable R0. The integer number is greater or equal to the first value and less or equal to the second value. The second value must be greater or equal to the 1st value, otherwise the program stops.
Ask a value If you run this block, it shows a dialog to ask you a number that will be set to R0. If you tap the Cancel button in the dialog, the program stops. (If in the User Block, it just exits from the User Block.)
Return value It makes the variable R0 to be the return value of the User block. If you use this block in a User Block, the value of the variable R0 will not change (will not be recovered) when exiting from the User Block.
This block is used in the User Block. If you want not to change multiple variables, you have to use this block multiple times in a User block.
see "User block" in the additional information of How to use.
Direction blocks : changes the direction of the program

Down
Up
Right
Left
It changes the running direction.
When the program started, the running direction is rightward, which means that blocks are processed from left to right until there is no block on the right.
But if there is, for instance, a Down block, the running direction changes to downward at this block and the block at downward is processed and the direction continues to be downward from there.
Control blocks: It changes the running direction by the certain condition. Also Loop blocks do the loop (**).
** "Loop" means that it continues to process the blocks to the right for the number of times. Which means, it processes the blocks to the right of the loop block until there is no block and jumps back to the loop block, and repeats this for the specified number of times, or in case of the Loop by Condition block, it repeats while the condition is true.
Condition If the condition of comparison with the variable R0 is true, the running direction will be rightward. If false, the running direction will be downward.
It works as the "IF" statement of the general programming language.
Loop By Number (*) It loops the rightward blocks for the specified times. After doing the loops for specified number of times, it goes to downward.
You can use this block more than once in twofold or threefold or more.
Loop By Condition While the condition of comparison with the variable R0 is true, it loops the rightward blocks. If the result is false, it goes to downward.
It works as the "While" statement of the general programming language.
Loop By Range It sets the first number to the variable R0 and processes the blocks at the right. Then it adds 1 to the variable R0 and processes the blocks at the right. It continues to do so until R0 becomes equal to the second value and the blocks at the right are processed, then goes to downward.
You can use 2 of this block in twofold way, but if you use the same R in both blocks, it may cause a strange result.
You shouldn't change the value of R in the loop, unless you are doing it intentionally, like when you want to exit from the loop immediately.
It's similar to the "For" statement of the general programming language.
Check Arrow It checks if the selected arrow is pressed at the time of this block is run. If the arrow is currently pressed, the run direction becomes rightward. If not, downward.
While a program that contains this block is running, a virtual keyboard of arrows will appear. It checks whether the arrow is pressed or not when this block is being processed.
Hour Glass It waits the specified duration (in milliseconds) with doing nothing.
If you run a program, it usually runs slowly. If you move the speed slider to the right, it runs faster.
But waiting duration of this block is not affected by the speed of the program.
Sound blocks : Makes sound
Play a sound It makes a sound. In the pulldown list of this block, you can specify a note of the sound. If you want to change the volume of the sound, use "Volume Block".
The sound stops after around 1 second or when the program ends.
Among the pulldown list in the block, the first one makes no sound and you can use it to stop the sound while playing. After that, in "Number : Note" format, the number means the octave. "4 : A" is 440Hz. "5 : A" is the next high A.
If you want to continue to make the sound, run this block again and again. If you run this block with the different note while playing, it changes the note immediately.
Volume It sets the volume of the sound that will be played. This block itself does not make a sound.
The volume is from 0 (no sound) to 100 (max).



Go back to "How to use"