Minesweeper for Commodore 64 and VIC-20
Author RunStop64
Genre Puzzle
Download and itch.io:-
https://runstop64.itch.io/minesweeper-f ... and-vic-20
Minesweeper for Commodore 64 and VIC-20
Moderator: Moderators
-
- Vic 20 Afficionado
- Posts: 350
- Joined: Tue Apr 14, 2009 8:15 am
- Website: http://wimbasic.webs.com
- Location: Netherlands
- Occupation: farmer
Re: Minesweeper for Commodore 64 and VIC-20
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.
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.
Last edited by wimoos on Sun Sep 17, 2023 8:18 am, edited 34 times in total.
VICE; selfwritten 65asmgen; tasm; maintainer of WimBasic
Re: Minesweeper for Commodore 64 and VIC-20
Thats great nice of you to share this
- javierglez
- Vic 20 Hobbyist
- Posts: 107
- Joined: Sat Jun 03, 2017 3:33 pm
Re: Minesweeper for Commodore 64 and VIC-20
A redefined character set would allow larger maps
- MrSterlingBS
- Vic 20 Enthusiast
- Posts: 178
- Joined: Tue Jan 31, 2023 2:56 am
- Location: Germany,Braunschweig
Re: Minesweeper for Commodore 64 and VIC-20
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.
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.