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.
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. |
| 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. |
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. |
| Less than | < | LESS THAN | Check whether the left value is smaller. |
| Greater or equal | >= | GREATER OR EQUAL TO | Check whether a value is at least another value. |
| Less or equal | <= | LESS OR EQUAL TO | Check whether a value is no more than another value. |
| 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. |
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. |
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 <list> ... END FOR | Run the same instructions once for every item in a group. |
Functions & Reuse
| Concept | Typical Equivalent | Pseudocode | Meaning |
|---|---|---|---|
| Function/Method | function / def / method | ACTION <name> ... END ACTION | Create a reusable set of instructions. |
| Function Call | functionName() | CALL ACTION <name> | Run a reusable action. |
| 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. |