home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 26
/
CD_ASCQ_26_1295.iso
/
vrac
/
shwtxt19.zip
/
PEGS.ST
< prev
next >
Wrap
Text File
|
1995-08-02
|
3KB
|
43 lines
'PEGS.ST - PEGS GAME - written by Garry Spencer
copy(pegs,1)\if`[m?] then cls\!"Mouse required."\exit
:ng\copy(1,0)\for %i=0 to 7\v%i=0\next
:s\bcopy1to0(1,1,25,51)\bcopy1to0(11,53,25,80)\:m\csr\wk\%r=[.r]\%c=[.c]
if clk(25,56,25,65)ng\if [.25:72:25:77] | [k]=27 then exitc
if [at:0:%r:%c]<>63 m\csr off\%a1=[at:0:%r:%c-1]\%a2=[at:0:%r:%c+1]
if %a1=63 & %a2<>63 then %c--\endif\if %a2=63 & %a1<>63 then %c++\endif\c@%r,%c
bfill5(1,1,25,50)ascii32\poke5(%r,%c)ascii254\%ok=0
if [at:0:%r-2:%c]=63 & [as:0:%r-4:%c]=7 then %ok=1\poke5(%r-4,%c)ascii254
if [at:0:%r+2:%c]=63 & [as:0:%r+4:%c]=7 then %ok=1\poke5(%r+4,%c)ascii254
if [at:0:%r:%c-5]=63 & [as:0:%r:%c-10]=7 then %ok=1\poke5(%r,%c-10)ascii254
if [at:0:%r:%c+5]=63 & [as:0:%r:%c+10]=7 then %ok=1\poke5(%r,%c+10)ascii254
if %ok=0 m\%r1=%r\%c1=%c\copy(0,2)\copy(0,3)
poke3(%r,%c-1)32 31\poke3(%r,%c)7 31\poke3(%r,%c+1)32 31
:m2\wk0\if key esc then copy(2,0)\goto m\endif\if not key null ck
%r=[r.]\%c=[c.]\copy(3,4)\bfill4(%r,%c-1,%r,%c+1)219 207\copy(4,0)\goto m2
:ck\csr\%r=[.r]\%c=[.c]\%a1=[as:5:%r:%c-1]\%a2=[as:5:%r:%c]\%a3=[as:5:%r:%c+1]
if %a1<>254 & %a2<>254 & %a3<>254 then copy(2,0)\goto m
if %a1=254 then %c--\endif\if %a3=254 then %c++\endif\c@%r,%c
copy(3,0)\bfill0(%r,%c-1,%r,%c+1)32 63
if %r1<%r then bfill0(%r-2,%c-1,%r-2,%c+1)32 31\poke0(%r-2,%c)7 31
if %r1>%r then bfill0(%r+2,%c-1,%r+2,%c+1)32 31\poke0(%r+2,%c)7 31
if %c1<%c then bfill0(%r,%c-6,%r,%c-4)32 31\poke0(%r,%c-5)7 31
if %c1>%c then bfill0(%r,%c+4,%r,%c+6)32 31\poke0(%r,%c+5)7 31
nochk\%ok=0\%p=0\for %r=7 to 19 step 2\for %c=11 to 41 step 5
if [at:0:%r:%c]<>63 nxt \ %p++
if [at:0:%r-2:%c]=63 & [as:0:%r-4:%c]=7 then %ok=1
if [at:0:%r+2:%c]=63 & [as:0:%r+4:%c]=7 then %ok=1
if [at:0:%r:%c-5]=63 & [as:0:%r:%c-10]=7 then %ok=1
if [at:0:%r:%c+5]=63 & [as:0:%r:%c+10]=7 then %ok=1
:nxt\next %c\next %r\chk\if %ok=1 m\%s=255
if %p=1 & [at:0:13:26]= 63 then %s=0
if %p=1 & [at:0:13:26]<>63 then %s=1
if %s=255 then %s=%p\endif\if %s>7 then %s=7\endif\v%s++
select case %s\case 0\%n1=8\%n2=56\%n3=12\case 1\%n1=9\%n2=56\%n3=15
case 2\%n1=8\%n2=63\%n3=17\case 3\%n1=9\%n2=63\%n3=18\case 4\%n1=8\%n2=70\%n3=19
case 5\%n1=9\%n2=70\%n3=20\case 6\%n1=8\%n2=77\%n3=21\case 7\%n1=9\%n2=77\%n3=22
end select\color 11,1\p@%n1,%n2\!v%s,2q\bfill0(%n3,67,%n3,80)attr78
bfill0(24,53,25,80)32 47\p-\p@24,61\!"Play Again?";\p@25,67\!"or";\p+
color 4,7\p@25,61\!" Yes ";\p@25,70\!" No ";\:agn\wk\if key esc then exitc
if clk(25,61,25,65)s \ if not clk(25,70,25,73)agn \ exitc