Add CT3536 Games Programming
This commit is contained in:
@ -0,0 +1,49 @@
|
||||
\begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}]
|
||||
\PYG{k}{using}\PYG{+w}{ }\PYG{n+nn}{System.Collections}\PYG{p}{;}
|
||||
\PYG{k}{using}\PYG{+w}{ }\PYG{n+nn}{System.Collections.Generic}\PYG{p}{;}
|
||||
\PYG{k}{using}\PYG{+w}{ }\PYG{n+nn}{UnityEngine}\PYG{p}{;}
|
||||
|
||||
\PYG{k}{public}\PYG{+w}{ }\PYG{k}{class}\PYG{+w}{ }\PYG{n+nc}{GameManager}\PYG{+w}{ }\PYG{p}{:}\PYG{+w}{ }\PYG{n}{MonoBehaviour}
|
||||
\PYG{p}{\PYGZob{}}
|
||||
\PYG{+w}{ }\PYG{k}{public}\PYG{+w}{ }\PYG{k+kt}{int}\PYG{+w}{ }\PYG{n}{currentGameLevel}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m}{1}\PYG{p}{;}
|
||||
\PYG{+w}{ }\PYG{k}{public}\PYG{+w}{ }\PYG{n}{GameObject}\PYG{+w}{ }\PYG{n}{asteroid}\PYG{p}{;}
|
||||
|
||||
\PYG{+w}{ }\PYG{c+c1}{// Start is called before the first frame update}
|
||||
\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{Start}\PYG{p}{()}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZob{}}
|
||||
\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{l+m}{0}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{30}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{0}\PYG{p}{);}
|
||||
\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{LookAt}\PYG{p}{(}\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{l+m}{0f}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{0f}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{0f}\PYG{p}{),}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{l+m}{0f}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{0f}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{1f}\PYG{p}{));}
|
||||
|
||||
\PYG{+w}{ }\PYG{n}{StartNextLevel}\PYG{p}{();}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
|
||||
|
||||
|
||||
\PYG{+w}{ }\PYG{c+c1}{// Update is called once per frame}
|
||||
\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{Update}\PYG{p}{()}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZob{}}
|
||||
\PYG{+w}{ }
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
|
||||
|
||||
\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{StartNextLevel}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
|
||||
\PYG{+w}{ }\PYG{c+c1}{// assuming we want to spawn 3 asteroids plus 5 more per level}
|
||||
\PYG{+w}{ }\PYG{k+kt}{int}\PYG{+w}{ }\PYG{n}{numberAsteroids}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m}{3}\PYG{+w}{ }\PYG{o}{+}\PYG{+w}{ }\PYG{p}{(}\PYG{l+m}{5}\PYG{+w}{ }\PYG{o}{*}\PYG{+w}{ }\PYG{n}{currentGameLevel}\PYG{p}{);}
|
||||
|
||||
\PYG{+w}{ }\PYG{c+c1}{// get dimensions of screen}
|
||||
\PYG{+w}{ }\PYG{k+kt}{float}\PYG{+w}{ }\PYG{n}{halfWidth}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{orthographicSize}\PYG{+w}{ }\PYG{o}{*}\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{aspect}\PYG{p}{;}
|
||||
\PYG{+w}{ }\PYG{k+kt}{float}\PYG{+w}{ }\PYG{n}{halfHeight}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{orthographicSize}\PYG{p}{;}
|
||||
|
||||
\PYG{+w}{ }\PYG{k}{for}\PYG{+w}{ }\PYG{p}{(}\PYG{k+kt}{int}\PYG{+w}{ }\PYG{n}{i}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m}{0}\PYG{p}{;}\PYG{+w}{ }\PYG{n}{i}\PYG{+w}{ }\PYG{o}{\PYGZlt{}}\PYG{+w}{ }\PYG{n}{numberAsteroids}\PYG{p}{;}\PYG{+w}{ }\PYG{n}{i}\PYG{o}{++}\PYG{p}{)}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZob{}}
|
||||
\PYG{+w}{ }\PYG{k+kt}{float}\PYG{+w}{ }\PYG{n}{randomX}\PYG{p}{;}
|
||||
\PYG{+w}{ }\PYG{k+kt}{float}\PYG{+w}{ }\PYG{n}{randomZ}\PYG{p}{;}
|
||||
\PYG{+w}{ }\PYG{k}{do}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
|
||||
\PYG{+w}{ }\PYG{n}{randomX}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{Random}\PYG{p}{.}\PYG{n}{Range}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{halfWidth}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{halfWidth}\PYG{p}{);}
|
||||
\PYG{+w}{ }\PYG{n}{randomZ}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{Random}\PYG{p}{.}\PYG{n}{Range}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{halfHeight}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{halfHeight}\PYG{p}{);}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}\PYG{+w}{ }\PYG{k}{while}\PYG{+w}{ }\PYG{p}{((}\PYG{n}{randomX}\PYG{+w}{ }\PYG{o}{\PYGZlt{}}\PYG{+w}{ }\PYG{l+m}{5}\PYG{+w}{ }\PYG{o}{||}\PYG{+w}{ }\PYG{n}{randomX}\PYG{+w}{ }\PYG{o}{\PYGZgt{}}\PYG{+w}{ }\PYG{o}{\PYGZhy{}}\PYG{l+m}{5}\PYG{p}{)}\PYG{+w}{ }\PYG{o}{\PYGZam{}\PYGZam{}}\PYG{+w}{ }\PYG{p}{(}\PYG{n}{randomZ}\PYG{+w}{ }\PYG{o}{\PYGZlt{}}\PYG{+w}{ }\PYG{l+m}{5}\PYG{+w}{ }\PYG{o}{||}\PYG{+w}{ }\PYG{n}{randomZ}\PYG{+w}{ }\PYG{o}{\PYGZgt{}}\PYG{+w}{ }\PYG{o}{\PYGZhy{}}\PYG{l+m}{5}\PYG{p}{));}
|
||||
|
||||
\PYG{+w}{ }\PYG{n}{Vector3}\PYG{+w}{ }\PYG{n}{spawnPosition}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{n}{randomX}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{0}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{randomZ}\PYG{p}{);}
|
||||
\PYG{+w}{ }\PYG{n}{Instantiate}\PYG{p}{(}\PYG{n}{asteroid}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{spawnPosition}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{Quaternion}\PYG{p}{.}\PYG{n}{identity}\PYG{p}{);}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
|
||||
\PYG{p}{\PYGZcb{}}
|
||||
\end{Verbatim}
|
@ -0,0 +1,59 @@
|
||||
\begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}]
|
||||
\PYG{k}{using}\PYG{+w}{ }\PYG{n+nn}{System.Collections}\PYG{p}{;}
|
||||
\PYG{k}{using}\PYG{+w}{ }\PYG{n+nn}{System.Collections.Generic}\PYG{p}{;}
|
||||
\PYG{k}{using}\PYG{+w}{ }\PYG{n+nn}{UnityEngine}\PYG{p}{;}
|
||||
|
||||
\PYG{k}{public}\PYG{+w}{ }\PYG{k}{class}\PYG{+w}{ }\PYG{n+nc}{AsteroidScript}\PYG{+w}{ }\PYG{p}{:}\PYG{+w}{ }\PYG{n}{MonoBehaviour}
|
||||
\PYG{p}{\PYGZob{}}
|
||||
\PYG{+w}{ }\PYG{k}{public}\PYG{+w}{ }\PYG{n}{GameObject}\PYG{+w}{ }\PYG{n}{asteroid}\PYG{p}{;}
|
||||
\PYG{+w}{ }\PYG{k}{public}\PYG{+w}{ }\PYG{k+kt}{float}\PYG{+w}{ }\PYG{n}{maxSpeed}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m}{300}\PYG{p}{;}
|
||||
\PYG{+w}{ }\PYG{k}{public}\PYG{+w}{ }\PYG{k+kt}{float}\PYG{+w}{ }\PYG{n}{minSpeed}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{o}{\PYGZhy{}}\PYG{l+m}{300}\PYG{p}{;}
|
||||
|
||||
\PYG{+w}{ }\PYG{c+c1}{// Start is called before the first frame update}
|
||||
\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{Start}\PYG{p}{()}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZob{}}
|
||||
\PYG{+w}{ }\PYG{c+c1}{// adding force to the asteroid}
|
||||
\PYG{+w}{ }\PYG{n}{Vector3}\PYG{+w}{ }\PYG{n}{forceVector}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{n}{Random}\PYG{p}{.}\PYG{n}{Range}\PYG{p}{(}\PYG{n}{minSpeed}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{maxSpeed}\PYG{p}{),}\PYG{n}{Random}\PYG{p}{.}\PYG{n}{Range}\PYG{p}{(}\PYG{n}{minSpeed}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{maxSpeed}\PYG{p}{),}\PYG{+w}{ }\PYG{n}{Random}\PYG{p}{.}\PYG{n}{Range}\PYG{p}{(}\PYG{n}{minSpeed}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{maxSpeed}\PYG{p}{));}
|
||||
\PYG{+w}{ }\PYG{n}{asteroid}\PYG{p}{.}\PYG{n}{GetComponent}\PYG{o}{\PYGZlt{}}\PYG{n}{Rigidbody}\PYG{o}{\PYGZgt{}}\PYG{p}{().}\PYG{n}{AddForce}\PYG{p}{(}\PYG{n}{forceVector}\PYG{p}{);}
|
||||
|
||||
\PYG{+w}{ }\PYG{n}{InvokeRepeating}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}CheckOffscreen\PYGZdq{}}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{0f}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{0.2f}\PYG{p}{);}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
|
||||
|
||||
\PYG{+w}{ }\PYG{c+c1}{// Update is called once per frame}
|
||||
\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{Update}\PYG{p}{()}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZob{}}
|
||||
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
|
||||
|
||||
\PYG{+w}{ }\PYG{c+c1}{// method to check if asteroid has gone offscreen}
|
||||
\PYG{+w}{ }\PYG{k}{private}\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{CheckOffscreen}\PYG{p}{()}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZob{}}
|
||||
\PYG{+w}{ }\PYG{k+kt}{float}\PYG{+w}{ }\PYG{n}{halfWidth}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{orthographicSize}\PYG{+w}{ }\PYG{o}{*}\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{aspect}\PYG{p}{;}
|
||||
\PYG{+w}{ }\PYG{k+kt}{float}\PYG{+w}{ }\PYG{n}{halfHeight}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{orthographicSize}\PYG{p}{;}
|
||||
|
||||
\PYG{+w}{ }\PYG{k+kt}{int}\PYG{+w}{ }\PYG{n}{padding}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m}{5}\PYG{p}{;}\PYG{+w}{ }\PYG{c+c1}{// padding variable to account for size of asteroid}
|
||||
|
||||
\PYG{+w}{ }\PYG{n}{Vector3}\PYG{+w}{ }\PYG{n}{minBounds}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{halfWidth}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{0}\PYG{p}{,}\PYG{+w}{ }\PYG{o}{\PYGZhy{}}\PYG{n}{halfHeight}\PYG{p}{);}
|
||||
\PYG{+w}{ }\PYG{n}{Vector3}\PYG{+w}{ }\PYG{n}{maxBounds}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{n}{halfWidth}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{0}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{halfHeight}\PYG{p}{);}
|
||||
|
||||
\PYG{+w}{ }\PYG{c+c1}{// if asteroid goes offscreen, wrapping around}
|
||||
\PYG{+w}{ }\PYG{k}{if}\PYG{+w}{ }\PYG{p}{(}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{.}\PYG{n}{x}\PYG{+w}{ }\PYG{o}{\PYGZlt{}}\PYG{+w}{ }\PYG{n}{minBounds}\PYG{p}{.}\PYG{n}{x}\PYG{+w}{ }\PYG{o}{\PYGZhy{}}\PYG{+w}{ }\PYG{n}{padding}\PYG{p}{)}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZob{}}
|
||||
\PYG{+w}{ }\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{n}{maxBounds}\PYG{p}{.}\PYG{n}{x}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{.}\PYG{n}{y}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{.}\PYG{n}{z}\PYG{p}{);}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
|
||||
\PYG{+w}{ }\PYG{k}{else}\PYG{+w}{ }\PYG{n+nf}{if}\PYG{+w}{ }\PYG{p}{(}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{.}\PYG{n}{x}\PYG{+w}{ }\PYG{o}{\PYGZgt{}}\PYG{+w}{ }\PYG{n}{maxBounds}\PYG{p}{.}\PYG{n}{x}\PYG{+w}{ }\PYG{o}{+}\PYG{+w}{ }\PYG{n}{padding}\PYG{p}{)}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZob{}}
|
||||
\PYG{+w}{ }\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{n}{minBounds}\PYG{p}{.}\PYG{n}{x}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{.}\PYG{n}{y}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{.}\PYG{n}{z}\PYG{p}{);}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
|
||||
|
||||
\PYG{+w}{ }\PYG{k}{if}\PYG{+w}{ }\PYG{p}{(}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{.}\PYG{n}{z}\PYG{+w}{ }\PYG{o}{\PYGZlt{}}\PYG{+w}{ }\PYG{n}{minBounds}\PYG{p}{.}\PYG{n}{z}\PYG{+w}{ }\PYG{o}{\PYGZhy{}}\PYG{+w}{ }\PYG{n}{padding}\PYG{p}{)}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZob{}}
|
||||
\PYG{+w}{ }\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{.}\PYG{n}{x}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{.}\PYG{n}{y}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{maxBounds}\PYG{p}{.}\PYG{n}{z}\PYG{p}{);}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
|
||||
\PYG{+w}{ }\PYG{k}{else}\PYG{+w}{ }\PYG{n+nf}{if}\PYG{+w}{ }\PYG{p}{(}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{.}\PYG{n}{z}\PYG{+w}{ }\PYG{o}{\PYGZgt{}}\PYG{+w}{ }\PYG{n}{maxBounds}\PYG{p}{.}\PYG{n}{z}\PYG{+w}{ }\PYG{o}{+}\PYG{+w}{ }\PYG{n}{padding}\PYG{p}{)}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZob{}}
|
||||
\PYG{+w}{ }\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{.}\PYG{n}{x}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{.}\PYG{n}{y}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{minBounds}\PYG{p}{.}\PYG{n}{z}\PYG{p}{);}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
|
||||
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
|
||||
\PYG{p}{\PYGZcb{}}
|
||||
\end{Verbatim}
|
@ -0,0 +1,102 @@
|
||||
|
||||
\makeatletter
|
||||
\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax%
|
||||
\let\PYG@ul=\relax \let\PYG@tc=\relax%
|
||||
\let\PYG@bc=\relax \let\PYG@ff=\relax}
|
||||
\def\PYG@tok#1{\csname PYG@tok@#1\endcsname}
|
||||
\def\PYG@toks#1+{\ifx\relax#1\empty\else%
|
||||
\PYG@tok{#1}\expandafter\PYG@toks\fi}
|
||||
\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{%
|
||||
\PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}}
|
||||
\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}}
|
||||
|
||||
\@namedef{PYG@tok@w}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
|
||||
\@namedef{PYG@tok@c}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
|
||||
\@namedef{PYG@tok@cp}{\def\PYG@tc##1{\textcolor[rgb]{0.61,0.40,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@k}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@kp}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@kt}{\def\PYG@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}}
|
||||
\@namedef{PYG@tok@o}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
|
||||
\@namedef{PYG@tok@ow}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
|
||||
\@namedef{PYG@tok@nb}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@nf}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
|
||||
\@namedef{PYG@tok@nc}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
|
||||
\@namedef{PYG@tok@nn}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
|
||||
\@namedef{PYG@tok@ne}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.80,0.25,0.22}{##1}}}
|
||||
\@namedef{PYG@tok@nv}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
|
||||
\@namedef{PYG@tok@no}{\def\PYG@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@nl}{\def\PYG@tc##1{\textcolor[rgb]{0.46,0.46,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@ni}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.44,0.44,0.44}{##1}}}
|
||||
\@namedef{PYG@tok@na}{\def\PYG@tc##1{\textcolor[rgb]{0.41,0.47,0.13}{##1}}}
|
||||
\@namedef{PYG@tok@nt}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@nd}{\def\PYG@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
|
||||
\@namedef{PYG@tok@s}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
|
||||
\@namedef{PYG@tok@sd}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
|
||||
\@namedef{PYG@tok@si}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.64,0.35,0.47}{##1}}}
|
||||
\@namedef{PYG@tok@se}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.67,0.36,0.12}{##1}}}
|
||||
\@namedef{PYG@tok@sr}{\def\PYG@tc##1{\textcolor[rgb]{0.64,0.35,0.47}{##1}}}
|
||||
\@namedef{PYG@tok@ss}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
|
||||
\@namedef{PYG@tok@sx}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@m}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
|
||||
\@namedef{PYG@tok@gh}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
|
||||
\@namedef{PYG@tok@gu}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}}
|
||||
\@namedef{PYG@tok@gd}{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@gi}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.52,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@gr}{\def\PYG@tc##1{\textcolor[rgb]{0.89,0.00,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@ge}{\let\PYG@it=\textit}
|
||||
\@namedef{PYG@tok@gs}{\let\PYG@bf=\textbf}
|
||||
\@namedef{PYG@tok@ges}{\let\PYG@bf=\textbf\let\PYG@it=\textit}
|
||||
\@namedef{PYG@tok@gp}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
|
||||
\@namedef{PYG@tok@go}{\def\PYG@tc##1{\textcolor[rgb]{0.44,0.44,0.44}{##1}}}
|
||||
\@namedef{PYG@tok@gt}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
|
||||
\@namedef{PYG@tok@err}{\def\PYG@bc##1{{\setlength{\fboxsep}{\string -\fboxrule}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}}
|
||||
\@namedef{PYG@tok@kc}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@kd}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@kn}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@kr}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@bp}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@fm}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
|
||||
\@namedef{PYG@tok@vc}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
|
||||
\@namedef{PYG@tok@vg}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
|
||||
\@namedef{PYG@tok@vi}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
|
||||
\@namedef{PYG@tok@vm}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
|
||||
\@namedef{PYG@tok@sa}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
|
||||
\@namedef{PYG@tok@sb}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
|
||||
\@namedef{PYG@tok@sc}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
|
||||
\@namedef{PYG@tok@dl}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
|
||||
\@namedef{PYG@tok@s2}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
|
||||
\@namedef{PYG@tok@sh}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
|
||||
\@namedef{PYG@tok@s1}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
|
||||
\@namedef{PYG@tok@mb}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
|
||||
\@namedef{PYG@tok@mf}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
|
||||
\@namedef{PYG@tok@mh}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
|
||||
\@namedef{PYG@tok@mi}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
|
||||
\@namedef{PYG@tok@il}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
|
||||
\@namedef{PYG@tok@mo}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
|
||||
\@namedef{PYG@tok@ch}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
|
||||
\@namedef{PYG@tok@cm}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
|
||||
\@namedef{PYG@tok@cpf}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
|
||||
\@namedef{PYG@tok@c1}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
|
||||
\@namedef{PYG@tok@cs}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
|
||||
|
||||
\def\PYGZbs{\char`\\}
|
||||
\def\PYGZus{\char`\_}
|
||||
\def\PYGZob{\char`\{}
|
||||
\def\PYGZcb{\char`\}}
|
||||
\def\PYGZca{\char`\^}
|
||||
\def\PYGZam{\char`\&}
|
||||
\def\PYGZlt{\char`\<}
|
||||
\def\PYGZgt{\char`\>}
|
||||
\def\PYGZsh{\char`\#}
|
||||
\def\PYGZpc{\char`\%}
|
||||
\def\PYGZdl{\char`\$}
|
||||
\def\PYGZhy{\char`\-}
|
||||
\def\PYGZsq{\char`\'}
|
||||
\def\PYGZdq{\char`\"}
|
||||
\def\PYGZti{\char`\~}
|
||||
% for compatibility with earlier versions
|
||||
\def\PYGZat{@}
|
||||
\def\PYGZlb{[}
|
||||
\def\PYGZrb{]}
|
||||
\makeatother
|
||||
|
Reference in New Issue
Block a user