basic moar wip docs

This commit is contained in:
minjaesong
2020-12-20 00:26:47 +09:00
parent f716dbd719
commit f81d28dfc7
8 changed files with 40 additions and 14 deletions

View File

@@ -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

View File

@@ -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}

View File

@@ -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

View File

@@ -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

4
assets/tbas/doc/fib.bas Normal file
View File

@@ -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

View File

@@ -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

View File

@@ -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}

View File

@@ -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.