diff --git a/assets/fib.bas b/assets/fib.bas index 13c792a..17e7b3b 100644 --- a/assets/fib.bas +++ b/assets/fib.bas @@ -1 +1,4 @@ 10 DEFUN FIB(N)=IF N==0 THEN 0 ELSE IF N==1 THEN 1 ELSE FIB(N-1)+FIB(N-2) +20 FOR K=1 TO 12 +30 PRINT FIB(K);" "; +40 NEXT diff --git a/assets/tbas/doc/bibliography.tex b/assets/tbas/doc/bibliography.tex new file mode 100644 index 0000000..43ed1d7 --- /dev/null +++ b/assets/tbas/doc/bibliography.tex @@ -0,0 +1,3 @@ +\begin{itemlist} +\item \emph{PC-BASIC 2.0.3 Documentation} \\ \url{https://robhagemans.github.io/pcbasic/doc/2.0/} +\end{itemlist} diff --git a/assets/tbas/doc/facmap.bas b/assets/tbas/doc/facmap.bas new file mode 100644 index 0000000..854a003 --- /dev/null +++ b/assets/tbas/doc/facmap.bas @@ -0,0 +1,3 @@ +10 DEFUN FAC(N)=IF N==0 THEN 1 ELSE N*FAC(N-1) +20 K=MAP FAC, 1 TO 10 +30 PRINT K diff --git a/assets/tbas/doc/facrec.bas b/assets/tbas/doc/facrec.bas new file mode 100644 index 0000000..5ca49fb --- /dev/null +++ b/assets/tbas/doc/facrec.bas @@ -0,0 +1,4 @@ +10 DEFUN FAC(N)=IF N==0 THEN 1 ELSE N*FAC(N-1) +20 FOR K=1 TO 6 +30 PRINT FAC(K) +40 NEXT diff --git a/assets/tbas/doc/fib.bas b/assets/tbas/doc/fib.bas new file mode 100644 index 0000000..17e7b3b --- /dev/null +++ b/assets/tbas/doc/fib.bas @@ -0,0 +1,4 @@ +10 DEFUN FIB(N)=IF N==0 THEN 0 ELSE IF N==1 THEN 1 ELSE FIB(N-1)+FIB(N-2) +20 FOR K=1 TO 12 +30 PRINT FIB(K);" "; +40 NEXT diff --git a/assets/tbas/doc/functions.tex b/assets/tbas/doc/functions.tex index f508206..22022c8 100644 --- a/assets/tbas/doc/functions.tex +++ b/assets/tbas/doc/functions.tex @@ -71,8 +71,8 @@ Functions are a form of expression that may taks input arguments surrounded by p \codeline{Y \textbf{= DIM(}X\textbf{)}}\par Returns array with size of \code{X}, all filled with zero. \subsection{GETKEYSDOWN} - \codeline{Y \textbf{= GETKEYSDOWN(}X\textbf{)}}\par - Returns array that contains keycode of keys held down in \code{X}.\par + \codeline{\textbf{GETKEYSDOWN} VARIABLE}\par + Stores array that contains keycode of keys held down in \code{VARIABLE}.\par Actual keycode and the array length depends on the machine: in \thismachine , array length will be fixed to 8. For the list of available keycodes, see \ref{technical}. \subsection{INPUT} \codeline{\textbf{INPUT} VARIABLE}\par diff --git a/assets/tbas/doc/langguide.tex b/assets/tbas/doc/langguide.tex index ff7546c..f30c006 100644 --- a/assets/tbas/doc/langguide.tex +++ b/assets/tbas/doc/langguide.tex @@ -1,9 +1,19 @@ \begin{lstlisting} -10 REM TERRAN BASIC -20 REM REFERENCE MANUAL -30 REM For Version 1.0 -40 REM First Edition -100 PRINT "Hello, world!" -110 PRINT "Git gud!" -999 END +10 DEFUN FAC(N)=IF N==0 THEN 1 ELSE N*FAC(N-1) +20 FOR K=1 TO 6 +30 PRINT FAC(K) +40 NEXT +\end{lstlisting} + +\begin{lstlisting} +10 DEFUN FAC(N)=IF N==0 THEN 1 ELSE N*FAC(N-1) +20 K=MAP FAC, 1 TO 10 +30 PRINT K +\end{lstlisting} + +\begin{lstlisting} +10 DEFUN FIB(N)=IF N==0 THEN 0 ELSE IF N==1 THEN 1 ELSE FIB(N-1)+FIB(N-2) +20 FOR K=1 TO 12 +30 PRINT FIB(K);" "; +40 NEXT \end{lstlisting} diff --git a/assets/tbas/doc/tbasman.tex b/assets/tbas/doc/tbasman.tex index 61fff7b..81ae831 100644 --- a/assets/tbas/doc/tbasman.tex +++ b/assets/tbas/doc/tbasman.tex @@ -179,13 +179,12 @@ \chapter{Technical Reference} \input{implementation} - -%% Bibliography %% -% https://robhagemans.github.io/pcbasic/doc/2.0/ - - \chapter{Index} +\chapter{Bibliography} +\input{bibliography} + + \chapter*{Disclaimers} \oreallypress{} is entirely fictional publishing entity; \oreallypress{} has no affiliation whatsoever with any of the real-world publishers.