Introduction [1/10]
Learn to Code, Here and Now!
Click the “Run” button to get started.
When you run the provided program, it will display a short animation.
Then, click “Next” to proceed.

To run the program, just click the “Run” button.
The source code of the program consists of two statements, each on its own line.
The editor automatically colors the source code, to make it easier to read. This feature is called “syntax highlighting”.
The println (“print line”, P-R-I-N-T-L-N) statement displays text on the screen.
The disc function draws a disc. Its position, size, and color are specified by values inside the parentheses (also known as round brackets).
Exercise:
Add the following statement to the program: disc( 600,150, 100 , /red );
This complex program creates a short animation. Run it now to see it.
The program's source code consists of many statements that work together to produce the animation.
Next, we'll make a small change to the program.
Exercise:
Find the second statement in the source code that includes the word ZedLX, and replace it with a different word of your choice. Then, run the program to see the effect of your change.
* * *
To share your animation with others, just click the Share button above the source code.
The, enter a title for your program, and leave any other fields blank if you like.
Then, click “Create Link” to get a unique link to your program. Click on the link to view your program in action. To share it with others, use the buttons on the “Execution Completed” page.
Run the program to see it in action.
In programming, “to print out” actually means to display information on the screen.
A text enclosed in quotation marks is called a string. Strings are printed on the screen exactly as they are written.
In addition to strings, a println statement can also print expressions. Expressions can use various operators like +, -, *, and / .
Important Notes:
- Plain statements must end with a semicolon (;)
- To print multiple items, they must be separated by commas (,)
This program contains an error. Don't worry, finding and fixing errors is a normal part of computer programming.
Click the Check button to get a hint about what might be wrong. The automatic verifier will analyze the code and provide feedback.
Correct the error and run the program.
Hint: Sometimes, the verifier will offer helpful suggestions. In this case, pay close attention to the advice it provides.
Solution...
Many times, the actual error is located just before the reported one. This is one such case.
The error is in the third statement: it is missing a semicolon (;) at the end:
println "Up above the world so high," ;
In programming, the operator * is
used to denote multiplication.
[Run the program]
Round brackets (), also called parentheses, can be used to group expressions.
Square brackets [] or curly brackets {} (also known as braces) cannot be used to group expressions.
Exercise:
Display the result of the expression: 15*3+2*(90+10)
In the first statement, the program prints the numbers 12 and 7 together.
Without any separation, they appear as number 127.
[Run the program]
A way of separating the results would be to add some space between the numbers.
For a more enjoyable reading experience, we recommend using the fullscreen mode. You can enter fullscreen by pressing the F11 key. To exit fullscreen, simply press the F11 key again.
Exercises:
Add the following statement to the program: println "Jammed together:" , 2, 5, 1+1;
Add the following statement to the program: println "Un-jammed: ", 2," ",5," ",1+1;
This program outputs the expressions together with the results.
[Run the program]
At first glance, it might seem that the strings contain expressions, but that is just an illusion. Strings cannot contain expressions, they only contain text.
Strings are printed out as they are written. Expressions are evaluated, and then their results are printed.
Exercise:
Add the following statement to the program: println "3m × 4m = ", 3*4, "m²";
It looks like this program contains an error.
Click the Check button to view the error description.
Correct the error, then run the program.
Helpful Hint: While the error report may seem difficult to understand this time, the automatic verifier has actually provided an excellent clue.
Solution (click):
println 8 +(10 - (2+7));
This program produces a simple animation.
The source code contains many unexplained features.
[Run the program]
Let's make some small changes to the source code.
Important Note:
Keep in mind that all names are case-sensitive.
For example, purple
is not the same as PuRpLe,
nor Purple nor PURPLE).
Exercises:
Modify the color of the disc to purple.
[Run the program]In the source code of this program, change the number 6 to number 2 in order to slow down the motion.
[Run the program]
<< F2:Prev - - F4:Next >>