PG0 is a programming language designed for learning programming.
It focuses on understanding the basic structures essential to programming: sequential, branching, and looping.
For simplicity, the language specifications are very straightforward, supporting only one type of branching and looping, and handling only integer data types.
How to Use PG0
PG0 Execution Screen
Editor
Variables
Console
PG0 Execution Screen (Mobile)
Editor
Variables
Console
Editor
This is the section where you write your program.
During execution, the current line is highlighted in light blue.
Editing is not possible during execution.
Variables
This displays the variables and their values during program execution.
Values changed by the current line are highlighted in red.
Arrays can be expanded to view their contents.
Console
This displays information about the execution (Start, Stop, End).
If a variable is specified with the 'exit' command, its content is displayed in the console as the execution result.
Errors in the program are displayed in red in the console.
Execution
Automatically executes the program written in the editor, line by line.
Step execution
Executes the program step-by-step.
Re-selecting step execution runs the next line.
This feature allows manual execution of the program, one line at a time.
Execute to Cursor
Executes the program up to the line where the editor cursor is.
Stop
Stops the running program. A stopped program cannot be resumed.
For pausing a program, select step execution.
Execution speed
Choose the speed of automatic line-by-line execution.
Selecting "No wait" will execute the program quickly until the end.
Fast
Normal
Slow
Variables
Containers for assigning numerical values.
Use '=' to assign numbers, variables, or computation results to variables.
a = 10 // Assigns 10 to variable a
Variables are prepared when used but can be explicitly declared with 'var'.
var i, j = 100// Multiple variables can be declared using ','
The result of executing the above in the editor is shown below.
Arrays
Arrays are containers where variables are sequentially arranged.
Specify '[]' after a variable to handle it as an array.
a[0] = 100// First elementa[1] = 200// Second elementi = 5b[i] = 10// Specify index with a variable
The result of executing the above in the editor is shown below.
To initialize arrays, assign '{value1, value2, value3,...}'.