Skip to content

Instantly share code, notes, and snippets.

@ioxua
Created July 26, 2018 00:15
Show Gist options
  • Save ioxua/628a888b43a10594615895f89a81a780 to your computer and use it in GitHub Desktop.
Save ioxua/628a888b43a10594615895f89a81a780 to your computer and use it in GitHub Desktop.
(This is an example of a recursive factorial in Rockstar.)
(File extention is obviously made up.)
(I have put these wildcard variable names so you can come up...)
(...with your own creative names ;))
(I have just realized Rockstar has no multiline comments. Oops)
Factorial takes $NUM and $RES
If $NUM is smaller than $TWO
Give back $RES
$NNUM is $NUM minus $ONE
$NRES is $RES times $NUM
Put $NRES minus $ONE into $NRES
Give back Factorial taking $NNUM, $NRES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment