home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 4: Phase Four / 17Bit_Phase_Four.iso / files / 3034.dms / 3034.adf / simon.AMOS / simon.amosSourceCode
Encoding:
AMOS Source Code  |  1993-02-25  |  2.0 KB  |  37 lines

  1. 'converted from an old stos listing
  2. Screen Open 0,640,256,16,Hires
  3. Reserve Zone 20
  4. 100 Rem ~~~~~~~~~~~~~~~~~~~~ SIMON ~~~~~~~~~~~~~~~~~~~~
  5. 110 Curs Off : Flash Off : Cls 0 : Show On 
  6. 120 Dim SCOLS(3),NTE(3)
  7. 130 For I=0 To 3 : Read SCOLS(I),NTE(I) : Colour I+8,SCOLS(I)/7 : Next I : Rem * read colour and note data *
  8. 140 Pen 1 : Paper 0 : Clw : Locate 0,0 : Centre "SIMON"
  9. 150 Repeat : Locate 0,2 : Print "LEVEL (1-10)        "; : Locate 13,2 : Input LVL : Until LVL>=1 and LVL<=10
  10. 160 Reserve As Work 5,10000 : MEM=0 : DELAY=21-LVL*2 : Rem * reserve space for sequence and initialize variables *
  11. 170 For I=8 To 11
  12. 180 Ink I : Pen 0 : Paper I : Read X,Y,T$
  13. 190 Bar X,Y To X+159,Y+99 : Set Zone I,X,Y To X+159,Y+99 : Rem * colour area and define zone *
  14. 200 Locate X Text(X)+8,Y Text(Y)+6 : Print T$ : Rem * print colours *
  15. 210 Next I
  16. 220 Repeat 
  17. 230 Inc MEM : FLAG=False
  18. 240 SCOL=Rnd(3)+8 : Poke Start(5)+MEM,SCOL : Gosub 350 : Rem * add to sequence *
  19. 250 For I=1 To MEM : ANSWER=Peek(Start(5)+I)
  20. 260 Repeat : ZNE=Mouse Zone : Until Mouse Key>0 : While Mouse Key : Wend : Rem * wait for selection and release * 
  21. 270 SCOL=ZNE : Gosub 390 : Rem * light selected answer *
  22. 280 If ZNE<>ANSWER Then I=MEM+1 : FLAG=True : Rem * stop if answer incorrect * 
  23. 290 Next I : Wait 20
  24. 300 Until FLAG=True
  25. 310 Locate 0,10 : Pen 1 : Paper 0 : Centre " GAME OVER "
  26. 320 Locate 0,12 : Centre " YOU SCORED"+Str$(MEM)+" "
  27. 330 End 
  28. 340 Rem ~~~~~~~~~~~~~~~~~~~~ REPEAT SEQUENCE ~~~~~~~~~~~~~~~~~~~~
  29. 350 For I=1 To MEM : SCOL=Peek(Start(5)+I) : Gosub 390 : Next I : Rem * show sequence *
  30. 360 For I=8 To 11 : Colour I,SCOLS(I-8)/7 : Next I : Rem * reset colours *
  31. 370 Return 
  32. 380 Rem ~~~~~~~~~~~~~~~~~~~~ SHOW/REMOVE LIGHT/SOUND ~~~~~~~~~~~~~~~~~~~~
  33. 390 Colour SCOL,SCOLS(SCOL-8) : Volume 2,15 : Play 2,NTE(SCOL-8),0 : Wait DELAY : Rem * light and make noise * 
  34. 400 Colour SCOL,SCOLS(SCOL-8)/7 : Volume 0 : Wait Max(1,DELAY/5) : Rem * reset colour and stop noise *
  35. 410 Return 
  36. 420 Data $700,49,$70,51,$7,53,$770,56
  37. 430 Data 0,0,"RED",160,0,"GREEN",0,99,"BLUE",160,99,"YELLOW"