Variables and constants
DECLARE Name : STRING
DECLARE Age : INTEGER
CONSTANT Pi <- 3.14
Name <- "Amina"
Age <- 15
OUTPUT Name, " is ", Age
Output
Amina is 15
We currently support IGCSE Computer Science Syllabus only. Support for Cambridge AS/A Level will be coming soon.
Not sure how to write something? Copy an example into the editor above, press Run, then change it to fit your program.
DECLARE Name : STRING
DECLARE Age : INTEGER
CONSTANT Pi <- 3.14
Name <- "Amina"
Age <- 15
OUTPUT Name, " is ", Age
Output
Amina is 15
DECLARE Name : STRING
OUTPUT "What is your name?"
INPUT Name
OUTPUT "Hello, ", Name
Output after typing Amina
What is your name?
Hello, Amina
// A comment starts with two slashes
OUTPUT "Comments are ignored"
Output
Comments are ignored
DECLARE Mark : INTEGER
INPUT Mark
IF Mark >= 50
THEN
OUTPUT "Pass"
ELSE
OUTPUT "Try again"
ENDIF
Output after typing 72
Pass
DECLARE Day : INTEGER
INPUT Day
CASE OF Day
1 : OUTPUT "Monday"
2 : OUTPUT "Tuesday"
OTHERWISE OUTPUT "Another day"
ENDCASE
Output after typing 2
Tuesday
DECLARE Count : INTEGER
FOR Count <- 1 TO 5
OUTPUT Count
NEXT Count
Output
1
2
3
4
5
DECLARE Total : INTEGER
Total <- 0
WHILE Total < 10 DO
Total <- Total + 3
ENDWHILE
OUTPUT Total
Output
12
DECLARE Guess : INTEGER
REPEAT
INPUT Guess
UNTIL Guess = 7
OUTPUT "Got it!"
Output after typing 3, then 7
Got it!
DECLARE Scores : ARRAY[1:3] OF INTEGER
DECLARE Index : INTEGER
Scores[1] <- 8
Scores[2] <- 5
Scores[3] <- 9
FOR Index <- 1 TO 3
OUTPUT Scores[Index]
NEXT Index
Output
8
5
9
PROCEDURE Greet(Name : STRING)
OUTPUT "Hi, ", Name
ENDPROCEDURE
CALL Greet("Amina")
Output
Hi, Amina
FUNCTION Square(Number : INTEGER) RETURNS INTEGER
RETURN Number * Number
ENDFUNCTION
OUTPUT Square(4)
Output
16
OUTPUT ROUND(3.14159, 2)
OUTPUT LENGTH("Hello")
OUTPUT UCASE("hi")
OUTPUT SUBSTRING("Computer", 1, 4)
OUTPUT DIV(17, 5)
OUTPUT MOD(17, 5)
Output
3.14
5
HI
Comp
3
2
Running the interpreter on your own computer means no waiting for the online version to start, and it works without internet. You don't need any coding experience: just follow the steps in order.
First-time setup takes a few minutes. After that, starting it takes seconds.
Python is the free program the interpreter is built with. Download it from the official website and run the installer.
Download PythonImportant: if the first screen of the installer has a box called Add python.exe to PATH, tick it before you click Install Now. Without it, your computer won't be able to find Python later.
Already have Python 3? You can skip this step. Step 2 shows you how to check.
A terminal is a window where you type instructions for your computer instead of clicking. You'll paste a few commands into it.
Press the Windows key, type PowerShell, and press Enter.
On a Mac, press Cmd + Space, type Terminal, and press Enter. On Linux, press Ctrl + Alt + T.
To check that Python installed correctly, paste this and press Enter:
python --version
python3 --version
You should see something like Python 3.12.4. Any version that starts
with 3. works.
Download the interpreter's files as a ZIP, then unzip it.
Download ZIPOpen your Downloads folder, right-click the ZIP file and choose Extract All, then click Extract.
Open your Downloads folder and double-click the ZIP file to unzip it.
You'll get a folder called Pseudocode_Interpreter-main. Inside it
you should see a folder called webapp and a file called
requirements.txt.
git clone https://github.com/md-shourov-hasan/Pseudocode_Interpreter.git
The terminal needs to be "inside" the interpreter's folder before it can run it.
The command for this is cd, short for "change directory".
Type cd followed by a space. Then drag the
Pseudocode_Interpreter-main folder from your file window and drop it
onto the terminal. Its location appears automatically. Press Enter.
It will look something like this:
cd C:\Users\you\Downloads\Pseudocode_Interpreter-main
cd ~/Downloads/Pseudocode_Interpreter-main
Windows sometimes puts the folder inside another folder with the same name.
Drag the one that has webapp inside it.
This downloads the small add-ons the interpreter uses. You only need to do this once.
python -m pip install -r requirements.txt
python3 -m pip install -r requirements.txt
Lots of text will scroll past. Wait until it stops and you can type again.
python webapp/app.py
python3 webapp/app.py
When you see Running on http://127.0.0.1:5000, it's ready. A warning
about a "development server" is normal, and you can ignore it.
Now open http://127.0.0.1:5000 in your browser. Write pseudocode on the left and press Run. Keep the terminal open while you use it. When you're done, click the terminal and press Ctrl + C to stop it.
You only need steps 2, 4 and 6: open a terminal, cd into the folder,
and start the interpreter.
python is not recognized?
Why does the terminal say command not found: python3?
Python isn't installed, or Add python.exe to PATH wasn't ticked.
Try typing py instead of python. If that also fails,
run the Python installer again, tick the box, and reopen PowerShell.
Python isn't installed yet. Go back to step 1, then close and reopen the terminal.
No such file or directory or can't open file?
The terminal isn't inside the right folder. Repeat step 4, and make sure you drag
the folder that contains webapp.
No module named 'flask' mean?Step 5 didn't finish. Run it again and wait until the text stops scrolling.
The interpreter only runs while its terminal is open. Check the terminal is still
open and showing Running on. If you closed it, do steps 2, 4 and 6
again.
No. It appears every time the interpreter starts and is safe to ignore. Once you
see Running on http://127.0.0.1:5000, it's ready to use.
Click the terminal and press Ctrl + C, or just close the terminal window. To start it again, do steps 2, 4 and 6.
Only for the first-time setup, to download Python and the interpreter. After that it runs entirely on your computer and works offline.