Author Topic: Letter Memory  (Read 7051 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Letter Memory
« on: July 20, 2019, 09:15:27 pm »
A simple little game to play until Ken gets his next thing going. :)

Code: QB64: [Select]
  1. DEFINT A-Z
  2. _TITLE "Letter Memory Remake" '  by bplus started 2019-06-09 mod structure of first game
  3.  
  4. ' Keep clicking boxes until all the letter pairs are revealed.
  5.  
  6. TYPE XYtype
  7.     X AS INTEGER
  8.     Y AS INTEGER
  9.  
  10. TYPE LetterBox
  11.     XY AS XYtype
  12.     Reveal AS INTEGER ' 0, -1 revealed when matched, stay revealed
  13.     Letter AS STRING '  letter to match
  14.  
  15. CONST xmax = 400, ymax = 450, boxSize = 50, xoffLetter = (boxSize - 8) / 2, yoffLetter = (boxSize - 16) / 2 ' for letters in box
  16. SCREEN _NEWIMAGE(xmax, ymax, 32)
  17. _SCREENMOVE 360, 60
  18. REDIM SHARED LB(1 TO 1) AS LetterBox, nBoxes 'so setup can set values to these globals
  19. REDIM SHARED shuffle(1 TO 1) AS STRING 'container of letter pairs to shuffle and distrbute before each round
  20. DIM SHARED nRevealed, b1Index, b2Index, tStart!, s$
  21. DIM i
  22. setUpGame
  23.     tStart! = TIMER(.001)
  24.     initRound
  25.     CLS
  26.     updateScreen
  27.     DO
  28.         i = getBoxIndex
  29.         IF i THEN
  30.             IF b1Index = 0 THEN 'first reveal box
  31.                 IF LB(i).Reveal <> -1 THEN b1Index = i: LB(i).Reveal = -1
  32.             ELSE '2nd reveal box
  33.                 IF LB(i).Reveal <> -1 THEN b2Index = i: LB(i).Reveal = -1
  34.             END IF
  35.             updateScreen
  36.         END IF
  37.         IF b2Index <> 0 THEN 'check match, if they do leave them revealed
  38.             IF LB(b1Index).Letter <> LB(b2Index).Letter THEN 'no match
  39.                 _DELAY 1
  40.                 LB(b1Index).Reveal = 0: LB(b2Index).Reveal = 0
  41.                 nRevealed = nRevealed - 2 'when complete = number of squares then done
  42.                 updateScreen
  43.             END IF
  44.             b1Index = 0: b2Index = 0 'clear box clicks
  45.         END IF
  46.         _LIMIT 60
  47.     LOOP UNTIL nRevealed = nBoxes
  48.     COLOR &HFFDDDDDD, &HFF000000
  49.     s$ = "Completed in" + STR$(INT(TIMER(.001) - tStart!)) + " secs."
  50.     LOCATE 2, (xmax / 8 - LEN(s$)) / 2: PRINT s$
  51.     _DELAY 2
  52.  
  53. FUNCTION getBoxIndex
  54.     DIM m, mx, my, mb, i
  55.     mb = _MOUSEBUTTON(1) '            left button down
  56.     IF mb THEN '                      get last place mouse button was down
  57.         WHILE mb '                    wait for mouse button release as a "click"
  58.             m = _MOUSEINPUT: mb = _MOUSEBUTTON(1): mx = _MOUSEX: my = _MOUSEY
  59.         WEND
  60.         FOR i = 1 TO nBoxes '         now find which box was clicked
  61.             IF mx > LB(i).XY.X AND mx < LB(i).XY.X + boxSize THEN
  62.                 IF my > LB(i).XY.Y AND my < LB(i).XY.Y + boxSize THEN
  63.                     getBoxIndex = i: EXIT FUNCTION
  64.                 END IF
  65.             END IF
  66.         NEXT
  67.     END IF
  68.  
  69. SUB updateScreen
  70.     DIM i
  71.     nRevealed = 0 '              (shared) detect how many boxes are revealed
  72.     FOR i = 1 TO nBoxes
  73.         LINE (LB(i).XY.X, LB(i).XY.Y)-STEP(boxSize, boxSize), &HFFFF0000, BF
  74.         IF LB(i).Reveal = -1 THEN
  75.             COLOR &HFFDDDDDD, &HFFFF0000
  76.             _PRINTSTRING (LB(i).XY.X + xoffLetter, LB(i).XY.Y + yoffLetter), LB(i).Letter
  77.             nRevealed = nRevealed + 1
  78.         END IF
  79.     NEXT
  80.  
  81. SUB initRound 'reassign letters and hide them all
  82.     DIM i, r
  83.     FOR i = nBoxes TO 2 STEP -1 ' shuffle stuff in array
  84.         r = INT(i * RND) + 1
  85.         SWAP shuffle(i), shuffle(r)
  86.     NEXT
  87.     FOR i = 1 TO nBoxes '       reset or reassign values
  88.         LB(i).Letter = shuffle(i): LB(i).Reveal = 0
  89.     NEXT
  90.  
  91. SUB setUpGame
  92.     DIM i, x, y '(                main) CONST xmax = 400, ymax = 450, boxSize = 50
  93.     CONST xBoxes = 6, yBoxes = 4 '           Board N x M  boxes across, boxes down
  94.     nBoxes = xBoxes * yBoxes '               Total boxes (shared)
  95.     REDIM LB(1 TO nBoxes) AS LetterBox '     ready to rec data (shared)
  96.     'CONST boxSize = 50                '     Screen drawing topleft box locations
  97.     CONST spacer = 5 '                       for XY calc
  98.     CONST xoffset = INT((xmax - boxSize * xBoxes - spacer * (xBoxes - 1)) / 2)
  99.     CONST yoffset = INT((ymax - boxSize * yBoxes - spacer * (yBoxes - 1)) / 2)
  100.     CONST sq = boxSize + spacer '            for XY calc
  101.     FOR y = 1 TO yBoxes '                    set screen XY locations for all boxes
  102.         FOR x = 1 TO xBoxes
  103.             i = i + 1
  104.             LB(i).XY.X = xoffset + (x - 1) * sq
  105.             LB(i).XY.Y = yoffset + (y - 1) * sq
  106.         NEXT
  107.     NEXT
  108.     REDIM shuffle(1 TO nBoxes) AS STRING ' load shuffle array for shuffling later (shared)
  109.     CONST letterPairs = "AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZ11223344556677889900"
  110.     FOR i = 1 TO nBoxes
  111.         shuffle(i) = MID$(letterPairs, i, 1)
  112.     NEXT
  113.  

EDIT: updateScreen xoff, yoff made into xoffLetter, yoffLetter CONST's, as not efficient to recalc those for every update.
« Last Edit: July 20, 2019, 10:44:42 pm by bplus »

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Letter Memory
« Reply #1 on: July 20, 2019, 11:39:44 pm »
Wow B+ nice game! Wouldn't help me that good though because my short term memory has been super bad since my head injury decades ago lol. I think I'm going to convert an old ASIC game called Alphabet Invaders to QB64. :)
« Last Edit: July 20, 2019, 11:44:04 pm by SierraKen »

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: Letter Memory
« Reply #2 on: July 21, 2019, 12:19:12 am »
Cool game Bplus!

Screenshot_1.png
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Letter Memory
« Reply #3 on: July 21, 2019, 12:42:07 am »
Nice game. Bit of a workout for My grey matter as well...

Does it come in blue?  lol

J
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Letter Memory
« Reply #4 on: July 21, 2019, 09:09:51 am »
Thanks guys, should be easy to modify colors, add more buttons for letters and digit pairs...  I don't know about pointy ears though. ;-))

Well what do you know!?
 
Pointy Ears.PNG
« Last Edit: July 21, 2019, 09:42:26 am by bplus »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Letter Memory
« Reply #5 on: July 21, 2019, 12:12:55 pm »
I'll stick with Republican Red!

Easy game...

 
Letter-Memory.jpg


Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Letter Memory
« Reply #6 on: July 21, 2019, 01:09:38 pm »
Cool Bplus!
I find it very fine so that I think to add a simple mod while the ideas are flourishing!

try it please!
Code: QB64: [Select]
  1. DEFINT A-Z
  2. _TITLE "Letter Memory Remake" '  by bplus started 2019-06-09 mod structure of first game
  3.  
  4. ' Keep clicking boxes until all the letter pairs are revealed.
  5.  
  6. TYPE XYtype
  7.     X AS INTEGER
  8.     Y AS INTEGER
  9.  
  10. TYPE LetterBox
  11.     XY AS XYtype
  12.     Reveal AS INTEGER ' 0, -1 revealed when matched, stay revealed
  13.     Letter AS STRING '  letter to match
  14.  
  15. CONST xmax = 400, ymax = 450, boxSize = 50, xoffLetter = (boxSize - 8) / 2, yoffLetter = (boxSize - 16) / 2 ' for letters in box
  16.  
  17. CONST Topten = "TopTen.SAV", Bonus = 100 ' <---new line TDB
  18. SCREEN _NEWIMAGE(xmax, ymax, 32)
  19. _SCREENMOVE 360, 60
  20. REDIM SHARED LB(1 TO 1) AS LetterBox, nBoxes 'so setup can set values to these globals
  21. REDIM SHARED shuffle(1 TO 1) AS STRING 'container of letter pairs to shuffle and distrbute before each round
  22. DIM SHARED nRevealed, b1Index, b2Index, tStart!, s$
  23. DIM SHARED Score AS LONG ' <---new line TDB
  24. DIM i
  25. setUpGame
  26.  
  27.     tStart! = TIMER(.001)
  28.     initRound
  29.     CLS
  30.     updateScreen
  31.     DO
  32.         i = getBoxIndex
  33.         IF i THEN
  34.             IF b1Index = 0 THEN 'first reveal box
  35.                 IF LB(i).Reveal <> -1 THEN b1Index = i: LB(i).Reveal = -1
  36.             ELSE '2nd reveal box
  37.                 IF LB(i).Reveal <> -1 THEN b2Index = i: LB(i).Reveal = -1
  38.             END IF
  39.             updateScreen
  40.         END IF
  41.         IF b2Index <> 0 THEN 'check match, if they do leave them revealed
  42.             IF LB(b1Index).Letter <> LB(b2Index).Letter THEN 'no match
  43.                 _DELAY 1
  44.                 LB(b1Index).Reveal = 0: LB(b2Index).Reveal = 0
  45.                 nRevealed = nRevealed - 2 'when complete = number of squares then done
  46.                 updateScreen
  47.  
  48.                 Score = Score + Bonus
  49.             END IF
  50.             b1Index = 0: b2Index = 0 'clear box clicks
  51.         END IF
  52.         _LIMIT 60
  53.     LOOP UNTIL nRevealed = nBoxes
  54.     COLOR &HFFDDDDDD, &HFF000000
  55.     ' qua calcola il tempo come punteggio aggiuntivo
  56.     s$ = "Completed in" + STR$(INT(TIMER(.001) - tStart!)) + " secs."
  57.     LOCATE 2, (xmax / 8 - LEN(s$)) / 2: PRINT s$
  58.     _DELAY 2
  59.  
  60. FUNCTION getBoxIndex
  61.     DIM m, mx, my, mb, i
  62.     mb = _MOUSEBUTTON(1) '            left button down
  63.     IF mb THEN '                      get last place mouse button was down
  64.         WHILE mb '                    wait for mouse button release as a "click"
  65.             m = _MOUSEINPUT: mb = _MOUSEBUTTON(1): mx = _MOUSEX: my = _MOUSEY
  66.         WEND
  67.         FOR i = 1 TO nBoxes '         now find which box was clicked
  68.             IF mx > LB(i).XY.X AND mx < LB(i).XY.X + boxSize THEN
  69.                 IF my > LB(i).XY.Y AND my < LB(i).XY.Y + boxSize THEN
  70.                     getBoxIndex = i: EXIT FUNCTION
  71.                 END IF
  72.             END IF
  73.         NEXT
  74.         ' if no nBoxe clicked , user maybe clicks on menubar
  75.         DIM done, High$ ' <---new lines TDB
  76.         IF my < 16 THEN
  77.             SELECT CASE mx
  78.                 CASE 55 TO 85
  79.                     ' END
  80.                     COLOR , &HFF0000FF
  81.                     _PRINTSTRING ((xmax - 60) / 2, 400), "QUIT?"
  82.                     _PRINTSTRING ((xmax - 110) / 2, 430), "[YES]  [NO]"
  83.                     done = 0
  84.                     WHILE done = 0
  85.                         done = LEN(INKEY$)
  86.                         IF _MOUSEINPUT THEN
  87.                             IF _MOUSEBUTTON(1) OR _MOUSEBUTTON(2) THEN done = 1
  88.                             mx = _MOUSEX: my = _MOUSEY
  89.                         END IF
  90.                     WEND
  91.                     IF my >= 430 AND my <= 450 THEN
  92.                         IF mx <= 188 AND mx >= 130 THEN
  93.                             ' yes  Quit
  94.                             COLOR , &HFF000000
  95.                             CLS
  96.                             DIM NAMES AS STRING * 8
  97.                             _PRINTSTRING ((xmax - 110) / 2, 380), "ENTER NAME"
  98.                             INPUT NAMES
  99.                             OPEN Topten FOR APPEND AS #1
  100.                             PRINT #1, NAMES + STR$(Score)
  101.                             CLOSE #1
  102.                             'Topten
  103.                             COLOR , &HFF000000
  104.                             CLS
  105.                             IF NOT _FILEEXISTS(Topten) THEN
  106.                                 _PRINTSTRING ((xmax - 160) / 2, 100), "File " + Topten + " corrupted"
  107.                             ELSE
  108.                                 COLOR , &HFF0000FF
  109.                                 LOCATE , 20: PRINT "HIGHSCORES"
  110.                                 LOCATE , 20: PRINT " TOP TEN "
  111.                                 PRINT: PRINT
  112.                                 OPEN Topten FOR INPUT AS #1
  113.                                 WHILE NOT EOF(1)
  114.                                     INPUT #1, High$
  115.                                     LOCATE , 15
  116.                                     PRINT High$
  117.                                     _DELAY .5
  118.                                 WEND
  119.                                 CLOSE #1
  120.                             END IF
  121.  
  122.                             SLEEP 4
  123.                             END
  124.                         ELSE
  125.                             COLOR , &HFF000000
  126.                             CLS
  127.                             updateScreen
  128.                         END IF
  129.                     END IF
  130.  
  131.                 CASE 110 TO 158
  132.                     'pause
  133.                     COLOR , &HFF0000FF
  134.                     _PRINTSTRING ((xmax - 60) / 2, 400), "PAUSED"
  135.                     done = 0
  136.                     WHILE done = 0
  137.                         done = LEN(INKEY$)
  138.                         IF _MOUSEINPUT THEN
  139.                             IF _MOUSEBUTTON(1) OR _MOUSEBUTTON(2) THEN done = 1
  140.                         END IF
  141.                     WEND
  142.                     COLOR , &HFF000000
  143.                     CLS
  144.                     updateScreen
  145.                 CASE 180 TO 238
  146.                     'Topten
  147.                     COLOR , &HFF000000
  148.                     CLS
  149.                     IF NOT _FILEEXISTS(Topten) THEN
  150.                         _PRINTSTRING ((xmax - 160) / 2, 100), "File " + Topten + " corrupted"
  151.                     ELSE
  152.                         COLOR , &HFF0000FF
  153.                         LOCATE , 20: PRINT "HIGHSCORES"
  154.                         LOCATE , 20: PRINT " TOP TEN "
  155.                         PRINT: PRINT
  156.                         OPEN Topten FOR INPUT AS #1
  157.                         WHILE NOT EOF(1)
  158.                             INPUT #1, High$
  159.                             LOCATE , 15
  160.                             PRINT High$
  161.                             _DELAY .5
  162.                         WEND
  163.                         CLOSE #1
  164.                     END IF
  165.                     done = 0
  166.                     WHILE done = 0
  167.                         done = LEN(INKEY$)
  168.                         IF _MOUSEINPUT THEN
  169.                             IF _MOUSEBUTTON(1) OR _MOUSEBUTTON(2) THEN done = 1
  170.                         END IF
  171.                     WEND
  172.                     COLOR , &HFF000000
  173.                     CLS
  174.                     updateScreen
  175.                 CASE 250 TO 294
  176.                     ' Help
  177.                     COLOR , &HFF000000
  178.                     CLS
  179.                     COLOR , &HFF0000FF
  180.                     _PRINTSTRING ((xmax - 60) / 2, 100), "Help:"
  181.                     _PRINTSTRING (5, 120), "-find the matched letters"
  182.                     _PRINTSTRING (5, 140), "-more matches more scores"
  183.                     _PRINTSTRING ((xmax - 60) / 2, 160), "Menu:"
  184.                     _PRINTSTRING (5, 180), "END = quit, Pause = wait, Topten = HighScores"
  185.                     _PRINTSTRING (5, 200), "Help = this screen"
  186.                     done = 0
  187.                     WHILE done = 0
  188.                         done = LEN(INKEY$)
  189.                         IF _MOUSEINPUT THEN
  190.                             IF _MOUSEBUTTON(1) OR _MOUSEBUTTON(2) THEN done = 1
  191.                         END IF
  192.                     WEND
  193.                     COLOR , &HFF000000
  194.                     CLS
  195.                     updateScreen
  196.                 CASE ELSE
  197.             END SELECT
  198.         END IF
  199.     END IF
  200.  
  201. SUB updateScreen
  202.     DIM i
  203.     nRevealed = 0 '              (shared) detect how many boxes are revealed
  204.     FOR i = 1 TO nBoxes
  205.         LINE (LB(i).XY.X, LB(i).XY.Y)-STEP(boxSize, boxSize), &HFFFF0000, BF
  206.         IF LB(i).Reveal = -1 THEN
  207.             COLOR &HFFDDDDDD, &HFFFF0000
  208.             _PRINTSTRING (LB(i).XY.X + xoffLetter, LB(i).XY.Y + yoffLetter), LB(i).Letter
  209.             nRevealed = nRevealed + 1
  210.         END IF
  211.     NEXT
  212.     '    qua il rigo guida menu
  213.     LINE (1, 1)-(xmax, 15), &HFF0000FF, BF ' <---new lines TDB
  214.     COLOR , &HFF0000FF
  215.     _PRINTSTRING (50, 0), "[END]  [Pause]  [TopTen] [Help] " '55-85  110-158  180-238  250-294
  216.     COLOR &HFFDDDDDD, &HFFFF0000
  217.  
  218.  
  219. SUB initRound 'reassign letters and hide them all
  220.     DIM i, r
  221.     FOR i = nBoxes TO 2 STEP -1 ' shuffle stuff in array
  222.         r = INT(i * RND) + 1
  223.         SWAP shuffle(i), shuffle(r)
  224.     NEXT
  225.     FOR i = 1 TO nBoxes '       reset or reassign values
  226.         LB(i).Letter = shuffle(i): LB(i).Reveal = 0
  227.     NEXT
  228.  
  229. SUB setUpGame
  230.     DIM i, x, y '(                main) CONST xmax = 400, ymax = 450, boxSize = 50
  231.     CONST xBoxes = 6, yBoxes = 4 '           Board N x M  boxes across, boxes down
  232.     nBoxes = xBoxes * yBoxes '               Total boxes (shared)
  233.     REDIM LB(1 TO nBoxes) AS LetterBox '     ready to rec data (shared)
  234.     'CONST boxSize = 50                '     Screen drawing topleft box locations
  235.     CONST spacer = 5 '                       for XY calc
  236.     CONST xoffset = INT((xmax - boxSize * xBoxes - spacer * (xBoxes - 1)) / 2)
  237.     CONST yoffset = INT((ymax - boxSize * yBoxes - spacer * (yBoxes - 1)) / 2)
  238.     CONST sq = boxSize + spacer '            for XY calc
  239.     FOR y = 1 TO yBoxes '                    set screen XY locations for all boxes
  240.         FOR x = 1 TO xBoxes
  241.             i = i + 1
  242.             LB(i).XY.X = xoffset + (x - 1) * sq
  243.             LB(i).XY.Y = yoffset + (y - 1) * sq
  244.         NEXT
  245.     NEXT
  246.     REDIM shuffle(1 TO nBoxes) AS STRING ' load shuffle array for shuffling later (shared)
  247.     CONST letterPairs = "AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZ11223344556677889900"
  248.     FOR i = 1 TO nBoxes
  249.         shuffle(i) = MID$(letterPairs, i, 1)
  250.     NEXT
  251.  
  252.     ' section score TopTen
  253.     Score = 0 ' <---new lines TDB
  254.     IF NOT _FILEEXISTS(Topten) THEN
  255.         OPEN Topten FOR OUTPUT AS #1
  256.         PRINT #1, " 1. SMcNeill... 100000"
  257.         PRINT #1, " 1. Heitor..... 100000"
  258.         PRINT #1, " 1. Bplus...... 100000"
  259.         PRINT #1, " 1. Pete....... 100000"
  260.         PRINT #1, " 1. Petr....... 100000"
  261.         PRINT #1, " 1. Ashish..... 100000"
  262.         PRINT #1, " 1. Rhosigma... 100000"
  263.         PRINT #1, " 1. Qwerkey.... 100000"
  264.         PRINT #1, " 1. _Vince..... 100000"
  265.         PRINT #1, " 1. The Others. 100000"
  266.         CLOSE #1
  267.     END IF
  268.  

fine changing color of back of boxes! It can be another item of the menu!
:-)
Good Playing

@Pete
but do you  use C++ to hacking Bplus code?
O_O  you're Anonymous! https://www.repubblica.it/images/2011/07/18/184150799-e341c968-23d0-4422-ba68-97dc59b84b8a.jpg
https://images2.alphacoders.com/606/thumb-1920-606513.jpg
« Last Edit: July 21, 2019, 01:13:42 pm by TempodiBasic »
Programming isn't difficult, only it's  consuming time and coffee

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Letter Memory
« Reply #7 on: July 21, 2019, 05:47:28 pm »
bplus,

Not exactly the shade of blue I was expecting, but blue none the less... Cool...

Now... about the letters.... How is your ancient Samarian? lol
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Letter Memory
« Reply #8 on: July 21, 2019, 09:33:40 pm »
TempodiBasic, that's quite a mod! longer than the original program that took some time!

I did have in mind a mod myself, not quite Sumarian... :)



Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Letter Memory
« Reply #9 on: July 22, 2019, 08:54:14 am »
Oh. What about Klingon? Vulcan will do in a pinch (no pun intended) but, if you settle for Romulan, your punishment will be to memorise all the Ferengi Laws of Acquisition...
Logic is the beginning of wisdom.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Letter Memory
« Reply #10 on: July 22, 2019, 12:21:31 pm »
Quote
not quite Sumarian... :)
???
Please what do you mean with sumarian?
Sumerian http://www.ilsapere.org/wp-content/uploads/bfi_thumb/sumeri-1-33i7zodpx38ur4jhrymnsw.jpg
or somariano (dummy or donkey) http://2.bp.blogspot.com/-WnfOoV8iYpc/UycT2mfxmsI/AAAAAAAAAY4/ygQu51cLbUw/s1600/donkey-821x1024.jpg
:D

If you like, you can short my mod and make it fine to you  building more SUB and Function at the place of write the same code anywhere, moreover you can use a k-ed position on X an Y for the menu items to click. And a record type to store Topten in file.
Just as you prefer.
;-)
Thanks to give a look.
Programming isn't difficult, only it's  consuming time and coffee

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Letter Memory
« Reply #11 on: July 22, 2019, 12:40:50 pm »
Sumarian, Samarian, there is a difference?

Apparently so: https://www.quora.com/Is-Sumerian-the-same-thing-as-Samaritan... wait that's Samaritans, sa-martians???  :D those we learned about from Bible (the good one) and Ancient Aliens program ;-))

Hi TempodiBasic,

The top ten list is great for games of competition, IMHO not so hot for this little app. For me, scores quickly go down with repetition of play because I start to confuse letters in position 1 or 2 games ago.

The code you started might be generalized so one could add it to any great games program along with a sort to put scores from high to low... wait was that already in there? Also I would score times to complete a board of n matches.
« Last Edit: July 22, 2019, 12:49:33 pm by bplus »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Letter Memory
« Reply #12 on: July 22, 2019, 04:27:51 pm »
about
Quote
Also I would score times to complete a board of n matches.
what weight do you think to give to the time used to complete a level?
do you like a formula as scoreTimeBonus = Premium/timePassed and/ or use scoreTimeBonus as multiplier of total score of the match (that is always the same)?
Programming isn't difficult, only it's  consuming time and coffee

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Letter Memory
« Reply #13 on: July 22, 2019, 05:55:03 pm »
I'm not interested in scoring this game.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: Letter Memory
« Reply #14 on: July 23, 2019, 03:15:24 am »
Cool game, BPlus.   

and...

Nice hack, Pete :-D