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 one or more .pseudo files for future use (e.g. backup/sharing/transferring to a different device)

Programs will be saved periodically (every 10 seconds) to your browser's local storage if changes are made - this means you can access your programs across multiple tabs

Note that these local saves won't persist next time you open the site if you were using it in a private window - clearing your browser's cache will also cause all your programs to be lost

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 Array Multi-Assignment

If enabled, you won't get warnings for assigning all values to an array in one statement - e.g. myArray <-- [1, 2, 3]

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πŸ§‘πŸ»β€πŸ« KeywordsπŸ“œ 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: SharpPencil\n\/\/ * Date: 2026\/05\/04\n\/\/ * Description: A sequel to my first game, 'The Bird Knight'\r\n\/\/ A text-based adventure game\n\/\/ * Categories: Games\n\n@\r\nHi! Please pay attention\r\nThis game was too large to upload as one file, so I've split it into bits. If you would like to play, please:\r\n1) Open the code editor\r\n2) Copy and paste the different bits into it\r\n3) Ensure that you have all the bits, and that they are in the right order\r\n4) Ensure this part is not copied\r\n5) Ensure that code isn't automatically translated to keywords (Please do not convert 'Random' and any numbers into keywords\/line numbers)\r\n6) If you have any difficulties, make sure you are using the O-Level syllabus\r\n7) Have fun!\r\n@\r\n\r\n\/\/ Butterfly Attacks\r\nPROCEDURE Slash()\r\n IF SlashC <= 0 THEN\r\n OUTPUT \"You hold up the handle of your broken sword, unable to do anything with it.\"\r\n ENDIF\r\n IF SlashC > 0 THEN\r\n SlashD \u2190 (20 + (Strength * 3))\r\n IF MainBoss = FALSE THEN\r\n OUTPUT \"You slash, dealing \", SlashD, \" DMG\"\r\n OppHP \u2190 (OppHP - SlashD)\r\n SlashC \u2190 (SlashC - 1)\r\n ENDIF\r\n IF Target = 1 THEN\r\n OUTPUT \"You slash at Beakonce, dealing \", SlashD, \" DMG\"\r\n BeaHP \u2190 (BeaHP - SlashD)\r\n SlashC \u2190 (SlashC - 1)\r\n ENDIF\r\n IF Target = 2 THEN \r\n OUTPUT \"You slash at Wingston, dealing \", SlashD, \" DMG\"\r\n WinHP \u2190 (WinHP - SlashD)\r\n SlashC \u2190 (SlashC - 1)\r\n ENDIF\r\n IF SlashC = 0 THEN\r\n OUTPUT \"Your sword shatters.\"\r\n ENDIF\r\n ENDIF\r\nENDPROCEDURE\r\n\r\nPROCEDURE Lance()\r\n IF LanceC <= 0 THEN\r\n OUTPUT \"You hold up your broken lance, which is effectively just a stick now. It's not very effective.\"\r\n ENDIF\r\n IF LanceC > 0 THEN\r\n LanceD \u2190 (25 + (Speed * 3))\r\n IF MainBoss = FALSE THEN\r\n OUTPUT \"You charge, dealing \", LanceD, \" DMG\"\r\n OppHP \u2190 (OppHP - LanceD)\r\n LanceC \u2190 (LanceC - 1)\r\n ENDIF\r\n IF Target = 1 THEN\r\n OUTPUT \"You charge at Beakonce, dealing \", LanceD, \" DMG\"\r\n BeaHP \u2190 (BeaHP - LanceD)\r\n LanceC \u2190 (LanceC - 1)\r\n ENDIF\r\n IF Target = 2 THEN \r\n OUTPUT \"You charge at Wingston, dealing \", LanceD, \" DMG\"\r\n WinHP \u2190 (WinHP - LanceD)\r\n LanceC \u2190 (LanceC - 1)\r\n ENDIF\r\n IF SlashC = 0 THEN\r\n OUTPUT \"Your sword shatters.\"\r\n ENDIF\r\n ENDIF\r\nENDPROCEDURE\r\n\r\nPROCEDURE Smash()\r\n IF SmashC <= 0 THEN\r\n OUTPUT \"You hold up your broken mace, which is effectively just a stick now. It's not very effective.\"\r\n ENDIF\r\n IF SmashC > 0 THEN\r\n SmashD \u2190 (40 + (Strength * 2))\r\n IF MainBoss = FALSE THEN\r\n OUTPUT \"You slash, dealing \", SmashD, \" DMG\"\r\n OppHP \u2190 (OppHP - SmashD)\r\n SmashC \u2190 (SmashC - 1)\r\n ENDIF\r\n IF Target = 1 THEN\r\n OUTPUT \"You strike your mace down on Beakonce, dealing \", SmashD, \" DMG\"\r\n BeaHP \u2190 (BeaHP - SmashD)\r\n SmashC \u2190 (SmashC - 1)\r\n ENDIF\r\n IF Target = 2 THEN \r\n OUTPUT \"You strike your mace down on Wingston, dealing \", SmashD, \" DMG\"\r\n WinHP \u2190 (WinHP - SmashD)\r\n SmashC \u2190 (SmashC - 1)\r\n ENDIF\r\n StunChance \u2190 (1 + ROUND(RANDOM() * 1, 0))\r\n IF StunChance = 1 THEN\r\n OUTPUT \"You shudder as the force exerted by the mace flows through your body, leaving you open to an attack.\"\r\n IF MainBoss = FALSE THEN\r\n CALL RandomBird\r\n ENDIF\r\n IF MainBoss = TRUE THEN\r\n OppChance \u2190 (1 + ROUND(RANDOM() * 1, 0))\r\n IF OppChance = 1 THEN\r\n IF BeaHP > 0 THEN\r\n CALL Beakonce\r\n ELSE\r\n CALL Wingston\r\n ENDIF\r\n ENDIF\r\n IF OppChance = 2 THEN\r\n IF WinHP > 0 THEN\r\n CALL Wingston\r\n ELSE\r\n CALL Beakonce\r\n ENDIF\r\n ENDIF\r\n ENDIF\r\n ENDIF\r\n IF SmashC = 0 THEN\r\n OUTPUT \"Your mace crumbles.\"\r\n ENDIF\r\n ENDIF\r\nENDPROCEDURE\r\n\r\nPROCEDURE PollenBeam()\r\n IF Mana < 10 THEN\r\n OUTPUT \"You focus your limited mana on your antennas, and a few sparks escape but it's not very useful.\"\r\n ENDIF\r\n IF Mana >= 10 THEN\r\n PollenBeamD \u2190 (50 + ROUND(RANDOM() * 10, 0))\r\n Mana \u2190 (Mana - 10)\r\n IF MainBoss = TRUE THEN\r\n IF Target = 1 THEN\r\n OUTPUT \"You focus your mana on your antennas, and shoot a beam at Beakonce, dealing \", PollenBeamD, \" DMG\"\r\n BeaHP \u2190 (BeaHP - PollenBeamD)\r\n ENDIF\r\n IF Target = 2 THEN \r\n OUTPUT \"You focus your mana on your antennas, and shoot a beam at Wingston, dealing \", PollenBeamD, \" DMG\"\r\n WinHP \u2190 (WinHP - PollenBeamD)\r\n ENDIF\r\n ENDIF\r\n IF MainBoss = FALSE THEN\r\n OUTPUT \"You focus your mana on your antennas dealing \", PollenBeamD ,\" DMG\"\r\n OppHP \u2190 (OppHP - PollenBeamD)\r\n ENDIF\r\n ENDIF\r\nENDPROCEDURE\r\n\r\nPROCEDURE Flap()\r\n FlapD \u2190 (10 + (Strength * 3))\r\n IF MainBoss = TRUE THEN\r\n OUTPUT \"You flap your wings rapidly, dealing \", FlapD, \" DMG to both\"\r\n BeaHP \u2190 (BeaHP - FlapD)\r\n WinHP \u2190 (WinHP - FlapD)\r\n ELSE\r\n OUTPUT \"You flap your wings rapidly, dealing \", FlapD, \" DMG\"\r\n OppHP \u2190 (OppHP - FlapD)\r\n ENDIF\r\nENDPROCEDURE\r\n\r\nPROCEDURE Cocoon()\r\n\tIF CocoonC <= 0 THEN\r\n\t OUTPUT \"You try to cocoon, but ultimately fall to ground lacking the energy.\"\r\n\tENDIF\r\n IF CocoonC > 0 THEN\r\n HP \u2190 (HP + 45)\r\n Mana \u2190 (Mana + 10)\r\n CocoonC \u2190 (CocoonC - 1)\r\n CocoonProtec \u2190 TRUE\r\n OUTPUT \"You cocoon, healing yourself for 45 HP and restoring your mana by 10!\"\r\n ENDIF\r\nENDPROCEDURE\r\n\r\nPROCEDURE AttackMenu()\r\n OUTPUT \"---------------\"\r\n IF SlashC > 0 THEN\r\n OUTPUT \"1. Slash - Swing your blade | Base 20 DMG | Remaining: \", SlashC\r\n ELSE\r\n OUTPUT \"1. Slash | Your blade has shattered.\"\r\n ENDIF\r\n OUTPUT \"2. Pollen Beam - Shoot a magical beam of pollen | Base 50 DMG | Costs 10 Mana. Remaining mana: \", Mana\r\n OUTPUT \"3. Flap - Flap your wings, propelling wind which hits all opponents | Base 10 DMG | Remaining: Infinite\"\r\n IF CocoonC > 0 THEN\r\n OUTPUT \"4. Cocoon - Heals you for 45 HP, and restores some mana. You are protected inside the cocoon | Remaining: \", CocoonC\r\n ELSE\r\n OUTPUT \"4. Cocoon | You don't have the energy to cocoon.\"\r\n ENDIF\r\n IF MaceFound = TRUE THEN\r\n IF SmashC > 0 THEN\r\n OUTPUT \"5. Smash - Smash your mace down, may stun you leaving you open to fast opponents | Base 40 DMG | Remaining: \", SmashC\r\n ELSE\r\n OUTPUT \"5. Smash | Your mace has crumbled.\"\r\n ENDIF\r\n ENDIF\r\n IF LanceFound = TRUE AND MaceFound = FALSE THEN\r\n IF LanceC > 0 THEN\r\n OUTPUT \"5. Charge - Dash at your opponents with your lance, does more damage the faster you go | Base 25 DMG | Remaining: \", LanceC\r\n ELSE\r\n OUTPUT \"5. Charge | Your lance fell apart.\"\r\n ENDIF\r\n ENDIF\r\n IF LanceFound = TRUE AND MaceFound = TRUE THEN\r\n IF LanceC > 0 THEN\r\n OUTPUT \"6. Charge | Dash at your opponents with your lance, does more damage the faster you go | Base 25 DMG | Remaining: \", LanceC\r\n ELSE\r\n OUTPUT \"6. Charge | Your lance fell apart.\"\r\n ENDIF\r\n ENDIF\r\n OUTPUT \"---------------\"\r\nENDPROCEDURE\r\n\r\n\/\/ Too complicated, so I split attack choice\r\nPROCEDURE NoExtraAttack() \/\/ This part does the core 4 attacks\r\n\tINPUT Attack\r\n\tIF Attack = 1 THEN\r\n IF MainBoss = TRUE THEN\r\n\t\t\tCALL Aim\r\n ENDIF\r\n CALL Slash()\r\n\tENDIF\r\n\tIF Attack = 2 THEN\r\n IF MainBoss = TRUE THEN\r\n\t\t\tCALL Aim\r\n ENDIF\t\t\t\r\n CALL PollenBeam()\r\n\tENDIF\r\n\tIF Attack = 3 THEN\r\n CALL Flap()\r\n\tENDIF\r\n\tIF Attack = 4 THEN\r\n\t\tCALL Cocoon()\r\n\tENDIF\r\nENDPROCEDURE\r\n\r\nPROCEDURE AttackChoice() \/\/ This part does that + the extra 2\r\n\tIF MaceFound = FALSE AND LanceFound = FALSE THEN \/\/ This does core 4\r\n REPEAT\r\n CALL NoExtraAttack()\r\n UNTIL Attack < 5 AND Attack > 0\r\n ENDIF\r\n IF MaceFound = TRUE AND LanceFound = FALSE THEN \/\/ This does mace\r\n REPEAT\r\n CALL NoExtraAttack()\r\n IF Attack = 5 THEN\r\n IF MainBoss = TRUE THEN\r\n CALL Aim\r\n ENDIF\r\n CALL Smash()\r\n ENDIF\r\n UNTIL Attack < 6 AND Attack > 0\r\n ENDIF\r\n IF LanceFound = TRUE AND MaceFound = FALSE THEN \/\/ This does lance\r\n REPEAT\r\n CALL NoExtraAttack()\r\n IF Attack = 5 THEN\r\n IF MainBoss = TRUE THEN\r\n CALL Aim\r\n ENDIF\r\n CALL Lance()\r\n ENDIF\r\n UNTIL Attack < 6 AND Attack > 0\r\n ENDIF\r\n IF LanceFound = TRUE AND MaceFound = TRUE THEN \/\/ This does both lance and mace\r\n REPEAT\r\n CALL NoExtraAttack()\r\n IF Attack = 5 THEN\r\n IF MainBoss = TRUE THEN\r\n CALL Aim\r\n ENDIF\r\n CALL Smash()\r\n ENDIF\r\n IF Attack = 6 THEN\r\n IF MainBoss = TRUE THEN\r\n CALL Aim\r\n ENDIF\r\n CALL Lance()\r\n ENDIF\r\n UNTIL Attack < 7 AND Attack > 0\r\n ENDIF\r\nENDPROCEDURE\r\n\r\n\/\/ Random\r\nSkillPoints \u2190 15\r\nPROCEDURE SkillShop()\r\n OUTPUT \"Allocate your skill points (\", SkillPoints, \" Remaining), amongst the following four skills:\"\r\n\tOUTPUT \"Strength\"\r\n\tREPEAT\r\n\t\tINPUT S\r\n\t\tIF S > SkillPoints OR S < 0 THEN\r\n\t\t\tOUTPUT \"Invalid number of skill points! Try again.\"\r\n\t\tENDIF\r\n\tUNTIL S <= SkillPoints AND S >= 0\r\n Strength \u2190 (Strength + S)\r\n\tSkillPoints \u2190 (SkillPoints - S)\r\n\r\n OUTPUT \"Speed\"\r\n\tREPEAT\r\n\t\tINPUT SP\r\n\t\tIF SP > SkillPoints OR SP < 0 THEN\r\n\t\t\tOUTPUT \"Invalid number of skill points! Try again.\"\r\n\t\tENDIF\r\n\tUNTIL SP <= SkillPoints AND SP >= 0\r\n Speed \u2190 (Speed + SP)\r\n\tSkillPoints \u2190 (SkillPoints - SP)\r\n\r\n\tOUTPUT \"Mana\"\r\n\tREPEAT\r\n\t\tINPUT M\r\n\t\tIF M > SkillPoints OR M < 0 THEN\r\n\t\t\tOUTPUT \"Invalid number of skill points! Try again.\"\r\n\t\tENDIF\r\n\tUNTIL M <= SkillPoints AND M >= 0\r\n\tSkillPoints \u2190 (SkillPoints - M)\r\n ManaC \u2190 (M * 10)\r\n Mana \u2190 (Mana + ManaC)\r\n\r\n\tOUTPUT \"Leadership\"\r\n\tREPEAT\r\n\t\tINPUT L\r\n\t\tIF L > SkillPoints OR L < 0 THEN\r\n\t\t\tOUTPUT \"Invalid number of skill points! Try again.\"\r\n\t\tENDIF\r\n\tUNTIL L <= SkillPoints AND L >= 0\r\n\tSkillPoints \u2190 (SkillPoints - L)\r\n Leadership \u2190 (Leadership + L)\r\nENDPROCEDURE\r\n\r\nPROCEDURE GameEnd()\r\n\t\tOUTPUT \"Game ended, thank you for playing! If you'd like to play again, please press stop and run again.\r\n1. Fun fact\"\r\n\tREPEAT\r\n REPEAT\r\n INPUT Choice\r\n IF Choice <> 1 THEN\r\n OUTPUT \"Invalid choice.\"\r\n ENDIF\r\n\t\tUNTIL Choice = 1\r\n Random \u2190 (1 + ROUND(RANDOM() * 2, 0))\r\n IF Random = 1 THEN\r\n OUTPUT \"Butterflies can taste with their feet.\"\r\n ENDIF\r\n IF Random = 2 THEN\r\n OUTPUT \"Crows can recognize individual human faces and hold grudges. So be careful with crows.\"\r\n ENDIF\r\n IF Random = 3 THEN\r\n OUTPUT \"Pigeons drink water by using their beaks like straws.\"\r\n ENDIF\r\n\tUNTIL Random = 999\r\nENDPROCEDURE\r\n\r\nPROCEDURE Decision()\r\n\tREPEAT\r\n\t\tINPUT Choice\r\n\t\tIF Choice <> 2 AND Choice <> 1 THEN\r\n\t\t\tOUTPUT \"Invalid Choice. Please pick an integer between 1 and 2.\"\r\n\t\tENDIF\r\n\tUNTIL Choice = 1 OR Choice = 2\r\nENDPROCEDURE","t":"The Butterfly Invasion (2)"}
{}
ALL