Pseudocode
Pseudocode is a generic way of depicting algorithms without use of any specific programming language-related notations.
Computer science text books often use pseudocode in their examples so that all programmers can understand them, even if they do not all know the same programming languages.
Various styles of pseudocode are in use.
Often pseudocode uses the syntax of one common language (like C or Lisp) for common operations like loops, and uses English language text whenever details are unimportant or distracting.
Our style of pseudocode uses keywords from C for the some common operations, and, like Python, uses indentation to distinguish the scope of things like loops.
Assignment:
Conditionals:
Simple loops:
Function calls:
Function declarations:
Variable declarations:
Array declarations:
Composite data structures (also see Object Oriented Programming):
Accessing fields of a composite structure:
This standard still needs work.
Example operations
<variable> = <expression>
if <condition>
do stuff
else
do other stuff
while <condition>
do stuff
for <variable> from <first value> to <last value> by <step>
do stuff with variable
<function>(<arguments>)
function <function name>(<arguments>)
do stuff with arguments
return something (optional)
declare <variable-name> as <type>
declare <array-name>[<lower-bound> to <upper-bound>] of <type>
struct <name_of_new_type>
<declaration(s) of internal variables>
<structure variable name>.<field name>