Live: will automatically execute upon every character typed (warning:
could result in issues if you have intensive or partially-completed code
that results in an infinite loop)
Exited code editor: will automatically execute code when the code editor
loses
focus - i.e. when you click outside of the code editor
Run on click: code will only be executed when you click the triangular
run/play
button
File Manager
Search & browse files easily
Pseudocode
Write and run pseudocode
Java
See a Java equivalent to your pseudocode program
Note: the site doesn't allow executing Java. An IDE like IntelliJ will provide an easy installation of the JDK and is recommended for running Java locally
Python
See a Python equivalent to your pseudocode program
Note: the site doesn't allow executing Python. An IDE like PyCharm will provide an easy installation of the Python interpreter and is recommended for running Python locally
Visual Basic
See a Visual Basic (VB) equivalent to your pseudocode program
Note: the site doesn't allow executing Visual Basic. An IDE like Visual Studio will provide an easy installation of the Visual Studio compiler and is recommended for running Visual Basic locally
New Program
Choose from a number of pre-made programs or create your own
Modifying a pre-made program will automatically create a new program, ensuring the
original & modified version are available
Create Trace Table
Automatically create trace tables for your code
Can use the BREAKPOINT keyword to add breakpoints at specific parts of your program
Use TRACE_NEXT_ROW to force new row to be created in trace table
Autoformat Code
Toggle original/formatted code
Pretty-printing/auto-formatting code will insert new lines, indentation and apply consistent styling rules. If enabled, pretty-printing will also occur each time you run your program
You can even try writing your entire program on one line...and it should still run and be formatted correctly :)
Note: code may be re-ordered (e.g. all declarations moved to the top) due to the way the site works
Tested and works for all demo programs - please contact me if this breaks any of your working code!
Show Tokens
Display the program broken down into tokens after the tokenisation ("lexical analysis") stage
Show Abstract Syntax Tree
Display a visual representation of the parse result of the program
Load
Load a previously-saved pseudocode file (.pseudo default extension)
Download
Download a .pseudo file for future use
Note: programs will be saved periodically (every 10 seconds) to your browser's
storage if changes are made - this means you can access your programs across
multiple tabs
Upload
Save your program for public-viewing by anyone
Sharing
Share a direct link containing your code - your code will be contained in the URL and
NOT stored on the server
Alternatively, you can select the upload option to upload your code publicly to the
server
Quiet Editor
Remove bloat like the navigation bar & footer to focus only on the code editor
Note: can be toggled with CTRL + Q (quiet mode)
Fullscreen Quiet Mode
Toggle between regular and fullscreen mode
Note: pressing FN/F11/ESC keys isn't recommended, since they can't be detected by the site, hence the additional 'quite mode' settings can't be applied - the removing of the nav bar & footer. To enter this fullscreen mode, either use this button or the keyboard shortcut CTRL + M (minimise <-> maximise)
The site aims to enforce the statically-typed nature of pseudocode - i.e. assigning a STRING to
an
INTEGER variable should be forbidden. Some combinations are allowed, however - such as assigning
a
CHAR to a STRING or an INTEGER to a REAL. Other additional checks to ensure valid pseudocode are
also in place
The site has been well-tested and there aren't any bugs we are aware of, however, if you believe
the
site is incorrectly giving you an error & preventing your code from running, you can disable the
error-checking
Note that it is not possible to disable fatal error messages such as syntax errors, runtime
errors
etc
Subroutine Signature Hints
If enabled, the following information will be shown:
Keyword/Identifier/Module Name Suggestions
Subroutine parameters & types
Return types
Subroutine descriptions
Examples
Switch Program Shortcuts
Choose whether CTRL + SHIFT + LEFT/RIGHT should navigate to the previous program - can be
disabled to prevent accidental triggering
Toggle Keyboard Shortcuts
Enable or disable this website's additional keyboard shortcuts (switch program, change font size,
code execution etc) - note: standard editor & browser shortcuts will still apply
Use Assignment Arrow
Will cause "<-" to be replaced with the Unicode "←" symbol as the user is typing - can also use CTRL + SHIFT + < to insert this symbol
Allow LENGTH() for Arrays
Turning this on will disable the warning message if using the LENGTH function to get the number of elements in an array
Code Snippets
These are pre-written code templates - for example, if you type in "DECLARE" in the code editor, you will see options to declare single variables, 1 & 2D arrays - you can disable this option
Show Toolbar Program Browser
If enabled, will show the program browser in the toolbar even if the sidebar file browser is open
Wait for Tips
Will show the loading screen until at least the tip (hint) has been displayed, even if the site is fully loaded. Disabling this can hence make the editor screen appear faster, if the page is ready
Max Execution Time
To prevent infinite loops resulting in the page becoming unresponsive, code will automatically
terminate if this value (in seconds) is exceeded
If you have a legitimate long-running program, you can obviously set this to a high value -
alternatively, setting to -1 will disable this check
{"0":"Algorithms","1":"Selection","2":"Iteration","3":"Arrays","4":"Records","5":"ENUMs","6":"Custom Modules","7":"Files","8":"Object-Oriented Programming","9":"Abstract Data Types","10":"Sets","11":"Pointers","12":"Recursion","13":"Exam Questions","14":"Games","15":"Mathematics","16":"Art","17":"Utilities","18":"Other"}
Welcome to Pseudocode Pro
This site was developed to solve the problems of students either being completely stuck with pseudocode,
or attempting a solution, but having no way of actually validating if it would work (other than a manual
trace table). This site supports the entire Cambridge IGCSE (0478), O-Level (2210) and 9618 A-Level pseudocode
specifications from the guide/syllabus, with extension modules supporting sound, canvas, events, custom html etc
Below are lists of both the currently support pseudocode and general website features:
Additional coding challenges (I will create 2 per day, will have 500 in total eventually)
Starter code & implementation of pre-defined modules for IGCSE/O-Level/A-Level past papers, so
students can write and test their solutions directly, as they would in the exam
Those last 2 features are currently in progress, so an extra 3 months free
will be given to anyone who buys a license now to acknowledge this
For any issues, feature requests, comments etc, you can contact me
Token List
Work in progress: some buttons currently don't work...just select "All"
Token
Description
Example
Parameters
Thanks for using the site - I hope you enjoy it and if you do, it would mean a lot if you could share it with your friends too :)
Trace Table ✥
New Row
Module Call
Will start a new line when entering a new module - e.g.
PROCEDURE a()
//new line in trace table
...
ENDPROCEDURE
After Parameters
Will start a new line after parameters have had their values traced
PROCEDURE a(b : INTEGER)
//b's value is traced
//new line in trace table
...
ENDPROCEDURE
Loop Iteration
Will start a new line upon each iteration of a loop
REPEAT
//new line in trace table
...
UNTIL index = 10
Pre Loop
Will start a new line before a loop has started
//new line in trace table
REPEAT
...
UNTIL index = 10
Post Loop
Will start a new line after a loop has ended
REPEAT
...
UNTIL index = 10
//new line in trace table
If Statement
Will start a new line inside an IF or ELSE condition
IF a > b THEN
//new line in trace table
ELSE index = 10
//new line in trace table
ENDIF
Left to Right
Many suggest that trace tables should be read left-to-right, top to bottom. Hence, if a value on the current row is to be updated, but a value in a column further right on the same row has already been updated, a new row should be started
If we have the column order a, b and the following assignments...
b <-- 1
a <-- 2
b <-- 3
Then the following trace table should be created (note how the assignment to 'a' has to start a new line, since we have already assigned to a variable in a column to the right ('b')
a
b
1
2
3
Extra Options
Show Duplicates
Usually, the same value being assigned to a variable that it already contains won't be shown on a trace table - by default, it's shown by cells with a black/grey striped background. Enable this option if you'd like the value to be shown instead
a <-- 111
a <-- 111
Show Line Numbers
Show the line numbers in the cell where the value was updated - rather than having to hover your mouse over that cell
Trace All
Trace all variables, even if its order not explicitly specified in the box to the left
Hover or click to show help
Trace table only generated when this dialog is open
Specify variables & order to trace above - default is all, in order they are declared
Hovering your mouse over a cell will display the line number this value was assigned
Use BREAKPOINT keyword to pause execution at specific point
Use TRACE_NEXT_ROW to force creation of a new row at specific point
Grey/black diagonally-shaded cells indicate the value assigned is unchanged
Work in progress. Currently buggy for records, classes, sets etc - will be fixed soon :)
Re-run program for changes to take effect
Program Tokens ✥
Note: tokens were generated via a series of regex rules
Type
Value
Line
Char
Abstract Syntax Tree ✥
{"c":"\/\/ * Code Author: doublerone\n\/\/ * Date: 2024\/12\/07\n\/\/ * Description: This took me 16, yes SIXTEEN hours nonstop to finish as i had to develop every single function that wouldve been built-in otherwise cuz CIE is a dumass. Started at 4 pm and finished at 8 am the next day. god this was harsh.\n\/\/ * Categories: \n\n\/\/day 5 : Task, Find the Lists of pages already in correct order and find the sum of all the pages in the middle of those correct lists\r\n\r\nDECLARE Orders, pages, string1, num1, num2, comp : STRING\r\nOrders <-- \"\r\n47|53\r\n97|13\r\n97|61\r\n97|47\r\n75|29\r\n61|13\r\n75|53\r\n29|13\r\n97|29\r\n53|29\r\n61|53\r\n97|53\r\n61|29\r\n47|13\r\n75|47\r\n97|75\r\n47|61\r\n75|61\r\n47|29\r\n75|13\r\n53|13\r\n\"\r\n\r\nDECLARE ListOfOrders : ARRAY[1: ROUND((LENGTH(Orders)+1)\/6, 0)] OF STRING\r\nDECLARE count, count2, count3, count4, LargestNum : INTEGER\r\n\r\ncount2 <-- 1\r\n\r\nFOR a <-- 1 TO LENGTH(Orders)\r\n IF MID(Orders, a, 1) = \"|\" THEN\r\n count <-- a-1\r\n WHILE IS_NUM(MID(Orders, count, 1))\r\n num1 <-- num1 & MID(Orders, count, 1) \r\n count <-- count -1\r\n ENDWHILE\r\n count <-- a+1\r\n WHILE IS_NUM(MID(Orders, count, 1))\r\n num2 <-- MID(Orders, count, 1) & num2\r\n count <-- count + 1\r\n ENDWHILE\r\n IF STR_TO_NUM(num1) > LargestNum THEN\r\n LargestNum <-- STR_TO_NUM(num1)\r\n ENDIF\r\n IF STR_TO_NUM(num2) > LargestNum THEN\r\n LargestNum <-- STR_TO_NUM(num2)\r\n ENDIF\r\n ListOfOrders[count2] <-- num1 & \"|\" &num2\r\n num1 <-- \"\"\r\n num2 <-- \"\"\r\n count2 <-- count2 + 1\r\n ENDIF\r\nNEXT a\r\n\r\ncount3 <-- 1\r\ncount2 <-- 1\r\ncount <-- 1 \/\/always reset ur counter variables kids\r\n\r\nDECLARE OrderList : ARRAY[1:LargestNum] OF STRING\r\nDECLARE inList : BOOLEAN\r\n\r\nFOR a <-- 1 TO LENGTH(ListOfOrders)\r\n FOR b <-- 1 TO LENGTH(ListOfOrders[a])\r\n IF MID(ListOfOrders[a], b, 1) = \"|\" THEN\r\n count <-- b-1\r\n WHILE count<> 0 \r\n num1 <-- num1 & MID(ListOfOrders[a], count, 1)\r\n count <-- count - 1\r\n ENDWHILE\r\n count <-- b+1\r\n WHILE count <> LENGTH(ListOfOrders[a])+1\r\n num2 <-- MID(ListOfOrders[a], count, 1) & num2\r\n count <-- count + 1\r\n ENDWHILE \r\n ENDIF\r\n NEXT b\r\n inList <-- FALSE\r\n count2 <--1\r\n REPEAT\r\n IF num1 = OrderList[count2] THEN\r\n inList <-- TRUE\r\n ENDIF\r\n count2 <-- count2 + 1\r\n UNTIL count2 > LENGTH(OrderList) OR OrderList[count2] = \"\"\r\n\r\n IF inList = FALSE THEN\r\n OrderList[count3] <-- num1\r\n count3 <-- count3 + 1\r\n \r\n ENDIF\r\n inList <-- FALSE\r\n count2 <-- 1\r\n REPEAT\r\n IF num2 = OrderList[count2] THEN\r\n inList <-- TRUE\r\n ENDIF\r\n count2 <-- count2 + 1 \r\n UNTIL count2 > LENGTH(OrderList) OR OrderList[count2] = \"\"\r\n IF inList = FALSE THEN\r\n OrderList[count3] <-- num2\r\n count3 <-- count3 + 1\r\n ENDIF\r\n inList <-- FALSE\r\n num1 <-- \"\"\r\n num2 <-- \"\"\r\nNEXT a\r\n\r\n\r\ncount <-- 1\r\ncount2 <-- 1\r\ncount3 <-- 1\r\n\r\nFOR a <-- 1 TO LENGTH(ListOfOrders)\r\n FOR b <-- 1 TO LENGTH(ListOfOrders[a])\r\n IF MID(ListOfOrders[a], b, 1) = \"|\" THEN\r\n count <-- b-1\r\n WHILE count<> 0 \r\n num1 <-- num1 & MID(ListOfOrders[a], count, 1)\r\n count <-- count - 1\r\n ENDWHILE\r\n count <-- b+1\r\n WHILE count <> LENGTH(ListOfOrders[a])+1 num2 <-- MID(ListOfOrders[a], count, 1) & num2\r\n count <-- count + 1\r\n ENDWHILE \r\n ENDIF\r\n NEXT b\r\n count2 <-- 1\r\n REPEAT\r\n IF num1 <> OrderList[count2] THEN\r\n count2 <-- count2 + 1\r\n ENDIF\r\n UNTIL num1 = OrderList[count2] OR count2>LENGTH(OrderList)-1\r\n count3<--1\r\n REPEAT\r\n IF num2 <> OrderList[count3] THEN\r\n count3 <-- count3 + 1\r\n ENDIF\r\n UNTIL num2 = OrderList[count3] OR count3>LENGTH(OrderList)-1\r\n IF count2>count3 THEN\r\n OrderList[count3] <-- num1\r\n OrderList[count2] <-- num2\r\n ENDIF\r\n num1 <-- \"\"\r\n num2 <-- \"\"\r\n\r\nNEXT a\r\nDECLARE unused : INTEGER\r\nunused <-- 1\r\n\/\/found all the unique goddam numbers \r\n\/\/FOR a <-- 1 TO LENGTH(OrderList)\r\n OUTPUT OrderList[a]\r\n\/\/NEXT a\r\nREPEAT\r\n IF OrderList[unused] <> \"\" THEN\r\n unused <-- unused + 1\r\n ENDIF\r\nUNTIL OrderList[unused] = \"\"\r\n\r\nCONSTANT cons = unused\r\n\/\/OUTPUT cons\r\ncount <-- 1\r\n\r\npages <-- \"75,47,61,53,29\r\n97,61,53,29,13\r\n75,29,13\r\n75,97,47,61,53\r\n61,13,29\r\n97,13,75,29,47\"\r\n\r\npages <-- pages & \"\r\n\"\r\n\/\/278\r\n\r\ncount <-- 1\r\n\r\nFOR b <-- 1 TO LENGTH(pages)\r\n IF MID(pages,b ,1) = \"\r\n\" THEN\r\n count <-- count+1\r\n ENDIF\r\nNEXT b\r\n\r\nDECLARE pageList : ARRAY[1:count] OF STRING\r\n\r\ncount<--1\r\n\r\nFOR c <-- 1 TO LENGTH(pages)\r\n IF MID(pages,c, 1) <> \"\r\n\" THEN \r\n string1 <-- string1 & MID(pages,c,1)\r\n ELSE\r\n pageList[count] <-- string1\r\n \/\/OUTPUT pageList[count]\r\n string1 <-- \"\"\r\n count <-- count + 1\r\n\r\n ENDIF\r\nNEXT c\r\n\r\ncount <-- 0\r\ncount2 <-- 0\r\ncount3 <-- 1\r\ncomp <-- \"\"\r\nDECLARE maxLength : INTEGER\r\n\r\nFOR e<-- 1 TO LENGTH(pageList)\r\n FOR f<-- 1 TO LENGTH(pageList[e])\r\n IF MID(pageList[e], f, 1) = \",\" THEN\r\n count <-- count + 1\r\n ENDIF\r\n NEXT f\r\n IF count+1 > maxLength THEN\r\n maxLength <-- count\r\n ENDIF\r\nNEXT e\r\n\r\ncount <-- 1\r\ncount2 <--1\r\ncount3 <--1\r\ncomp <-- \"\"\r\ninList <-- FALSE\r\n\r\nDECLARE isCorrect : ARRAY[1:LENGTH(pageList)] OF BOOLEAN\r\nDECLARE comparison : ARRAY[1:maxLength+1] OF STRING\r\nDECLARE allowedLists : ARRAY[1:LENGTH(pageList)] OF INTEGER\r\n\r\nFOR m <-- 1 TO LENGTH(isCorrect)\r\n isCorrect[m] <-- TRUE\r\nNEXT m\r\n\r\nFOR j <-- 1 TO LENGTH(pageList)-1\r\n FOR k <-- 1 TO LENGTH(pageList[j])\r\n IF MID(pageList[j], k, 1) <> \",\" THEN\r\n comp <-- comp & MID(pageList[j], k, 1)\r\n ELSE\r\n comparison[count]<-- comp\r\n count <-- count + 1\r\n comp <-- \"\"\r\n ENDIF\r\n NEXT k\r\n comparison[count]<-- comp\r\n count2 <--1\r\n\r\n FOR l <-- 1 TO cons\r\n IF comparison[1] <> OrderList[count2] AND inList = FALSE THEN\r\n count2 <-- count2 + 1\r\n ELSE\r\n inList <-- TRUE\r\n ENDIF\r\n NEXT l\r\n count3 <-- 0\r\n REPEAT\r\n count3 <-- count3 + 1\r\n \/\/OUTPUT OrderList[count3+count2-1], \" | \", comparison[count3]\r\n IF OrderList[count3+count2-1] <> comparison[count3] THEN\r\n FOR n <-- 1 TO LENGTH(OrderList) \r\n IF OrderList[n] = comparison[count3] THEN\r\n IF n<count3+count2-1 THEN\r\n isCorrect[j] <-- FALSE\r\n ENDIF\r\n ENDIF\r\n NEXT n\r\n ENDIF\r\n UNTIL count3=LENGTH(comparison) OR isCorrect[j] = FALSE\r\n \r\n comparison <-- []\r\n count <-- 1\r\n count2 <-- 1\r\n inList <-- FALSE\r\n comp <-- \"\"\r\nNEXT j\r\n\r\ncount <-- 1\r\n\r\nisCorrect[LENGTH(isCorrect)] <-- FALSE\r\nFOR m <-- 1 TO LENGTH(isCorrect)\r\n IF isCorrect[m] = TRUE THEN\r\n allowedLists[count] <-- m\r\n count <-- count + 1\r\n ENDIF\r\n OUTPUT isCorrect[m]\r\nNEXT m\r\nOUTPUT \"^^ Ignore this final FALSE, idk i couldnt remove it\"\r\n\r\nDECLARE GrantEntry : BOOLEAN\r\n\r\ncount <-- 0\r\ncount2 <--0\r\ncount3 <--1\r\ncount4 <--0\r\ninList <--TRUE\r\ncomp <-- \"\"\r\n\r\nFOR e<-- 1 TO LENGTH(pageList)\r\n GrantEntry <-- FALSE\r\n FOR o <-- 1 TO LENGTH(allowedLists)\r\n IF e = allowedLists[o] THEN\r\n GrantEntry <--TRUE\r\n ENDIF\r\n NEXT o\r\n IF GrantEntry THEN\r\n FOR f<-- 1 TO LENGTH(pageList[e])\r\n IF MID(pageList[e], f, 1) = \",\" THEN\r\n count <-- count + 1\r\n ENDIF\r\n NEXT f\r\n inList <-- TRUE\r\n FOR i <-- 1 TO LENGTH(pageList[e])\r\n \r\n IF MID(pageList[e], i, 1) = \",\" AND inList THEN\r\n count2 <-- count2 + 1\r\n ENDIF\r\n IF count2 = count DIV 2 AND inList THEN\r\n count3 <-- i+1\r\n REPEAT\r\n comp <-- comp & MID(pageList[e], count3, 1)\r\n count3 <-- count3 + 1\r\n UNTIL MID(pageList[e], count3, 1) = \",\"\r\n count4<-- count4 + STR_TO_NUM(comp)\r\n comp <-- \"\"\r\n inList <-- FALSE\r\n ENDIF\r\n NEXT i\r\n inList <-- TRUE\r\n comp<-- \"\"\r\n count <-- 0\r\n count2 <-- 0\r\n count3 <-- 1\r\n ENDIF\r\nNEXT e\r\nOUTPUT count4","t":"Advent of Code 2024 day 5"}