Page 1 of 1

Minesweeper for Commodore 64 and VIC-20

Posted: Thu Feb 09, 2023 3:54 pm
by Rich
Minesweeper for Commodore 64 and VIC-20

Author RunStop64
Genre Puzzle

Image

Download and itch.io:-
https://runstop64.itch.io/minesweeper-f ... and-vic-20

Re: Minesweeper for Commodore 64 and VIC-20

Posted: Mon Mar 13, 2023 5:59 am
by wimoos
Hi Rich,

Great to have a Minesweeper game on the VIC !

Now, I converted it to a WimBasic version. That makes it no longer dependant on the memory configuration. I brought it back to 36 lines, 1682 bytes. Also, I brought down runtime memory consumption. It can now play in a stock VIC-20 with WimBasic, easily. Even with a 9*10 grid.
More importantly, I brought the elapse time of the 'thinking'-part back by more than 60% (9x10 grid with 1 mine takes less than 18 seconds in the WimBasic version versus over 50 seconds in the original version).
For amusement during waiting, I animated the analysis so you can follow what's happening. And, check for a win is now faster.

I took the liberty of including the WimBasic version in https://home.kpn.nl/oost4231/wb_samples.zip

In the WimBasic version I make use of only one matrix array. Each element corresponds to a cell in the grid and can have one of five states, where
bit 0 indicates "mine", bit 1 indicates "flag", bit 2 indicates "uncovered". With bit 2 set, bits 1 and 0 have no meaning anymore.
The number of adjacent mines to a cell is only on display and not in the matrix array.

The cell-state information could also be put into the "shadow-color" memory because it needs no more than 3 bits per cell. But programming around that is a bit of a hassle.
A string is used to hold the workload for the 'thinking' part. Each coordinate is held there through CHR$() and retrieved through ASC(),so the maximum string length needed is 180 characters. For a grid larger than 127 cells you could fold X and Y together, but only as long as the number of cells in the grid is less than 256.

Benefits of using WimBasic for this game are the powerful commands and functions:
- ERASE
- WHILE/WEND/QUIT
- IF/THEN/ELSE
- ODD(), XOR(), MAX(), MIN()
- COKE
- SuperNumbers
and more.

Regards,

Wim.

Re: Minesweeper for Commodore 64 and VIC-20

Posted: Mon Mar 13, 2023 11:23 am
by Rich
Thats great nice of you to share this :)

Re: Minesweeper for Commodore 64 and VIC-20

Posted: Tue Mar 14, 2023 11:13 am
by javierglez
A redefined character set would allow larger maps
2023-03-14.png

Re: Minesweeper for Commodore 64 and VIC-20

Posted: Wed Mar 15, 2023 6:19 am
by MrSterlingBS
Dear Rich,

very good work. Thank you for that.

I still have some ideas to prepare the game as a "Denial" forum project.

1. Startscreen with some good grafik (Minigrafik) ? Is there a graphics specialist here?
2. Startmusic with the 10bit sound from another post. Can we hire Hans Zimmer?
3. Digital Sound, with the voice recorder. has someone a solution with the Vice Emulator?
4. ...

Yes, VIC can.

Greetings from Germany
Sven

PS: Sorry, I can not help. My knowledge is to low.