Reference
Pseudocode Standard
Use consistent, English-like instructions to think through programming logic before translating it into a language. This web reference follows the codeBetter pseudocode cheat sheet.
Pseudocode keywords are always written in capital letters — if is read as a name, not the keyword; write IF instead.
Variables & Data
| Concept | Typical Equivalent | Pseudocode | Meaning |
|---|---|---|---|
| Assignment | variable = value | CREATE <variable> AS <value> | Create a named place to remember a value. |
| Reassignment | variable = newValue | CHANGE <variable> TO <value> | Replace the value already stored in a variable. |
| Boolean | bool / boolean | SWITCH | A value with two states, such as true/false or on/off. |
| Boolean value | true / false | TRUE / FALSE | The two values a SWITCH can hold. |
| Array/List | array / list | CREATE <list name> AS LIST WITH <values> | Store several values together in an ordered group. |
| Dictionary/Map | dictionary / map / object | CREATE <map name> AS MAP WITH <keys: values> | Store values by named keys. |
| Index Access | list[index] | ITEM <index> OF <list> | Get a single value from a list by its position. Positions start at 0. |
| Add to List | list.append(value) / list.push(value) | ADD <value> TO <list> | Add a new value to the end of a list. |
Operators & Comparisons
| Concept | Typical Equivalent | Pseudocode | Meaning |
|---|---|---|---|
| Equal | == | IS | Check whether two values are equal. |
| Not equal | != | IS NOT | Check whether two values are different. |
| Strictly equal | === | IS EXACTLY | Check equality without loose type conversion. |
| Strictly not equal | !== | IS NOT EXACTLY | Check strict inequality. |
| Greater than | > | GREATER THAN | Check whether the left value is larger. Works on numbers and, alphabetically, on text. |
| Less than | < | LESS THAN | Check whether the left value is smaller. Works on numbers and, alphabetically, on text. |
| Greater or equal | >= | GREATER OR EQUAL TO | Check whether a value is at least another value. Works on numbers and, alphabetically, on text. |
| Less or equal | <= | LESS OR EQUAL TO | Check whether a value is no more than another value. Works on numbers and, alphabetically, on text. |
| Modulus | % | MODULUS | Return the remainder after division. |
| Power | ** | TO THE POWER OF | Raise a number to a power. |
| Increment | ++ | ADD ONE TO <variable> | Increase a number by one. |
| Decrement | -- | SUBTRACT ONE FROM <variable> | Decrease a number by one. |
| And | && / and | AND | True only when both sides are true. |
| Or | || / or | OR | True when either side is true. |
| Not | ! / not | NOT | Flips true to false, and false to true. |
| Grouping | ( ) | ( <expression> ) | Work this part out first, before the operators around it. |
Utilities
| Concept | Typical Equivalent | Pseudocode | Meaning |
|---|---|---|---|
| Output | print / console.log / WriteLine | SHOW <message> | Display information to the user. |
| Input | input / read | ASK <question> SAVE IN <variable> | Ask the user for information and remember the answer. |
| Comment | // / # / /* */ | EXPLANATION <text> | Leave a note for humans that the program does not execute. |
| Length | len(x) / x.length / x.Count | LENGTH OF <list or text> | Count how many items a list holds, or how many characters a piece of text contains. |
Program Structure & Flow
| Concept | Typical Equivalent | Pseudocode | Meaning |
|---|---|---|---|
| Sequence | main() | SEQUENCE <name> | A set of instructions for the computer to run in order. |
Conditions & Branching
| Concept | Typical Equivalent | Pseudocode | Meaning |
|---|---|---|---|
| If | if | IF <condition> THEN ... END IF | Run instructions only when a condition is true. |
| Else If | else if / elif | OR IF <condition> THEN | Try another condition when the earlier one was false. |
| Else | else | OTHERWISE ... | Run fallback instructions when no earlier condition matched. |
Loops & Repetition
| Concept | Typical Equivalent | Pseudocode | Meaning |
|---|---|---|---|
| Repeat Until | do/while style loop | REPEAT UNTIL <condition> ... END REPEAT | Keep repeating until a stopping condition becomes true. |
| Repeat While | while | REPEAT WHILE <condition> ... END REPEAT | Keep repeating while a condition stays true. |
| For Each | for each / for ... in | FOR EACH <item> IN <group> ... END FOR | Run the same instructions once for every item in a group. A list gives items, text gives characters, and a map gives its keys. |
Functions & Reuse
| Concept | Typical Equivalent | Pseudocode | Meaning |
|---|---|---|---|
| Function/Method | function / def / method | ACTION <name> WITH <first>, <second> ... END ACTION | Create a reusable set of instructions, optionally taking values in. |
| Function Call | functionName() | CALL ACTION <name> WITH <value>, <value> | Run a reusable action, optionally passing values in. Can be used anywhere a value is expected, such as CREATE <variable> AS CALL ACTION <name>. |
| Return | return | SEND <value> BACK | Give a result back to the code that called the action. |
Objects & Blueprints
| Concept | Typical Equivalent | Pseudocode | Meaning |
|---|---|---|---|
| Class | class | BLUEPRINT <name> ... END BLUEPRINT | Define a reusable blueprint for objects with shared data and behavior. |
| Object | new / instance | CREATE <blueprint> AS <object> | Create a real object from a blueprint. |
| Inheritance | class Dog extends Animal / class Dog : Animal | BLUEPRINT <name> EXTENDS <parent> ... END BLUEPRINT | Create a new blueprint that reuses everything an existing blueprint defines, then adds or overrides its own behavior. |
| Encapsulation | private | PRIVATE CREATE <variable> AS <value> | Keep a piece of data hidden inside a blueprint so only that blueprint's own actions can change it directly. |
Text & Strings
| Concept | Typical Equivalent | Pseudocode | Meaning |
|---|---|---|---|
| Join Text | + / f-string / template literal | JOIN <text> AND <text> | Combine two or more pieces of text into one. |
Errors & Problem Handling
| Concept | Typical Equivalent | Pseudocode | Meaning |
|---|---|---|---|
| Attempt/Catch | try / except / catch | ATTEMPT ... IF PROBLEM OCCURS THEN ... END ATTEMPT | Run instructions that might fail, and handle it gracefully instead of crashing if they do. |
| Raise a Problem | throw / raise | THROW PROBLEM <message> | Deliberately signal that something has gone wrong, along with a message describing it. |
| Problem Details | e.message / err.Message / exception.what() | PROBLEM DETAILS | Read the message describing what went wrong inside a matching IF PROBLEM OCCURS block. |