List of Blocks

  1. Control
  2. Turtle
  3. Paint
  4. Utility
  5. Expression
  6. Variable
  7. More Blocks in Full Version
Startup

Type: Control

This is one of the Head Blocks. All Head Blocks are in green like this one. You can connect blocks below a Head Block to form a Block Sequence. The Head Block will determine when the Block Sequence should run. Other blocks must be put in a Block Sequence , or it will never run.
This block will run its Block Sequence as soon as the program starts running.

Note: you can drug out many Head Blocks, they can run at the same time without disturbing each other.

Wait time seconds

Type: Control

Wait time seconds before running following blocks.

Break

Type: Control

This block must be used in one of the "Loop" blocks.
When this block runs, it will make the closest outer "Loop" block stop running at once.

Continue

Type: Control

This block must be used in one of the "Loop" blocks.
When it runs, this block will stop the current "loop" (a "loop" means letting the blocks in one of the "Loop" blocks run once), and ask the closest outer "Loop" block to do what it should do after this "loop" (usually starting a new "loop").

Return

Type: Control

Stop a Block Sequence from running. If this is a Block Sequence below a blockette, the Block Sequence containing the "Perform" block which called the blockette will continue to run.

Repeat number times

Type: Control

This "Repeat" block is one of the Loop blocks. You can plug other blocks into this block's inner socket to form a Sub-Block-Sequence.
When this block is running, it will run its Sub-Block-Sequence, run and run. It will let its Sub-Block-Sequence run for number times. Every time is called a "loop".

Loop forever

Type: Control

This "Loop forever" block is one of the Loop blocks. You can plug other blocks into this block's inner socket to form a Sub-Block-Sequence.
When this block is running, it will run its Sub-Block-Sequence, run and run. It will let its Sub-Block-Sequence run forever. Every time is called a "loop".
This block won't stop running until you use a "Break" block to jump out of this block.

Loop variable from begin to end step step

Type: Control

This block is one of the Loop blocks. You can plug other blocks into this block's inner socket to form a Sub-Block-Sequence.
It will assign the numbers begin, begin + step, begin + 2*step... to variable one by one, but stop assigning when the number is greater than end. With each value of variable, it will run its Sub-Block-Sequence once (one "loop").

The begin, end, step can't be changed while this block is running.

Warning: if step is zero , this block will act like a "Loop forever" block.

While condition do

Type: Control

This "While" block is one of the Loop blocks. You can plug other blocks into this block's inner socket to form a Sub-Block-Sequence.
When this block is running, it will run its Sub-Block-Sequence, run and run. Every time is called a "loop".
Before every loop, it will check condition. If condition is false, it will stop running.

Repeat until condition

Type: Control

This "Repeat Until" block is one of the Loop blocks. You can plug other blocks into this block's inner socket to form a Sub-Block-Sequence.
When this block is running, it will run its Sub-Block-Sequence, run and run. Every time is called a "loop".
After every loop, it will check condition. If condition is true, it will stop running.

If condition

Type: Control

You can plug other blocks into this blocks's inner socket to form a Sub-Block-Sequence.
When it starts running, it will check condition. If condition is true, it will let the blocks in it run, or it will do nothing.

If condition
Else

Type: Control

This block has two inner sockets. You can plug other blocks into both of them to form two Sub-Block-Sequence.
When it starts running, this block will check condition first. If condition is true, it will let its first Sub-Block-Sequence run. If condition is false, it will let its second Sub-Block-Sequence run.

Go home

Type: Turtle

Move the turtle to the center of the stage. Then turn the turtle to the straight-up direction.

Pen down

Type: Turtle

Allow the turtle to leave trails as it is moving. (This is the default way the turtle moves, so you do not need to use this block at the beginning of a program)

Pen up

Type: Turtle

Stop the turtle from leaving trails as it is moving.

Show

Type: Turtle

Show the turtle.

Hide

Type: Turtle

Hide the turtle.

Move forward distance

Type: Turtle

Move the turtle distance pixel(s) forward. The turtle will draw a trail on the way as it is moving.

Move backward distance

Type: Turtle

Move the turtle distance pixel(s) backward. The turtle will draw a trail on the way as it is moving.

Turn left angle

Type: Turtle

Turn the turtle angle degree(s) left.

Turn right angle

Type: Turtle

Turn the turtle angle degree(s) right.

Move to x x y x

Type: Turtle

Move the turtle to the point (x, y).

Point at x x y y

Type: Paint

Draw a point at the point (x, y) in the rectangular coordinate system using the default line color and width (which determines the size of the point).

Line from x x1 y y1 to x x2 y y2

Type: Paint

Draw a line from point (x1, y1) to point (x2, y2) using the default line color and line width.

Rect at origin x x y y width width height height

Type: Paint

Draw a rectangle using the default line color, line width and fill color. Its top-left point is (x, y). Its width is width and its height is height.

Ellipse at center x x y y radius h h v v

Type: Paint

Draw a ellipse using the default line color, line width and fill color. Its center point is (x, y). Its horizontal radius is h and its vertical radius is v.

Write content at center x x y y

Type: Paint

Write the string "content" on the stage. The text's top-left point is (x, y).

Write content at origin x x y y

Type: Paint

Write the string "content" on the stage. The text's central point is (x, y).

Color at x x y y

Type: Utility

Get the color showing at the point (x, y) on the stage.

Random color

Type: Utility

Generates a random color.

Note: the generator will pick both random color and random transparency.

Color of red red green green blue blue alpha alpha

Type: Utility

Generate a color with red, green, blue, alpha in RGBA color system.

Note: All the four arguments' value should between 0 and 255 (including 0 and 255). If any value is not in the range, it will be replaced by 0 (if it is less than 0) or 255 (if it is larger than 255).

Color of hue h saturation s brightness b alpha a

Type: Utility

Generate a color with h, s, b, a in HSBA color system.

Note: All the four arguments' value should between 0 and 255 (including 0 and 255). If any value is not in the range, it will be replaced by 0 (if it is less than 0) or 255 (if it is larger than 255)

Set line width width

Type: Utility

Set how thick the lines and borders of shapes are on the stage. Use zero to draw shapes without borders.

Set line color color

Type: Utility

Set the default color used to draw lines and borders of shapes on the stage.

Set fill color color

Type: Utility

Set the default color used to fill all the shapes on the stage.

Clear by color color

Type: Utility

Color the whole stage into the specified color.

Set font font

Type: Utility

Set the default font used to show text on the stage. Click on font for a list containing all fonts on the device. You can choose among those fonts.

Note: the font list in different visions of iOS is different.

Set font size size

Type: Utility

Set the font size used to show text on the stage.

Back to Top

Expression

x + y

Type: Expression

Calculate x + y.

x - y

Type: Expression

Calculate x - y.

x X y

Type: Expression

Calculate x * y.

x / y

Type: Expression

Calculate x / y.

Warning: if y is zero, the result will be unexpected.

x mod y

Type: Expression

Calculate the reminder when x is divided by y.

Warning: if y is zero, the result will be unexpected.

x ^ y

Type: Expression

Calculate the yth power of x

Warning: if the expression is mathematically illegal, the result will be unexpected.

function ( argument )

Type: Expression

Calculate the value of a math function with the numeral argument given. Click on function to choose from the following:
abs, sqrt, sin, cos, tan, asin, acos, atan, ln, log, round, floor, ceil

Note: all angles are in Degree Mode instead of Radian Mode.

Warning: if argument is not in the function's domain, the result will be unexpected.

Random of minimum to maximum

Type: Expression

Generate a random number between minimum and maximum (including minimum and maximum).

Year

Type: Expression

Return the current year.

Month

Type: Expression

Return the current month.

Day

Type: Expression

Return the current day.

Hour

Type: Expression

Return the current hour in 24-hour time system.

Minute

Type: Expression

Return the current minute.

Second

Type: Expression

Return the current second.

Seconds since 1970

Type: Expression

Return the seconds past since 00:00:00, Jan. 1st, 1970.

Distance from x x1 y y1 to x x2 y y2

Type: Expression

Calculate the straight-line distance between point (x1, y1) and (x2, y2) in a rectangular coordinate system.

x < y

Type: Expression

Check whether x is less than y.

x <= y

Type: Expression

Check whether x is not greater than y.

x = y

Type: Expression

Check whether x equals to y.

Not x = y

Type: Expression

Check whether x does not equal to y.

x > y

Type: Expression

Check whether x is greater than y.

x >= y

Type: Expression

Check whether x is not less than y.

a and b

Type: Expression

Check whether both a and b are true.

a or b

Type: Expression

Check whether at least one of a and b is true.

Not bool

Type: Expression

Check whether bool is false.

Is x x y y in rect x x0 y y0 w w h h

Type: Expression

Check whether point (x, y) is in the following rectangle in a rectangular coordinate system.
The rectangle has a left-top point of (x0, y0). Its width is w. Its height is h.

Join a and b

Type: Expression

Join string a and b to form a new string.

Back to Top

Variable

Set value of variable to value

Type: Variable

Set the value of the variable with name variable to value.

Convert value to type

Type: Variable

Convert the value to a specified type. Click type to choose from the following types:
Boolean, Color, Number, String

Back to Top

More Blocks in Full Version

The following blocks are not included in Dynamic ART Lite. To use these blocks, please buy Dynamic ART on app store.

Add value to list list

Type: Variable

Append value after the last item in list.

Arc at center x x y y radius radius
angle start start end end

Type: Paint

Draw an arc which is a part of the circle with central point of (x, y) and radius of radius. The start angle of the arc is start degrees turning clockwise from the upright direction, and the end angle is end degrees turning clockwise from the upright direction.

Set number beats per minute

Type: Interaction

Set the default speed to play music as number beats per minute.

Clear list list

Type: Variable

Turn list into a empty list.

Copy list list1 to list list2

Type: Variable

Make list2 totally same as list1.

Curve from x x1 y y1 controlled by x x1-control y y1-control
to x x2 y y2 controlled by x x2-control y y2-control

Type: Paint

Draw a Bezier curve using the default line color and line width. The curve starts at (x1, y1) and ends at (x2, y2). The two control points are (x1-control, y1-control) and (x2-control, y2-control).

Heading to x x y x

Type: Turtle

Turn the turtle and make it face the point (x, y).

Insert value at index th of list list

Type: Variable

Insert the value at indexth of list. Items that were at indexth or behind it will be shifted one index right.

The index starts from zero.

Join list list with delimiter delimiter

Type: Variable

Form a string with all items in list separated by delimiter.

E.g. when delimiter is ".", the result will be "item0.item1.item2.item3.item4...".

Length of list list

Type: Variable

Calculate how many items there are in list.

List list is empty

Type: Variable

Check whether list is empty, which means that it contains no items.

Log data

Type: Interaction

Write data into the log book.
The format will be determined automatically according to the type of data.

Log list list

Type: Variable

Write list into the log book in the following format: "item0,item1,item2,item3,item4,item5..."

Blockette name

Type: Control

This is one of the Head Blocks. (To know what a Head Block is, turn to the definition of "Startup" block)
However, this is the only Head Block that won't run its Block Sequence by itself. You have to use a "Perform" block (the block below) to call this blockette by name. After being called, this blockette will run its Block Sequence, and the "Perform" block won't end until this Block Sequence ends.

Perform blockette

Type: Control

Call the blockette named blockette. The called blockette will start running its Block Sequence. This "Perform" block will wait until the called blockette finished running. Then the Block Sequence containing this "Perform" block will continue to run.

Play music notes

Type: Interaction

Play a song or a piece of music according to notes.

Notes is made of several notes separated by ","
The base element of each note is a tune symbol which is one of "C", "D", "E", "F", "G", "A", "B" meaning Do, Re, Mi, Fa, So, La, Ti.
Before it, you can add several "+"s or "-"s to raise or lower the tune by octaves.
After the tune symbol, you can add a "#" or a "b" as symbols of the rising or falling tune.
Then you have to give the time it lasts. It should be 4 divided by the beats it lasts. You can also add a "." to the end and that will multiply the time by 1.5.
E.g. An eigth note of high-pitched Do should be written like "+C8". And quarter notes of "Do Re Mi" should be written like "C4, D4, E4".

Play sound frequency HZ time seconds

Type: Interaction

Play a sound of frequency Hertz for time seconds.

Polygen by x x list y y list

Type: Paint

Draw a polygen by linking all the points. The points are formed by each item in x list as x position and its corresponding item in y list as y position.

Refresh

Type: Utility

Refresh the screen at once.

Remove index th of list list

Type: Variable

Remove the indexth item in list. Items that were behind it will be shifted one index left.

The index starts from zero.

Remove last item of list list

Type: Variable

Remove the last item of list.

Replace index th of list list with value

Type: Variable

Replace the original value at indexth of list with value.

The index starts from zero.

Set dash pattern line : space

Type: Utility

Set the pattern used to draw lines. When both line and space are zero, the lines will be drawn as solid lines. When both line and space are positive, the lines will be drawn as dotted lines: line pixel(s) solid, space pixel(s) hidden, line pixel(s) solid, space pixel(s) hidden...

Set line join type type

Type: Utility

Set the default type at the ending of a line or the breaking point of a broken line.

  • Miter: the line ends with two right angles (90). That means the straight line will look like a rectangle. The breaking point will be a chamfered corner.
  • Round: the line ends at a round point. That means the straight line will look like a rounded rectangle. The breaking point will be a rounded corner.
  • Bevel: the line ends just like Type Miter. However, the breaking point will be a bevel corner.

Split string to list list with delimiter delimiter

Type: Variable

Split string to many items and put them into list. The items are the substring before the first appearance of delimiter, the substring between the first and second appearance of delimiter, the substring between the second and third appearance of delimiter, ... , and the substring after the last appearance of delimiter.

E.g. when delimiter is ".", the string "abcdefg.hijklmn.opqrstu" will be split into "abcdefg", "hijklmn" and "opqrstu".

Note: when delimiter is "", the string will be split into items each contain one character.

Turn off auto refresh

Type: Utility

The screen is usually automatically refreshed every time a stroke is made. Use this block to stop the automatic refreshing. In this status, you have to use "Refresh" blocks to refresh the screen.

Turn on auto refresh

Type: Utility

Require the screen to be refreshed automatically every time a stroke is made. (This is the default way the stage shows images, so you do not need to use this block at the beginning of a program)

index th of list list

Type: Variable

Get the value of the indexth item of list.

Wait for touch

Type: Interaction

Wait until the screen is touched.

When touch begin

Type: Interaction

This is one of the Head Blocks. (To know what a Head Block is, turn to the definition of "Startup" block)
This block will run its Block Sequence as soon as the user puts his finger on the screen.

Note: it will start running without disturbing any Block Sequence that is currently running.

When touch end

Type: Interaction

This is one of the Head Blocks. (To know what a Head Block is, turn to the definition of "Startup" block)
This block will run its Block Sequence as soon as the user's finger leaves the screen.

Note: it will start running without disturbing any Block Sequence that is currently running.

When touch move

Type: Interaction

This is one of the Head Blocks. (To know what a Head Block is, turn to the definition of "Startup" block)
This block will run its Block Sequence every time the user moves his finger without leaving the screen.

Note: it will start running without disturbing any Block Sequence that is currently running.