Loading

Search Code

Search code contents

Close File Browser

Execution Mode

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 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)

Add Favourite

Add this code as a favourite you can view later

No errors βœ…

Error Checks

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

In such cases, please feel free to contact us

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

Require Variable Initialisation

If enabled, you will get warnings if trying to access uninitialised variables

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

Show Welcome Message

Toggle the welcome message/popup in the bottom right corner from showing

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

IGCSE Syllabus (Pseudocode p35) O-Level Syllabus (Pseudocode p35) A-Level Syllabus A-Level Pseudocode Guide A-Level Pseudocode Functions Report Bugs
YouTube Tutorials Discord Help
AssemblyCode BooleanLogic CIESchedule Program52
DemosπŸ§‘πŸ»β€πŸ« Keyword ListπŸ“œ Monthly Challenge: Getting...πŸ“†
{"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:

  • πŸ“¦ Variables & Constants
  • βž• Arithmetic & Logical Operators
  • πŸ“₯πŸ“€ INPUT & OUTPUT
  • β“βŒ IF/ELSE & CASE
  • πŸ” FOR/WHILE/REPEAT...UNTIL Loops
  • πŸ”§ FUNCTIONS & PROCEDURES
  • πŸ”’ BYVAL & BYREF
  • πŸ”’ ARRAYs
  • πŸ“’ TYPEs (Records & Enums)
  • πŸ“„ File Handling (Text & RANDOM)
  • 🧩 Object-Oriented Programming
  • πŸͺ£ Sets
  • πŸ‘‰ Pointers
  • --- Extra Non-Syllabus Features ---
  • πŸ”Š Sound
  • 🎨 Canvas
  • πŸ–²οΈ Events
  • πŸ–₯️ Custom HTML

Additional programs uploaded by the community can be found on the search page.

While you are here, why not try one of the many - and ever increasing list of - pseudocode coding challenges.

To support hosting & domain costs, for $2, a premium account can be purchased - this has the following benefits:

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 :)

Drag & drop code or data files here

{"c":"\/\/ * Code Author: MC_PHILLIPS\n\/\/ * Date: 2025\/10\/03\n\/\/ * Description: Demo showing linked lists using arrays and pointers. Lots of global variables but that is how the questions are in the exam.\n\/\/ * Categories: \n\n\/\/\"\"\"PSEUDO CODE FOR LINKED LIST\r\n\/\/EXERCISES AT END OF PAGE\r\n\r\n\/\/this module uses global variables , that are used in some of the procedures.\r\n\/\/Yes I know its not best practice but it makes things easier.\r\n\/\/they are declared and initialized after the function definitions.\r\n\/\/they are:\r\n\/\/FreePtr : INTEGER\r\n\/\/HeadPtr : INTEGER\r\n\/\/TailPtr : INTEGER\r\n\/\/CurrentPtr : INTEGER\r\n\/\/Null : INTEGER [Null <- 0, we are using 1 as the start \/\/index of arrays]\r\n\/\/aData : ARRAY[1:5] OF Node\r\n\/\/\"\"\"\r\nTYPE Node\r\n DECLARE Data : INTEGER\r\n DECLARE NextItem : INTEGER\r\nENDTYPE\r\n\r\n\r\nFUNCTION GetValue(Index : INTEGER) RETURNS INTEGER\r\n DECLARE Value : INTEGER\r\n Value <- aData[Index].Data\r\n RETURN Value\r\nENDFUNCTION\r\n\r\n\r\nPROCEDURE QuitIt()\r\n \/\/to stop execution -bug in the pseudococde interpreter\r\n DECLARE X:STRING\r\n X <- \"1\"\r\n OUTPUT RIGHT(X,1)\r\n \r\nENDPROCEDURE\r\n\r\n\r\nPROCEDURE DEBUGOUT()\r\n OUTPUT \"HeadPtr:\",HeadPtr\r\n OUTPUT \"TailPtr:\",TailPtr\r\n OUTPUT \"FreePtr:\",FreePtr\r\n OUTPUT \"Nodes:\"\r\n DECLARE i : INTEGER\r\n DECLARE s : STRING\r\n FOR i <- 1 TO ListLength\r\n s \u2190 \" \"\r\n IF i = HeadPtr THEN\r\n s \u2190 s & \"Head\"\r\n ENDIF \r\n IF i = TailPtr THEN\r\n s \u2190 s & \" Tail\" \r\n ENDIF \r\n IF i = FreePtr THEN\r\n s \u2190 s & \"Free\"\r\n ENDIF \r\n s \u2190 RIGHT(s & \"->\",12)\r\n OUTPUT s,i,\":\",aData[i].Data,\" ->\",aData[i].NextItem\r\n NEXT i\r\nENDPROCEDURE\r\n\r\n\r\nPROCEDURE TraverseListInOrder()\r\n DECLARE Ptr : INTEGER\r\n Ptr <- HeadPtr\r\n WHILE Ptr <> Null\r\n OUTPUT aData[Ptr].Data,\":\",Ptr\r\n Ptr <- aData[Ptr].NextItem\r\n ENDWHILE\r\nENDPROCEDURE\r\n\r\n\r\nFUNCTION PUSH(Value : INTEGER) RETURNS INTEGER\r\n\/\/ this inserts an item into a linked list so the list is naturally sorted ASC (lowest to highest)\r\n IF FreePtr = Null THEN\r\n \/\/no space in array\r\n RETURN Null\r\n ENDIF\r\n DECLARE PreviousPtr : INTEGER\r\n DECLARE InsertedPtr : INTEGER\r\n DECLARE FOUND : BOOLEAN\r\n \/\/if starting a list\r\n IF HeadPtr = Null THEN \r\n \/\/FreePtr moves to used list. Get the new FreePtr\r\n InsertedPtr <- FreePtr\r\n FreePtr <- aData[FreePtr].NextItem\r\n aData[InsertedPtr].Data <- Value\r\n aData[InsertedPtr].NextItem <- Null\r\n \/\/reset pointers\r\n HeadPtr <- InsertedPtr\r\n TailPtr <- InsertedPtr \/\/\r\n RETURN HeadPtr \/\/ should be 1.\r\n ELSE\r\n CurrentPtr <- HeadPtr\r\n FOUND <- FALSE\r\n PreviousPtr <- Null\r\n WHILE CurrentPtr > Null AND FOUND = FALSE\r\n OUTPUT \"In While Loop\"\r\n OUTPUT \"CurrentPtr\",CurrentPtr,\"FOUND:\",FOUND\r\n OUTPUT \"GetValue:\",CurrentPtr,GetValue(CurrentPtr)\r\n IF Value < GetValue(CurrentPtr) THEN\r\n OUTPUT \"INSERTING BEFORE:\", CurrentPtr\r\n \/\/insert the value into free list, adjust the pointers\r\n \/\/if PreviousPtr is null then we're at the start of the list\r\n InsertedPtr <- FreePtr\r\n FreePtr <- aData[FreePtr].NextItem\r\n IF PreviousPtr <> Null THEN\r\n OUTPUT \"Pointing Previous item to new item\"\r\n aData[PreviousPtr].NextItem <- InsertedPtr\r\n ELSE\r\n OUTPUT \"Changing Head pointer\"\r\n HeadPtr <- InsertedPtr\r\n ENDIF\r\n OUTPUT \"Setting Values\"\r\n aData[InsertedPtr].Data <- Value\r\n aData[InsertedPtr].NextItem <- CurrentPtr\r\n FOUND <- TRUE\r\n \/\/return position of insert\r\n \/\/RETURN InsertedPtr\r\n ELSE\r\n PreviousPtr <- CurrentPtr\r\n CurrentPtr <- aData[CurrentPtr].NextItem\r\n ENDIF\r\n OUTPUT \"End of while loop\"\r\n \/\/QuitIt()\r\n ENDWHILE\r\n ENDIF\r\n IF FOUND = TRUE THEN\r\n OUTPUT \"Returning inserted pointer\", InsertedPtr \r\n RETURN InsertedPtr\r\n ENDIF\r\n \/\/add to end of list. FOUND should be FALSE here.\r\n \/\/TailPtr shouldequal PreviousPtr\r\n OUTPUT \"Found = False\",\" CurrentPtr:\",CurrentPtr,\" PreviousPtr:\",PreviousPtr\r\n IF FOUND = FALSE THEN\r\n InsertedPtr <- FreePtr\r\n FreePtr <- aData[FreePtr].NextItem\r\n aData[InsertedPtr].Data <- Value\r\n aData[InsertedPtr].NextItem <- Null \/\/ new tail\r\n aData[TailPtr].NextItem <- InsertedPtr \/\/change current tail\r\n TailPtr <- InsertedPtr\r\n \r\n RETURN InsertedPtr \/\/ or TailPtr\r\n ENDIF\r\nENDFUNCTION\r\n \r\nFUNCTION POP(Value : INTEGER) RETURNS INTEGER\r\n \/\/ MORE LIKE DELETE. Searches for Value then deletes item.\r\n \/\/Returns position item was found - just for testing unnecessary really.\r\n IF HeadPtr = Null THEN\r\n RETURN Null\r\n ENDIF\r\n DECLARE PreviousPtr : INTEGER\r\n PreviousPtr <- Null\r\n CurrentPtr <- HeadPtr\r\n WHILE CurrentPtr <> Null DO\r\n IF aData[CurrentPtr].Data = Value THEN\r\n DECLARE NextItemPointer : INTEGER\r\n NextItemPointer <- aData[CurrentPtr].NextItem\r\n IF CurrentPtr = HeadPtr THEN\r\n \/\/no previous ptr\r\n HeadPtr <- aData[HeadPtr].NextItem\r\n ELSE\r\n aData[PreviousPtr].NextItem <- NextItemPointer\r\n ENDIF\r\n IF NextItemPointer = Null THEN\r\n \/\/end of list\r\n TailPtr <- PreviousPtr\r\n ENDIF\r\n \/\/make deleted item first item in freelist, make it point to current FreePointer\r\n \/\/if at start of list no previous pointer so check for it\r\n IF CurrentPtr = HeadPtr THEN\r\n HeadPtr <- aData[HeadPtr].NextItem\r\n ENDIF\r\n aData[CurrentPtr].NextItem <- FreePtr\r\n FreePtr <- CurrentPtr\r\n RETURN CurrentPtr\r\n ENDIF\r\n PreviousPtr <- CurrentPtr\r\n CurrentPtr <- aData[CurrentPtr].NextItem\r\n ENDWHILE\r\n\r\n \/\/CurrentPtr should be NULL here - item wasnt in the list\r\n RETURN CurrentPtr\r\nENDFUNCTION\r\n\r\n\r\n\r\n\r\n \r\nOUTPUT \"Starting\"\r\n\/\/Linked List Demo\r\nDECLARE FreePtr : INTEGER\r\nDECLARE HeadPtr : INTEGER\r\nDECLARE TailPtr : INTEGER\r\nDECLARE CurrentPtr : INTEGER\r\nDECLARE Null : INTEGER\r\nNull <- 0\r\n\r\n\r\n\r\n\r\n\/\/set listlength here so its easy to refer to\r\nDECLARE ListLength : INTEGER\r\nListLength <- 5\r\nDECLARE aData : ARRAY[1:5] OF Node\r\n\r\n\r\n\/\/set freelist pointers - initially all items are in the free lsit\r\nDECLARE i : INTEGER\r\nFOR i <- 1 TO ListLength - 1\r\n aData[i].Data <- 0\r\n aData[i].NextItem <- i+1\r\nNEXT i\r\n\/\/last item in free list does not point to another item so set NextItem to -1 (==Null in PSC)\r\naData[ListLength].Data <- 0\r\naData[ListLength].NextItem <- Null\r\nFreePtr <- 1\r\nHeadPtr <- Null\r\nTailPtr <- Null\r\nCurrentPtr <- Null\r\n\r\n\r\nOUTPUT \"Initialised\"\r\nCALL QuitIt()\r\nCALL DEBUGOUT()\r\nBREAKPOINT\r\n\/\/test\r\nDECLARE Index : INTEGER\r\nIndex <-PUSH(2)\r\nCALL DEBUGOUT()\r\nIndex <- PUSH(9)\r\nCALL DEBUGOUT()\r\nIndex <- PUSH(5)\r\nCALL DEBUGOUT()\r\nIndex <- PUSH(8)\r\nCALL DEBUGOUT()\r\nIndex <- PUSH(6)\r\nCALL DEBUGOUT()\r\nOUTPUT \"List In Order\"\r\n\r\n\r\nCALL TraverseListInOrder()\r\nIndex <-POP(9)\r\nOUTPUT \"List In Order after deleting 10\"\r\nCALL DEBUGOUT()\r\nCALL TraverseListInOrder()\r\n\r\n\r\n\r\n\/\/\r\n\/\/Translate the pseudocode into python.","t":"13CPC Linked List Demo"}
{}
9618