home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / shwtxt19.zip / PEGS.ST < prev    next >
Text File  |  1995-08-02  |  3KB  |  43 lines

  1. 'PEGS.ST - PEGS GAME - written by Garry Spencer
  2. copy(pegs,1)\if`[m?] then cls\!"Mouse required."\exit
  3. :ng\copy(1,0)\for %i=0 to 7\v%i=0\next
  4. :s\bcopy1to0(1,1,25,51)\bcopy1to0(11,53,25,80)\:m\csr\wk\%r=[.r]\%c=[.c]
  5. if clk(25,56,25,65)ng\if [.25:72:25:77] | [k]=27 then exitc
  6. if [at:0:%r:%c]<>63 m\csr off\%a1=[at:0:%r:%c-1]\%a2=[at:0:%r:%c+1]
  7. if %a1=63 & %a2<>63 then %c--\endif\if %a2=63 & %a1<>63 then %c++\endif\c@%r,%c
  8. bfill5(1,1,25,50)ascii32\poke5(%r,%c)ascii254\%ok=0
  9. if [at:0:%r-2:%c]=63 & [as:0:%r-4:%c]=7 then %ok=1\poke5(%r-4,%c)ascii254
  10. if [at:0:%r+2:%c]=63 & [as:0:%r+4:%c]=7 then %ok=1\poke5(%r+4,%c)ascii254
  11. if [at:0:%r:%c-5]=63 & [as:0:%r:%c-10]=7 then %ok=1\poke5(%r,%c-10)ascii254
  12. if [at:0:%r:%c+5]=63 & [as:0:%r:%c+10]=7 then %ok=1\poke5(%r,%c+10)ascii254
  13. if %ok=0 m\%r1=%r\%c1=%c\copy(0,2)\copy(0,3)
  14. poke3(%r,%c-1)32 31\poke3(%r,%c)7 31\poke3(%r,%c+1)32 31
  15. :m2\wk0\if key esc then copy(2,0)\goto m\endif\if not key null ck
  16. %r=[r.]\%c=[c.]\copy(3,4)\bfill4(%r,%c-1,%r,%c+1)219 207\copy(4,0)\goto m2
  17. :ck\csr\%r=[.r]\%c=[.c]\%a1=[as:5:%r:%c-1]\%a2=[as:5:%r:%c]\%a3=[as:5:%r:%c+1]
  18. if %a1<>254 & %a2<>254 & %a3<>254 then copy(2,0)\goto m
  19. if %a1=254 then %c--\endif\if %a3=254 then %c++\endif\c@%r,%c
  20. copy(3,0)\bfill0(%r,%c-1,%r,%c+1)32 63
  21. if %r1<%r then bfill0(%r-2,%c-1,%r-2,%c+1)32 31\poke0(%r-2,%c)7 31
  22. if %r1>%r then bfill0(%r+2,%c-1,%r+2,%c+1)32 31\poke0(%r+2,%c)7 31
  23. if %c1<%c then bfill0(%r,%c-6,%r,%c-4)32 31\poke0(%r,%c-5)7 31
  24. if %c1>%c then bfill0(%r,%c+4,%r,%c+6)32 31\poke0(%r,%c+5)7 31
  25. nochk\%ok=0\%p=0\for %r=7 to 19 step 2\for %c=11 to 41 step 5
  26. if [at:0:%r:%c]<>63 nxt \ %p++
  27. if [at:0:%r-2:%c]=63 & [as:0:%r-4:%c]=7 then %ok=1
  28. if [at:0:%r+2:%c]=63 & [as:0:%r+4:%c]=7 then %ok=1
  29. if [at:0:%r:%c-5]=63 & [as:0:%r:%c-10]=7 then %ok=1
  30. if [at:0:%r:%c+5]=63 & [as:0:%r:%c+10]=7 then %ok=1
  31. :nxt\next %c\next %r\chk\if %ok=1 m\%s=255
  32. if %p=1 & [at:0:13:26]= 63 then %s=0
  33. if %p=1 & [at:0:13:26]<>63 then %s=1
  34. if %s=255 then %s=%p\endif\if %s>7 then %s=7\endif\v%s++
  35. select case %s\case 0\%n1=8\%n2=56\%n3=12\case 1\%n1=9\%n2=56\%n3=15
  36. case 2\%n1=8\%n2=63\%n3=17\case 3\%n1=9\%n2=63\%n3=18\case 4\%n1=8\%n2=70\%n3=19
  37. case 5\%n1=9\%n2=70\%n3=20\case 6\%n1=8\%n2=77\%n3=21\case 7\%n1=9\%n2=77\%n3=22
  38. end select\color 11,1\p@%n1,%n2\!v%s,2q\bfill0(%n3,67,%n3,80)attr78
  39. bfill0(24,53,25,80)32 47\p-\p@24,61\!"Play Again?";\p@25,67\!"or";\p+
  40. color 4,7\p@25,61\!" Yes ";\p@25,70\!" No ";\:agn\wk\if key esc then exitc
  41. if clk(25,61,25,65)s \ if not clk(25,70,25,73)agn \ exitc
  42.  
  43.