Loading
//Tip: string's CAN'T be accessed 
Run on click
  • Live
  • Exited code editor
  • Run on click

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

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

Advent of Code 2024 day 2
  • Advent of Code 2024 day 2🗑️
  • Basic
  • Welcome Guide
  • Primitive Data Types
  • Primitive Data Types
  • Arithmetic Operators
  • Arithmetic Operators
  • Logical Operators
  • CONSTANTs
  • CONSTANTs
  • OUTPUT
  • OUTPUT
  • INPUT
  • Selection
  • IF...ELSE
  • CASE
  • Iteration
  • FOR Loops
  • FOR Loops
  • WHILE Loops
  • WHILE Loops
  • REPEAT...UNTIL Loops
  • Modules
  • FUNCTIONs
  • FUNCTIONs
  • FUNCTION - RETURNS ARRAY
  • PROCEDUREs
  • PROCEDUREs
  • BYVAL vs BYREF - Simple
  • BYVAL vs BYREF - Arrays
  • Composite Data Types
  • ARRAYs
  • ARRAYs
  • Records
  • ENUMs
  • SETs
  • Pointers
  • Files
  • OPENFILE modes
  • OPENFILE modes
  • WRITEFILE
  • WRITEFILE
  • READFILE
  • READFILE
  • EOF
  • EOF
  • APPEND
  • RANDOM Files
  • String Functions
  • LEFT
  • RIGHT
  • MID
  • SUBSTRING
  • LENGTH
  • LENGTH
  • LCASE
  • LCASE
  • UCASE
  • UCASE
  • TO_UPPER
  • TO_LOWER
  • NUM_TO_STR
  • STR_TO_NUM
  • IS_NUM
  • ASC
  • CHR
  • Numeric Functions
  • INT
  • RAND
  • RANDOM
  • ROUND
  • Date Functions
  • NOW
  • TODAY
  • SETDATE
  • DAY
  • MONTH
  • YEAR
  • DAYINDEX
  • Recursion
  • Factorial
  • Object-Oriented Programming
  • Constructors
  • PUBLIC & PRIVATE
  • Inheritence & Polymorphism
  • OOP - School Example
  • OOP - Shape Example
  • Extra Modules
  • WAIT
  • TIME
  • CLEAR
  • Debug & Tracing
  • BREAKPOINTs
  • BREAKPOINTs
  • TRACE_NEXT_ROW
  • Exception Handling
  • TRY...CATCH
  • IG/O-Level Common
  • Min/Max/Sum/Average
  • Linear Search
  • Bubble Sort
  • 2D Bubble Sort
  • Demo Programs
  • Linear Search
  • Bubble Sort
  • Conway's Game of Life
  • Conway's Game of Life
  • Rock, Paper, Scissors
  • Rock, Paper, Scissors
  • Quiz
  • Prime Numbers
  • Prime Numbers
  • Traffic Lights
  • Digital Clock
  • Extended - Events
  • KEYDOWN & KEYUP
  • KEYDOWN
  • KEYDOWN
  • CLICK
  • MOUSEMOVE
  • MOUSEMOVE
  • Extended - Canvas
  • DRAWLINE
  • DRAWCIRCLE
  • DRAWRECT
  • ADDPOINT & DRAWPOLYGON
  • DRAWTEXT
  • DRAWPIXELS
  • GETPIXELS
  • GETCANVASBOUNDS
  • SAVECANVAS
  • CLEARCANVAS
  • Extended - Sound
  • PLAYSOUND & STOPSOUND
  • SETFREQUENCY
  • Piano
  • Extended - HTML
  • ADDHTML

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!

Loading

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 ✅
Glass
  • Dark
  • Glass
  • Light

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

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 p33) O-Level Syllabus (Pseudocode p33) A-Level Pseudocode Guide A-Level Pseudocode Functions Report Bugs
YouTube Tutorials Discord Help AssemblyCode
All Syllabuses & Extra Modules
  • All Syllabuses & Extra Modules
  • Cambridge IGCSE 0478/O-Level 2210
  • Cambridge A-Level 9618
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
  • 🌟 Code-suggestions/auto-complete
  • 🌈 Syntax Highlighting
  • 🚩 Error messages & positions
  • 💾 Loading/saving/sharing/uploading programs
  • 🥇 Interesting practice activities of various difficulties (updated daily and will have 500+ total)
  • 📆 Monthly challenges
  • 📖 Past paper PDFs & bundles
  • ✨ Pretty-printing
  • ⌨️ Keyboard shortcuts
  • 🎨 Changing appearance - font size, theme, layout etc
  • 📺 Fullscreen & 📱 mobile support
  • 🎓 Syllabus-specific behaviour
  • ☕ Pseudocode to Java converter

117 demo programs from 21 categories combined across all syllabuses are provided below for all of the pseudocode features. Changing syllabus will update the listed demo programs accordingly. You can click on them to load them into the editor, or simply use the select box, arrow buttons or CTRL + SHIFT + LEFT/RIGHT arrow keyboard shortcut to change program

Demo Program Colours: IGCSE 0478 / O-Level 2210 or A-Level 9618

Basic

Welcome Guide

Primitive Data Types

Primitive Data Types

Arithmetic Operators

Arithmetic Operators

Logical Operators

CONSTANTs

CONSTANTs

OUTPUT

OUTPUT

INPUT

Selection

IF...ELSE

CASE

Iteration

FOR Loops

FOR Loops

WHILE Loops

WHILE Loops

REPEAT...UNTIL Loops

Modules

FUNCTIONs

FUNCTIONs

FUNCTION - RETURNS ARRAY

PROCEDUREs

PROCEDUREs

BYVAL vs BYREF - Simple

BYVAL vs BYREF - Arrays

Composite Data Types

ARRAYs

ARRAYs

Records

ENUMs

SETs

Pointers

Files

OPENFILE modes

OPENFILE modes

WRITEFILE

WRITEFILE

READFILE

READFILE

EOF

EOF

APPEND

RANDOM Files

String Functions

LEFT

RIGHT

MID

SUBSTRING

LENGTH

LENGTH

LCASE

LCASE

UCASE

UCASE

TO_UPPER

TO_LOWER

NUM_TO_STR

STR_TO_NUM

IS_NUM

ASC

CHR

Numeric Functions

INT

RAND

RANDOM

ROUND

Date Functions

NOW

TODAY

SETDATE

DAY

MONTH

YEAR

DAYINDEX

Recursion

Factorial

Object-Oriented Programming

Constructors

PUBLIC & PRIVATE

Inheritence & Polymorphism

OOP - School Example

OOP - Shape Example

Extra Modules

WAIT

TIME

CLEAR

Debug & Tracing

BREAKPOINTs

BREAKPOINTs

TRACE_NEXT_ROW

Exception Handling

TRY...CATCH

IG/O-Level Common

Min/Max/Sum/Average

Linear Search

Bubble Sort

2D Bubble Sort

Demo Programs

Linear Search

Bubble Sort

Conway's Game of Life

Conway's Game of Life

Rock, Paper, Scissors

Rock, Paper, Scissors

Quiz

Prime Numbers

Prime Numbers

Traffic Lights

Digital Clock

Extended - Events

KEYDOWN & KEYUP

KEYDOWN

KEYDOWN

CLICK

MOUSEMOVE

MOUSEMOVE

Extended - Canvas

DRAWLINE

DRAWCIRCLE

DRAWRECT

ADDPOINT & DRAWPOLYGON

DRAWTEXT

DRAWPIXELS

GETPIXELS

GETCANVASBOUNDS

SAVECANVAS

CLEARCANVAS

Extended - Sound

PLAYSOUND & STOPSOUND

SETFREQUENCY

Piano

Extended - HTML

ADDHTML

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: doublerone\n\/\/ * Date: 2024\/12\/02\n\/\/ * Description: \n\/\/ * Categories: \n\n\/\/ * Code Author: PseudocodePro\r\n\/\/ * Date: 2024\/12\/02\r\n\/\/ * Description: \r\n\/\/ * Categories: \r\n\r\n\/\/written by doublerone the great\r\n\r\n\/\/declaring -_-\r\nDECLARE List1: ARRAY[1:6 1:5] OF INTEGER\r\nDECLARE isSafe_list: ARRAY[1:6] OF STRING\r\nDECLARE comparison: INTEGER\r\nDECLARE isSafe: BOOLEAN\r\nList1 <-- [[7, 6, 4, 2, 1],[1, 2, 7, 8, 9],[9, 7, 6, 2, 1],[1, 3, 2, 4, 5],[8, 6, 4, 4, 1],[1, 3, 6, 7, 9]]\r\n\r\n\/\/finding whether the arrays provided are safe or not\r\nisSafe <-- TRUE\r\n\r\nFOR a <-- 1 TO LENGTH(List1)\r\n FOR b <-- 1 TO (LENGTH(List1[a])-1)\r\n comparison <-- List1[a,b+1]\r\n IF comparison-List1[a,b] = -1 OR comparison-List1[a,b] = -2 OR comparison-List1[a,b] = 1 OR comparison-List1[a,b] = 2 THEN\r\n \/\/?? hi\r\n ELSE\r\n isSafe <-- FALSE\r\n isSafe_list[a] <-- \"Unsafe\"\r\n ENDIF\r\n NEXT b\r\n IF isSafe THEN\r\n isSafe_list[a] <-- \"Safe\"\r\n ENDIF\r\n isSafe <-- TRUE\r\nNEXT a\r\n\r\n\/\/output\r\nFOR c <-- 1 TO LENGTH(isSafe_list)\r\n OUTPUT isSafe_list[c]\r\nNEXT c","t":"Advent of Code 2024 day 2"}
9618

🎉 Welcome to Pseudocode.pro

Important: Oct/Nov 2024 exam papers, monthly challenges, past papers, Discord help group, pointers, extra modules (sound, canvas, events, HTML etc), removing ads & downloading the site as a desktop & mobile app now available. Will make loading extremely fast and will work offline too. Trace tables now implemented as a beta feature. Directly assigning arrays like a <-- [1,2,3], sets and try...catch exceptions are now possible too. New features & improvements will be added weekly. Please let me know if you have any questions, find any bugs or have any feature suggestions. You may also be interested in a similar site to allow you to execute Cambridge assembly asmcode.pro