Skip to content

Instantly share code, notes, and snippets.

@Ratstail91
Created April 15, 2020 11:45
Show Gist options
  • Save Ratstail91/c446785449793b0256060aadd8eb489f to your computer and use it in GitHub Desktop.
Save Ratstail91/c446785449793b0256060aadd8eb489f to your computer and use it in GitHub Desktop.
The officially official definition of pseudocode.

Pseudocode

Single-line comments begin with // and end at the end of the line.

To output something to the screen, you can use the keyword output, followed by the value to be outputted.

variables are defined using the var keyword - there are no constants.

All standard libraries are assumed to have already been invoked, however if you need to explicitly signal that a library is needed, you can do it thusly:

import "library_name"
import "file_name.lang"

Conditionals are defined like this:

if (expression):
	//do stuff
elif (expression):
	//do stuff
else:
	//do stuff

Loops are defined like these:

while (expression):
	//do stuff

do:
	//do stuff
while (expression)

for (var i = 0; i < 10; i++):
	//do stuff

foreach (var element in array):
	//do stuff

foreach (var index in array):
	//do stuff

Functions are defined and invoked like this:

function f(params):
	//do stuff
	return params

var g = f(args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment