Ridiculous MemorieZ

General games-related topics
Post Reply
User avatar
sanello
Posts: 100
Joined: Sat Jul 23, 2022 9:26 pm

Ridiculous MemorieZ

Post by sanello »

This one takes a while to set up the board, but heck, the game is fast and takes so long to play I think it'll be fine. If you're on the original machine, grab a coffee and come back when the board is set up. If you are on an emulator, crank the speed up until the game actually starts and then back to normal.

Edit: Final
memoriez.P
(4.1 KiB) Downloaded 86 times
memoriez.zip
(62.44 KiB) Downloaded 85 times
Last edited by sanello on Sun Aug 14, 2022 12:25 pm, edited 1 time in total.
-sanello
User avatar
XavSnap
Posts: 1938
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Ridiculous MemorieZ

Post by XavSnap »

Code: Select all

     1 PRINT AT 0,6;"ridiculous«memoriez"
     5 RAND 
    10 DIM A$(60)
    15 DIM C$(8,15)
    16 LET S=0
    17 LET F=0
    19 LET R=1
    20 PRINT AT 3,1;"°A°B°C°D°E°F°G°H°I°J°K°L°M°N°O°"
    30 FOR I=4 TO 18 STEP 2
    40 PRINT AT I,0;"¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯"
    50 PRINT AT I+1,0;R;"° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °"
    60 LET R=R+1
    70 NEXT I
    80 PRINT AT 20,0;"¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸"
    85 PRINT AT 1,5;"GENERATING CHARACTERS ";
    90 LET C=0
   100 FOR I=1 TO 60
   105 LET C=C+1
   107 IF C<6 THEN GOTO 105
   110 IF C=7 OR C=15 THEN GOTO 105
   120 IF C>27 AND C<134 THEN LET C=134
   130 IF C=135 OR C=136 OR C=137 OR C=138 THEN GOTO 105
   140 LET A$(I)=CHR$ C
   145 PRINT AT 1,27;A$(I)
   160 NEXT I
   165 PRINT AT 1,1;"SETTING GAME BOARD. MAYBE NAP?";
   170 FOR I=1 TO 60
   171 FOR N=1 TO 2
   172 LET C=INT ((RND*8)+1)
   173 LET D=INT ((RND*15)+1)
   174 IF C$(C,D)<>" " THEN GOTO 172
   175 PRINT AT C+C+3,D+D;"?"
   176 LET C$(C,D)=A$(I)
   177 NEXT N
   178 NEXT I
   235 LET P1=1
   240 PRINT AT 1,0;;"1ST TILE COLUMN,a-o. THEN ENTER."
   245 PRINT AT 3,P1+P1+1;"¬"
   250 IF INKEY$="" THEN GOTO 250
   260 LET I$=INKEY$
   261 IF I$="Z" THEN GOSUB 9000
   270 IF CODE I$<38 OR CODE I$>52 THEN GOTO 250
   275 PRINT AT 3,P1+P1+1;"°"
   280 LET P1=CODE I$-37
   290 PRINT AT 3,P1+P1+1;"¬"
   340 PRINT AT 1,0;;"1ST TILE ROW,˜-Ÿ. THEN ENTER.   "
   345 LET P2=1
   347 PRINT AT 4,1;"«"
   350 IF INKEY$="" THEN GOTO 350
   360 LET I$=INKEY$
   370 IF CODE I$<29 OR CODE I$>36 THEN GOTO 350
   375 PRINT AT P2+P2+2,1;"¯"
   380 LET P2=CODE I$-28
   390 PRINT AT P2+P2+2,1;"«"
   410 IF C$(P2,P1)="0" THEN GOSUB 5000
   411 PRINT AT P2+P2+2,1;"¯"
   412 IF C$(P2,P1)="0" THEN GOTO 240
   415 PRINT AT P2+P2+3,P1+P1;C$(P2,P1)
   420 PRINT AT 3,P1+P1+1;"°"
   430 PRINT AT P2+P2+2,1;"¯"
   435 LET Q1=1
   440 PRINT AT 1,0;;"2ND TILE COLUMN,a-o. THEN ENTER."
   445 PRINT AT 3,Q1+Q1+1;"¬"
   450 IF INKEY$="" THEN GOTO 450
   460 LET I$=INKEY$
   470 IF CODE I$<38 OR CODE I$>52 THEN GOTO 450
   475 PRINT AT 3,Q1+Q1+1;"°"
   480 LET Q1=CODE I$-37
   490 PRINT AT 3,Q1+Q1+1;"¬"
   530 LET Q2=1
   540 PRINT AT 1,0;"2ND TILE ROW,˜-Ÿ. THEN ENTER.   "
   545 PRINT AT Q2+Q2+2,1;"«"
   550 IF INKEY$="" THEN GOTO 550
   560 LET I$=INKEY$
   570 IF CODE I$<29 OR CODE I$>36 THEN GOTO 550
   575 PRINT AT Q2+Q2+2,1;"¯"
   580 LET Q2=CODE I$-28
   590 PRINT AT Q2+Q2+2,1;"«"
   610 IF C$(Q2,Q1)="0" THEN GOSUB 3000
   620 PRINT AT Q2+Q2+2,1;"¯"
   820 IF C$(Q2,Q1)="0" THEN GOTO 440
   830 IF Q2=P2 AND Q1=P1 THEN GOSUB 4000
   840 IF Q2=P2 AND Q1=P1 THEN PAUSE 100
   850 IF Q2=P2 AND Q1=P1 THEN GOTO 440
   860 PRINT AT 3,Q1+Q1+1;"°"
   870 PRINT AT Q2+Q2+3,Q1+Q1;C$(Q2,Q1)
   880 IF C$(P2,P1)=C$(Q2,Q1) THEN GOSUB 1000
   890 IF C$(P2,P1)<>C$(Q2,Q1) THEN GOSUB 2000
   900 GOTO 240
  1000 LET C$(P2,P1)="0"
  1010 LET C$(Q2,Q1)="0"
  1020 LET S=S+1
  1030 PRINT AT 21,22;"MATCHES ";S
  1040 IF S=60 THEN STOP 
  1050 RETURN 
  2000 LET F=F+1
  2002 PRINT AT 21,0;F;" FAILS"
  2010 PRINT AT 21,0;F;" FAILS"
  2020 PAUSE 70
  2030 PRINT AT Q2+Q2+3,Q1+Q1;"?"
  2040 PRINT AT P2+P2+3,P1+P1;"?"
  2900 RETURN 
  3000 PRINT AT 1,0;"you«already«matched«that«one"
  3010 PAUSE 70
  3020 RETURN 
  4000 PRINT AT 1,0;"’that«tile«is«already«opened’"
  4010 PAUSE 70
  4020 RETURN 
  5000 PRINT AT 1,0;"you«already«matched«that«one"
  5010 PAUSE 70
  5020 RETURN 
  9060 FOR I=1 TO 15
  9070 FOR N=1 TO 8
  9080 IF C$(N,I)<>"0" THEN PRINT AT N+N+3,I+I;C$(N,I)
  9090 NEXT N
  9100 NEXT I
  9260 FOR I=1 TO 15
  9270 FOR N=1 TO 8
  9280 IF C$(N,I)<>"0" THEN PRINT AT N+N+3,I+I;"?"
  9290 NEXT N
  9300 NEXT I
  9400 RETURN 
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
XavSnap
Posts: 1938
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Ridiculous MemorieZ

Post by XavSnap »

Code: Select all

    20 PRINT AT 3,1;"°A°B°C°D°E°F°G°H°I°J°K°L°M°N°O°";
    30 FOR I=1 TO 8
    40 PRINT"¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯";I;"° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °";
    70 NEXT I
    80 PRINT"¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸"

Code: Select all

    90 LET C=0
   100 FOR I=1 TO 60
   105 LET C=C+1
   107 IF C<=6 OR C=15 OR (C>134 AND C<139) THEN GOTO 105
   120 IF C=28 THEN LET C=134
   140 LET A$(I)=CHR$ C
   145 PRINT AT 1,27;A$(I)
   160 NEXT I
Another multidimensional array, can't help: it's the 'faster' way to fill it:

Code: Select all

   172 LET C=INT ((RND*8)+1)
   173 LET D=INT ((RND*15)+1)
   174 IF C$(C,D)<>" " THEN GOTO 172
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
sanello
Posts: 100
Joined: Sat Jul 23, 2022 9:26 pm

Re: Ridiculous MemorieZ

Post by sanello »

Here it is compiled. It's bigger and slower I think! HA! I changed stuff a bit to use a numeric array instead of a string array so mcoder could handle it. Those changes improved the speed in basic but not compiled. Over twice as big! Here they are straight basic and compiled.
memoriez2.P
(4.12 KiB) Downloaded 80 times
CompiledMemoriez.P
(9.21 KiB) Downloaded 75 times
-sanello
Moggy
Posts: 3180
Joined: Wed Jun 18, 2008 2:00 pm

Re: Ridiculous MemorieZ

Post by Moggy »

Forget the compiler it's more trouble than it's worth. Any speed up of normal BASIC can be done in the emulator or with the X2 ROM on real zeddy.
User avatar
XavSnap
Posts: 1938
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Ridiculous MemorieZ

Post by XavSnap »

:o

Only 26 seconds !

15 more to set C$(8,5)... we had to change all the program routines...
Multidimensional variable don't suit in such game...


Same optimization: viewtopic.php?p=47939#p47939

Code: Select all

   172 LET C=INT ((RND*8)+1)
   173 LET D=INT ((RND*15)+1)
   174 IF C$(C,D)<>" " THEN GOTO 172
To avoid picking up several empty values (more 150 times at the end!)

Code: Select all

     1 PRINT AT 0,6;"ridiculous«memoriez"
     5 RAND 
    10 DIM A$(60)
    15 DIM C$(8,15)
    16 LET S=0
    17 LET F=0
    19 LET R=1
    20 PRINT AT 3,1;"°A°B°C°D°E°F°G°H°I°J°K°L°M°N°O°";
    30 FOR I=1 TO 8
    40 PRINT"¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯¸¯ ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °";
    70 NEXT I
    80 PRINT"¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸"
    85 PRINT AT 5,0;"1";TAB 0;"¸";TAB 0;"2";TAB 0;"¸";TAB 0;"3";TAB 0;"¸";TAB 0;"4";TAB 0;"¸";TAB 0;"5";TAB 0;"¸";TAB 0;"6";TAB 0;"¸";TAB 0;"7";TAB 0;"¸";TAB 0;"8";AT 1,5;"GENERATING CHARACTERS ";

    90 LET C=0
   100 FOR I=1 TO 60
   105 LET C=C+1
   110 IF C<=6 OR C=15 OR (C>134 AND C<139) THEN GOTO 105
   115 IF C=28 THEN LET C=134
   120 LET A$(I)=CHR$ C
   125 PRINT AT 1,27;A$(I)
   130 NEXT I



140 PRINT AT 1,5;"     SHUFFLING...      "

145 DIM B$(120)
#ADD BOTH MATRIX IN B$ IN NATURAL ORDER
150 LET B$=A$+A$

#TARGET D$ VARIABLE TO HOST RANDOMIZED VALUES
152 DIM D$(120)
154 LET BTOP=120

156 FOR Z=1 TO 120
158 LET RD=INT (RND*BTOP)+1
160 LET D$(Z)=B$(RD)
162 IF RD<>BTOP THEN LET B$(RD)=B$(BTOP)
164 LET BTOP=BTOP-1
166 NEXT Z

168 PRINT AT 1,1;"SETTING GAME BOARD. MAYBE NAP?";

170 FOR I=0 TO 7
172  FOR N=1 TO 15
174   LET C$(I+1,N)=D$(I*15+N)
176   PRINT AT (I+1)*2+3,N+N;"?"
178  NEXT N
180 NEXT I
Last edited by XavSnap on Sun Aug 14, 2022 12:50 am, edited 1 time in total.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
sanello
Posts: 100
Joined: Sat Jul 23, 2022 9:26 pm

Re: Ridiculous MemorieZ

Post by sanello »

Not enough faster to change it. Not showing any progress makes it even more annoying. I'm fine with it the way it is I guess. It is what it is. Would have loved it in 1983. Game play is fast enough. Even had to slow it down. :D I think the best way to speed it up if I decide to is to break up the grid in 4 parts, but not concurrently (so not in quadrants) so it appears more random.
-sanello
User avatar
XavSnap
Posts: 1938
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Ridiculous MemorieZ

Post by XavSnap »

:evil:

26 vs 74 seconds...

I don't plan to rewrite the game.
Attachments
MEMORYZOP.P
(4.31 KiB) Downloaded 73 times
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
sanello
Posts: 100
Joined: Sat Jul 23, 2022 9:26 pm

Re: Ridiculous MemorieZ

Post by sanello »

Good, I am going to get rid of the cheat and add the obligatory play again question. If you would be a person who wants to play such a game it will take a good long time to finish it, so I don't think the current set up and load time would be much of a deterrent anyway.
memoriez.P
(4.1 KiB) Downloaded 85 times
memoriez.P
(4.1 KiB) Downloaded 85 times
Attachments
memoriez.zip
(62.44 KiB) Downloaded 77 times
-sanello
Post Reply