\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Zoltan} \pdfinfo{ /Title (pico-8-v2.pdf) /Creator (Cheatography) /Author (Zoltan) /Subject (Pico-8 V2 Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{0BA2E3} \definecolor{LightBackground}{HTML}{EFF9FD} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Pico-8 V2 Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Zoltan} via \textcolor{DarkBackground}{\uline{cheatography.com/35548/cs/18960/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Zoltan \\ \uline{cheatography.com/zoltan} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 26th February, 2019.\\ Updated 26th February, 2019.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{tabularx}{17.67cm}{x{5.7358 cm} x{9.4472 cm} p{1.687 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Commandline Parameters}} \tn % Row 0 \SetRowColor{LightBackground} width n & Set the window width & \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} height n & Set the window height & \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} windowed n & Set windowed mode off (0) or on (1) & \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} sound n & Sound volume 0..256 & \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} music n & Music volume 0..256 & \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} joystick n & Joystick controls starts at player n (0..7) & \tn % Row Count 8 (+ 2) % Row 6 \SetRowColor{LightBackground} \seqsplit{pixel\_perfect} n & 1 for unfiltered screen stretching at integer scales (on by default) & \tn % Row Count 12 (+ 4) % Row 7 \SetRowColor{white} draw\_rect x,y,w,h & Absolute window coordinates and size to draw pico-8's screen & \tn % Row Count 15 (+ 3) % Row 8 \SetRowColor{LightBackground} run filename & Load and run a cartridge & \tn % Row Count 17 (+ 2) % Row 9 \SetRowColor{white} x filename & Execute a pico-8 cart headless and then quit & \tn % Row Count 19 (+ 2) % Row 10 \SetRowColor{LightBackground} p param\_str & Pass a parameter string to the specified cartridge & \tn % Row Count 22 (+ 3) % Row 11 \SetRowColor{white} splore & Boot in splore mode & \tn % Row Count 23 (+ 1) % Row 12 \SetRowColor{LightBackground} home path & Set the path to store config.txt and other user data files & \tn % Row Count 26 (+ 3) % Row 13 \SetRowColor{white} desktop path & Set a location for screenshots and gifs to be saved & \tn % Row Count 29 (+ 3) % Row 14 \SetRowColor{LightBackground} \seqsplit{screenshot\_scale} n & Scale of screenshots. default: 3 (368x368 pixels) & \tn % Row Count 32 (+ 3) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.7358 cm} x{9.4472 cm} p{1.687 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Commandline Parameters (cont)}} \tn % Row 15 \SetRowColor{LightBackground} gif\_scale n & Scale of gif captures. default: 2 (256x256 pixels) & \tn % Row Count 3 (+ 3) % Row 16 \SetRowColor{white} gif\_len n & Set the maximum gif length in seconds (1..120) & \tn % Row Count 6 (+ 3) % Row 17 \SetRowColor{LightBackground} gui\_theme n & Use 1 for a higher contrast editor colour scheme & \tn % Row Count 9 (+ 3) % Row 18 \SetRowColor{white} timeout n & How many seconds to wait before downloads timeout (default: 30) & \tn % Row Count 12 (+ 3) % Row 19 \SetRowColor{LightBackground} \seqsplit{software\_blit} n & Use software blitting mode off (0) or on (1) & \tn % Row Count 14 (+ 2) % Row 20 \SetRowColor{white} \seqsplit{foreground\_sleep\_ms} n & How many milliseconds to sleep between frames & \tn % Row Count 17 (+ 3) % Row 21 \SetRowColor{LightBackground} \seqsplit{background\_sleep\_ms} n & How many milliseconds to sleep between frames when running in background & \tn % Row Count 21 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{17.67cm}}{these override settings found in config.txt} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{p{1.727 cm} x{15.543 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Screenshots, Videos and Cartridge Labels}} \tn % Row 0 \SetRowColor{LightBackground} F6 & Save a screenshot to desktop \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} F7 & Capture cartridge label image \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} F8 & Start recording a video \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} F9 & Save GIF video to desktop (max: 8 seconds by default) \tn % Row Count 5 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{-if F6..F9 are not available on your system, use CTRL-6..9 \newline -You can save a video at any time (it is always recording). Use F8 just to reset \newline the video starting point if you want something less than 8 seconds long} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.7358 cm} x{5.5671 cm} x{5.5671 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Graphics}} \tn % Row 0 \SetRowColor{LightBackground} clip {[}x y w h{]} & Sets the screen's clipping region in pixels clip() to reset & \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} pget x y & Get the colour (c) of a pixel at x, y & \tn % Row Count 8 (+ 3) % Row 2 \SetRowColor{LightBackground} pset x y {[}c{]} & Set the colour (c) of a pixel at x, y & \tn % Row Count 11 (+ 3) % Row 3 \SetRowColor{white} sget x y & Get the colour (c) of a spritesheet pixel & \tn % Row Count 15 (+ 4) % Row 4 \SetRowColor{LightBackground} sset x y {[}c{]} & Set the colour (c) of a spritesheet pixel & \tn % Row Count 19 (+ 4) % Row 5 \SetRowColor{white} fget n {[}f{]} & Get the value (v) of a sprite's flag & \tn % Row Count 22 (+ 3) % Row 6 \SetRowColor{LightBackground} fset n {[}f{]} v & Set the value (v) of a sprite's flag & \tn % Row Count 25 (+ 3) % Row 7 \SetRowColor{white} print( str, {[}x,{]} {[}y,{]} {[}c{]} ) & Prints a string of characters to the screen & \tn % Row Count 29 (+ 4) % Row 8 \SetRowColor{LightBackground} cursor x y & Set the cursor position and carriage return margin & \tn % Row Count 33 (+ 4) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.7358 cm} x{5.5671 cm} x{5.5671 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Graphics (cont)}} \tn % Row 9 \SetRowColor{LightBackground} color c & Set the default color to be used by drawing functions & \tn % Row Count 5 (+ 5) % Row 10 \SetRowColor{white} cls {[}c{]} & Clear the screen and reset the clipping rectangle & c is the background color. The default is 0 (black). \tn % Row Count 9 (+ 4) % Row 11 \SetRowColor{LightBackground} camera {[}x y{]} & Set a screen offset of -x, -y for all drawing operations & camera() to reset \tn % Row Count 14 (+ 5) % Row 12 \SetRowColor{white} circ x y r {[}c{]} & Draw a circle at x,y with radius r & \tn % Row Count 17 (+ 3) % Row 13 \SetRowColor{LightBackground} circfill x y r {[}col{]} & Draw a filled circle at x,y with radius r & \tn % Row Count 21 (+ 4) % Row 14 \SetRowColor{white} line x0 y0 x1 y1 {[}c{]} & Draw a line & \tn % Row Count 23 (+ 2) % Row 15 \SetRowColor{LightBackground} rect x0 y0 x1 y1 {[}c{]} & Draw a rectangle & \tn % Row Count 25 (+ 2) % Row 16 \SetRowColor{white} rectfill x0 y0 x1 y1 {[}c{]} & Draw a filled rectangle & \tn % Row Count 27 (+ 2) % Row 17 \SetRowColor{LightBackground} pal c0 c1 {[}p{]} (1) & Draw all instances of colour c0 as c1 in subsequent draw calls & pal() to reset to system defaults \tn % Row Count 32 (+ 5) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.7358 cm} x{5.5671 cm} x{5.5671 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Graphics (cont)}} \tn % Row 18 \SetRowColor{LightBackground} palt c t & Set transparency for colour index to t (boolean) & Transparency is observed by spr(), sspr() and map() \tn % Row Count 4 (+ 4) % Row 19 \SetRowColor{white} spr n x y {[}w h{]} {[}flip\_x{]} {[}flip\_y{]} & Draw sprite n at position x,y,width and height are 1,1 by default & \tn % Row Count 9 (+ 5) % Row 20 \SetRowColor{LightBackground} sspr sx sy sw sh dx dy {[}dw dh{]} {[}flip\_x{]} {[}flip\_y{]} & Draws a rectangle of pixels from the sprite sheet, optionally stretching the image to fit a rectangle on the screen & \tn % Row Count 18 (+ 9) % Row 21 \SetRowColor{white} fillp p & Sets the fill pattern, observed by: circ() circfill() rect() rectfill() pset() line() & \tn % Row Count 25 (+ 7) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{17.67cm}}{params in {[}{]} are optional \newline f is the flag index 0..7 \newline v is boolean and can be true or false \newline c is color \newline (1) Two types of palette (p defaults to 0) \newline 0 draw palette, colours are remapped on draw //e.g to re-colour sprites \newline 1 screen palette, colours are remapped on display //e.g for fades} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{2.1931 cm} x{8.2663 cm} x{6.4106 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Tables}} \tn % Row 0 \SetRowColor{LightBackground} add t v & Add value v to the end of table t & \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} del t v & Delete the first instance of value v in table t & \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} all t & Used in FOR loops to iterate over all items in a table & FOR V IN ALL(T) DO PRINT(V) END \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} \seqsplit{foreach} t f & For each item in table t, call function f with the item as a single parameter & FOREACH(T, PRINT) \tn % Row Count 13 (+ 5) % Row 4 \SetRowColor{LightBackground} pairs t & Used in FOR loops to iterate over table t, providing both the key and value for each item & \tn % Row Count 18 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{3.8801 cm} x{11.3029 cm} p{1.687 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Input}} \tn % Row 0 \SetRowColor{LightBackground} btn {[}i {[}p{]}{]} & Tests if a button is being pressed at this moment & \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} btnp {[}i {[}p{]}{]} & Tests if a button has just been pressed, with keyboard-style repeating & \tn % Row Count 5 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{17.67cm}}{i is the button number \newline p is the player number} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.1169 cm} x{9.1531 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Audio}} \tn % Row 0 \SetRowColor{LightBackground} sfx n {[}channel {[}offset {[}length{]}{]}{]} & Plays a sound effect n \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} music {[}n {[}fade\_len {[}channel\_mask{]}{]}{]} & Plays a music pattern, or stops playing \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{6.748 cm} x{8.435 cm} p{1.687 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Map}} \tn % Row 0 \SetRowColor{LightBackground} mget x y & Gets the sprite number assigned to a cell on the map & \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} mset x y v & Sets a cell on the map to a new sprite number & \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} map cel\_x cel\_y sx sy cel\_w cel\_h {[}layer{]} & Draw a section of the map (in cels) at screen position sx, sy (in pixels) & \tn % Row Count 10 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{3.7114 cm} x{11.4716 cm} p{1.687 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Math}} \tn % Row 0 \SetRowColor{LightBackground} max x y & Returns the maximum of two numbers & \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} min x y & Returns the minimum of two numbers & \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} mid x y z & Returns the middle of three numbers & \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} flr x & Returns the integer portion (the "floor") of a number & \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} ceil x & Returns the next highest integer (the "ceiling") of a number & \tn % Row Count 11 (+ 3) % Row 5 \SetRowColor{white} cos x & Calculates the cosine of an angle & \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} sin x & Calculates the sine of an angle & \tn % Row Count 15 (+ 2) % Row 7 \SetRowColor{white} atan2 dx dy & Converts dx, dy into an angle from 0..1 & \tn % Row Count 17 (+ 2) % Row 8 \SetRowColor{LightBackground} sqrt x & Calculates the square root of a number & \tn % Row Count 19 (+ 2) % Row 9 \SetRowColor{white} abs x & Returns the absolute value of a number & \tn % Row Count 21 (+ 2) % Row 10 \SetRowColor{LightBackground} rnd x & Generates a random number between 0 and the given maximum & \tn % Row Count 24 (+ 3) % Row 11 \SetRowColor{white} srand x & Initializes the random number generator with an explicit seed value & \tn % Row Count 27 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{17.67cm}}{Angle x measured clockwise and is between 0.0 .. 1.0} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{7.2541 cm} p{1.687 cm} x{7.9289 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Strings}} \tn % Row 0 \SetRowColor{LightBackground} length & & print(\#s) -{}-\textgreater{} 19 \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} joining strings & & print("three "..4) -{}-\textgreater{} "three 4" \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} sub() to grab substrings & & print(sub(s,5,9)) -{}-\textgreater{} "quick" \tn % Row Count 5 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{17.67cm}}{s = "the quick brown fox"} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{2.6992 cm} x{7.4228 cm} x{6.748 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Types}} \tn % Row 0 \SetRowColor{LightBackground} type val & Returns the basic type of a given value as a string & print(type(1)) -{}- "number" \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} tostr val {[}hex{]} & Converts a non-string value to a string representation & s = 'v: '..tostr(12345) -{}- 'v: 12345' \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} tonum val & Converts a string representation of a decimal, hexadecimal, or binary number to a number value & \tn % Row Count 13 (+ 6) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{17.67cm}}{hex - if hex is true and val is a number, an unsigned hexadecimal writing of the number is returned in the format "0x0000.0000"} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{1.687 cm} x{8.2663 cm} x{6.9167 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Binary Operations}} \tn % Row 0 \SetRowColor{LightBackground} band x y & Calculates the bitwise AND of two numbers & print(band(0x7, 0xd)) -{}- 5 \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} bor x y & Calculates the bitwise OR of two numbers & print(bor(0x5, 0x9)) -{}- 13 (0xd) \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} bxor x y & Calculates the bitwise XOR of two numbers & print(bxor(0x5, 0x9)) -{}- 12 (0xc) \tn % Row Count 9 (+ 3) % Row 3 \SetRowColor{white} bnot x & Calculates the bitwise NOT of a number & \seqsplit{print(bnot(0xb))} -{}- -11 (0 - 0xb) \tn % Row Count 12 (+ 3) % Row 4 \SetRowColor{LightBackground} rotl x y & Rotates the bits of a number to the left & print(rotl(8, 3)) -{}- 64 \tn % Row Count 15 (+ 3) % Row 5 \SetRowColor{white} rotr x y & Rotates the bits of a number to the right & print(rotr(64, 3)) -{}- 8 \tn % Row Count 18 (+ 3) % Row 6 \SetRowColor{LightBackground} shl x n & Shifts the bits of a number to the left & print(shl(1, 3)) -{}- 8 \tn % Row Count 21 (+ 3) % Row 7 \SetRowColor{white} shr x n & Shifts the bits of a number to the right & print(shr(8, 3)) -{}- 1 \tn % Row Count 24 (+ 3) % Row 8 \SetRowColor{LightBackground} lshr x n & Shifts the bits of a number to the right, using logical shift & print(lshr(8, 3)) -{}- 1 \tn % Row Count 28 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{4.8923 cm} x{5.9045 cm} x{6.0732 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Coroutines}} \tn % Row 0 \SetRowColor{LightBackground} cocreate f & Create a coroutine for function f & \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} coresume c {[}p0 p1 ..{]} & Run or continue the coroutine c. Parameters p0, p1.. are passed to the coroutine's function & Returns true if the coroutine completes without any errors \tn % Row Count 10 (+ 7) % Row 2 \SetRowColor{LightBackground} costatus c & Return the status of coroutine c as a string & "running", "suspended", "dead" \tn % Row Count 14 (+ 4) % Row 3 \SetRowColor{white} yield & Suspend execution and return to the caller & \tn % Row Count 17 (+ 3) % Row 4 \SetRowColor{LightBackground} assert( cond, {[}message{]} ) & Causes a runtime error if a conditional expression is false & \tn % Row Count 22 (+ 5) % Row 5 \SetRowColor{white} stop( {[}message,{]} {[}x,{]} {[}y,{]} {[}c{]} ) & Stops the program's execution and returns to the command prompt & \tn % Row Count 27 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \end{document}