	
RA(W,MAKEPOINTER(@,))	SA(W,MAKEPOINTER(B,))
A(W,MAKEPOINTER(RA,SA))
( (A)
2 BASE 1T
< PLAY$[
,
]: PLAYSU$[
,
]: CA[,]
F COMP$[
,
]: COMPSU$[
,
]: ARRAY$[
,
]
P FORM[]
ZCHNEXT
  : ERCINVALIDDATA| :CHFINISH
dFILE$SLAGSCHIP.FORM
nINDEX
xFHPASW$MODErmERCOPENFILE((FH),(FILE$),(FILE$),(PASW$),(PASW$),MODE)t ERC  FORM$SLAGSCHIPERCOPENFORM(FH,(FORM$),(FORM$),(FORM[]),) ERC  ERCCLOSEFILE(FH) ()ERCDISPLAYFORM((FORM[]),,,): ERC  m:*******************************************:**      CONSTANTEN EN BOODSCHAPPEN       **:*******************************************BS:DS:SB:CO:AF:SC
PBS:PDS:PSB:PSC:PAFI
CBS:CDS:CSB:CSC:CAF]
,MESG$(, )
6MSG1$COMPUTER IS SETTING UP PLAYERS SHIPS 
@MSG4$THE COMPUTER IS SETTING UP HIS SHIPS 
JMSG5$THE GAME STARTS NOW YOUR FIRST SHOT?TMSG6$NOW THE B20 SHOOTSBANG,BANG  W^MSG7$YOUR SHOT                            hMSG8$YOU HAVE WON TOO BAD                rMSG9$THE B20 HAS WON YOU ARE DEFETED   |MSG10$YOU JUST WAISTED A SHOT            MSG11$RETURN for a new Game, FINISH to End j:*****************************************************************:**      START OF BATTLESHIP                                    **:***************************************************************** Q  
 R  
4 PLAYSU$[Q,R] J PLAY$[Q,R]  COMP$[Q,R] flCA[,]:CA[,]: 
:CA[,]CMESG$MSG1$: SCHAR$B:NC 
:CLCOC: 
:CUCOC  LOOP  0 SCHAR$D: NC>D  
:CLCOC: 
:CUCOCIN  bX  RESULT$F  Dhbyl LOOP  v SCHAR$S NC  
:CLCOC: 
:CUCOC    RESULT$F   .:************************************************************s:**     SUB TO PUT CHAR IN PLAYERS ARRAY PLAYSU$           **:************************************************************RESULT$T (CUCO  CLCO)  H (CUCO  CLCO)   (CUCO  CLCO)  = I  NCf  PLAYSU$[CLCO,CUCOI]   l|  I  NC* PLAYSU$[CLCO,CUCOI]SCHAR$4> $H I  NCR  PLAYSU$[CLCOI,CUCO]   \f I  NCp PLAYSU$[CLCOI,CUCO]SCHAR$'z1 $A I  NCj  PLAYSU$[CLCO,CUCOI]   p I  NC PLAYSU$[CLCO,CUCOI]SCHAR$ $ I  NC  PLAYSU$[CLCO,CUCOI]    I  NC PLAYSU$[CLCO,CUCOI]SCHAR$+1ARESULT$FG$W.MESG$MSG4$a8 kB 
vLSIZV *
 (CBSCDSCSB)  j t (PBSPDSPSB)   VMESG$MSG9$  MESG$MSG8$ 3ERCDELAY(): ERC  DMESG$MSG11$N X n UCO    t:*****************************************************************:**      SUB TO SET SHIPS IN PLAYERS FIELD                      **O
:*****************************************************************lCA[,]NC:RESULT$T COUNT  NC( r2 PLAYSU$[LCO,UCO]   x<PLAYSU$[LCO,UCO]SCHAR$FCA[,COUNT]LCO:CA[,COUNT]UCOP Zd zn+xTEMPMESG$MESG$<MESG$MSG10$F YERCDELAY(
)m ERC  MESG$TEMPMESG$  (:****************************************************************:**     ERROR HANDELING                                        **m:**************************************************************** ERC  |   MOREGAMES.BAS ERROR IS ,ERC:****************************************************************?:**       SUB TO WRITE INFO IN TO MSG.AREA                     **:****************************************************************ERCDEFAULTFIELD((FORM[]),MSG,), ERC  6INDEX@TYPEC$CHARACTER.*JERCWRITEFIELD((FORM[]),MSG,,(MESG$),,(TYPEC$))>T ERC  D^h:****************************************************************r:**     SUB TO READ COORDINATES FROM PLAYER                    **|:****************************************************************FERCDEFAULTFIELD((FORM[]),CO,)Z ERC  nINITSTATE[]ERCUSERFILLFIELD((FORM[]),CO,,(INITSTATE[]),(EXITSTATE[])) ERC   EXITSTATE[]CHFINISH   MoreGames.Bas EXITSTATE[]CHNEXT  CINITSTATE[]EXITSTATE[]M [CBREADpTYPEB$BINARY.ERCREADFIELD((FORM[]),CO,,(CO),,(CBREAD),(TYPEB$)) ERC  TEMPCOCO:C TEMPCO  
  0TEMPCOTEMPCO
:CC  =0LCOC:UCOTEMPCOC:D:****************************************************************N:**        SUB TO WRITE ARRAY TO SCREEN                        **X:****************************************************************(bICOL5lILINEFv C1  
X  C2  
s CHAR$ARRAY$[C1,C2] ERCPUTFRAMECHARS(,ICOL,ILINE,(CHAR$),)  ERC   ICOLICOL ICOLILINEILINE J :**************************************************************** :**         SUB TO WRITE SINGLE CHARACTER TO SCREEN             ** :**************************************************************** ICOLUCOILINELCO6ERCPUTFRAMECHARS(,ICOL,ILINE,(SCHAR$),)J  ERC  u*ERCPUTFRAMEATTRS(,ICOL,ILINE,,)4 ERC  >ERCDELAY()H ERC  RERCPUTFRAMEATTRS(,ICOL,ILINE,,)\ ERC  f=p:*****************************************************************z:**        SUB TO CHECK POSITION OF SHIPS                       **:***************************************************************** CA[,]CA[,]   N  CA[,]  CA[,]CA[,N]  L	+4I> T N  CA[,]u  CA[,]CA[,N]  L	{I (CA[I,])CA[I,]  $	 NCA[,]  	  CA[I,(N)](CA[I,N])  L			$$	 N  CA[,]8$.	  CA[I,(N)](CA[I,N])  L	>$8	D$B	U$L	MESG$MSG10$_$V	 u$	 N  CA[,]$j	 LCOCA[,N]$t	 UCOCA[,N]$	 PLAYSU$[LCO,UCO] $	 SCHAR$ $	  $	$	RESULT$F$	ERCBEEP	 ERC  	ERCDELAY(
)3	 ERC  9	}	:************************************************************	:**     SUB TO GENERATE A RND NUMBER                       **	:************************************************************
S
(CA[,]CA[,])

CE
 (Sd)  2
R
SSd^(
CCt2
 (S
)  Z
<
SS
F
CCP
 2
Z
CCSd
 C
  x
n
CC
x
 C  

CC
,'
:************************************************************p'
:**     SUB TO SET UP SHIPS OF COMPUTER                    **'
:************************************************************'
 Q  
'
 R  
'
COMPSU$[Q,R] '
'
(
SCHAR$B:NC.(
 
:CLCOC: 
:CUCOC8(
 I( LOOP  Y( SCHAR$Dd( NC(  
:CLCOC: 
:CUCOC(,  (6  RESULT$F  (@(J LOOP  (T SCHAR$S(^ NC)h  
:CLCOC: 
:CUCOC)r  $)|  RESULT$F  h*)0)t):************************************************************):**     SUB TO PUT CHAR IN COMPUTERS ARRAY COMPSU$         **):*************************************************************RESULT$T.* (CUCO  CLCO)  P* (CUCO  CLCO)  lr* (CUCO  CLCO)  * I  NC*  COMPSU$[CLCO,CUCOI]   ** I  NC* COMPSU$[CLCO,CUCOI]SCHAR$** 
+ I  NC+0  COMPSU$[CLCOI,CUCO]   3+:C+D I  NCf+N COMPSU$[CLCOI,CUCO]SCHAR$l+Xv+b 
+l I  NC+v  COMPSU$[CLCO,CUCOI]   ++ I  NC+ COMPSU$[CLCO,CUCOI]SCHAR$++ 
, I  NC1,  COMPSU$[CLCO,CUCOI]   7,G, I  NCj, COMPSU$[CLCO,CUCOI]SCHAR$p,v,,RESULT$F,
,
:************************************************************
:**    SUB SHOOTING ON COMPUTERS SHIPS                     **X 
:************************************************************l*
 PSC  H
4
MESG$MSG5$: >
 R
H
MESG$MSG7$: R
 R  
\
 Q  
f
 ARRAY$[R,Q]COMP$[R,Q]p
z

 b.
PAF(PBSPDSPSB)..
 PAF  PAFD.
 PAF  PAFS.
CPAFPAF.
SCPSC:AFPAF: >:SBCSB:DSCDS:BSCBS: .
 PLOOP  CPAF.
SCPSC.
AFPAF.
 >.
 .
 COMP$[LCO,UCO]   
MESG$MSG10$: : 6 COMPSU$[LCO,UCO]   .COMP$[LCO,UCO].:SCHAR$.: vMESG$MSG7$: $ . COMPSU$[LCO,UCO]B  8 COMPSU$[LCO,UCO]D  BCOMP$[LCO,UCO]S:SCHAR$S:CSBCSB: 0L CSB   0V D: W0COMP$[LCO,UCO]D:SCHAR$D:CDSCDS: l0j CDS   |0t D: 0COMP$[LCO,UCO]B:SCHAR$B:CBSCBS: 0 CBS   0 D0PSCPSC0PAFPAF.1SCPSC:AFPAF: >:SBCSB:DSCDS:BSCBS: Q1ERCDELAY(
): ERC  n1 (CBSCDSCSB)  t1z11:***********************************************************2:**    SUB TO SHOOT ON PLAYERS SHIPS                      **C2:***********************************************************m2ERCDEFAULTFIELD((FORM[]),CO,)2
 ERC  2MESG$MSG6$: 2 R  
2( Q  
22 ARRAY$[R,Q]PLAYSU$[R,Q]2<2F2P b3ZCAF(CBSCDSCSB)3d CAF  CAF;3n CAF  CAFJ3xCCAFCAF3SCCSC:AFCAF: >:SBPSB:DSPDS:BSPBS: 3 PLOOP  CCAF3MESG$MSG6$: 3 SIZ  3 
:LCOC: 
:UCOC
4 PLAYSU$[LCO,UCO].  4 PLAYSU$[LCO,UCO]X  74 f4SCHAR$TSCHAR$:LCOTLCO:UCOTUCO: p4 h4 PLAYSU$[LCO,UCO]   ^4 PLAYSU$[LCO,UCO]B  @4 PLAYSU$[LCO,UCO]D  5SCHAR$S:PSBPSB: :SIZ5 PSB   5 D: hN5SCHAR$D:PDSPDS: :SIZc5, PDS   s56 D: h5@SCHAR$B:PBSPBS: :SIZ5J PBS   5T D: h5^PLAYSU$[LCO,UCO].:SCHAR$.: 6hCSCCSC:CAFCAFE6rSCCSC:AFCAF: >:SBPSB:DSPDS:BSPBS: h6|ERCDELAY(): ERC  6 (PBSPDSPSB)  666:**************************************************************7:**       SUB FOR COMPUTERS SHOT ADVANCE                    **b7:**************************************************************7TSCHAR$SCHAR$:TLCOLCO:TUCOUCO7SCHAR$X:PLAYSU$[LCO,UCO]X: 78:**************************************************************I8:**          SUB FOR EXPLOSION                               **8:**************************************************************8 VUUR  8ERCSETSCREENVIDATTR(,)8ERCDELAY()8ERCSETSCREENVIDATTR(,)9ERCDELAY()	909:9DERCSETSCREENVIDATTR(,)A9NERCDELAY()9XERCSETSCREENVIDATTR(,)r9bERCDELAY()x9l9v:****************************************************************::**      SUB TO WRITE BS DS SB INFO FIELDS                    **O::****************************************************************d:TYPEC$BINARY.:ERCDEFAULTFIELD((FORM[]),BS,): ERC  :ERCWRITEFIELD((FORM[]),BS,,(BS),,(TYPEC$)): ERC  ;ERCDEFAULTFIELD((FORM[]),DS,); ERC  j;ERCWRITEFIELD((FORM[]),DS,,(DS),,(TYPEC$)); ERC  ;ERCDEFAULTFIELD((FORM[]),SB,); ERC  ;ERCWRITEFIELD((FORM[]),SB,,(SB),,(TYPEC$))< ERC  <V< :*************************************************************<*:**      SUB TO DISPLAY SC AND AF                           **<4:*************************************************************<>TYPEC$BINARY.=HERCDEFAULTFIELD((FORM[]),AF,)3=R ERC  n=\ERCWRITEFIELD((FORM[]),AF,,(AF),,(TYPEC$))=f ERC  =pERCDEFAULTFIELD((FORM[]),SC,)=z ERC  =ERCWRITEFIELD((FORM[]),SC,,(SC),,(TYPEC$))> ERC  >Z>:*************************************************************>:**      SUB TO ADVANCE COMPUTER                            **>:*************************************************************>NSIZ? UCON  .? PLAYSU$[LCO,UCON]SCHAR$  $F? LCON  o? PLAYSU$[LCON,UCO]SCHAR$  ? UCON  ? PLAYSU$[LCO,UCON]SCHAR$  ? LCON  ? PLAYSU$[LCON,UCO]SCHAR$  P?@$PLAYSU$[LCO,UCON]X:STUCOUCOF@.UCOUCON:SCHAR$X: D: V@8UCOSTUCOv@B TSCHAR$B  PBSPBS@L PBS   @V TSCHAR$D  PDSPDS@ PDS   @j TSCHAR$S  PSBPSB@t PSB   ASIZSIZ:1APLAYSU$[LCON,UCO]X:STLCOLCOYALCOLCON:SCHAR$X: D: iALCOSTLCOA TSCHAR$B  PBSPBSA PBS   A TSCHAR$D  PDSPDSA PDS   A TSCHAR$S  PSBPSBB PSB   BSIZSIZ:DBPLAYSU$[LCO,UCON]X:STUCOUCOlBUCOUCON:SCHAR$X: D: |BUCOSTUCOB
 TSCHAR$B  PBSPBSB PBS   B TSCHAR$D  PDSPDSB( PDS   C2 TSCHAR$S  PSBPSBC< PSB   CFSIZSIZ:WCPPLAYSU$[LCON,UCO]X:STLCOLCOCZLCOLCON:SCHAR$X: D: CdLCOSTLCOCn TSCHAR$B  PBSPBSCx PBS   C TSCHAR$D  PDSPDSC PDS   D TSCHAR$S  PSBPSB.D PSB   @DSIZSIZ:BASIC
BATTLESHIP.BAS^FFF^GF^
:sxF<w@N^
VP:u@Ys^FFFFF^
F:	u^FN^vFPFFFPPv\ZTFF^
:v@Pu@YrF<w@NV^
P:u@ZsL^*^
*^4j