Does anyone remember Minesweeper?

Discuss ZX Spectrum Next Games, Tools and more.
User avatar
Eratosthenes
Posts: 320
Joined: Mon May 29, 2017 8:17 pm

Does anyone remember Minesweeper?

Postby Eratosthenes » Sun Jan 31, 2021 8:13 pm

Today I fiddled around a little with the Next. As usual it was a tiny exercise in Next BASIC.

The result was a small program called DEINS
DEINS.zip
Source Code And Screenshot
(137.33 KiB) Downloaded 73 times
DEINS is a program similar to Minesweeper.
deins01.jpg
deins01.jpg (141.16 KiB) Viewed 3027 times
The aim of the game is to locate all mines that are randomly distributed on the minefield and to mark them with a flag.
To do so, use the arrow keys to move the cursor (the blinking square) to a position in the field and examine it with the "A" key or mark it with the "F" key if you think that there is a mine at that point. After "examining" a field, the number of mines in the area is displayed.

If there are no mines, ie "0" mines around, your tiny Auto-Mine-Detector enters the game. He wizzles around and examines all completely free fields in the vicinity. The little helper is very ambitious, but not tired of life. Accordingly, he stops working as soon as it is not 100% sure not to step on a mine. - This is where you come back in! :lol:

By the way: If you press "A" at a position where there is a mine, the game is over (or should be (see below)).

If somebody tries the game: Have a lot of fun... :mrgreen:


Miscellaneous - Hints And Stuff
After loading and starting with RUN, press the "N" key and specify the dimensions of the minefield and the number of mines it contains.
The minefield can have a maximum of 30 by 20 fields. The specified number of mines is the "maximum number" of mines on the minefield. It maybe less.

To get started just poke around by pressing "A" at a random position. If you are unlucky this may lead to sudden death but if you hit an empty field your tiny helper will do some work for you... :roll:

The difficulty varies depending on the size of the minefield and the number of mines.

If you want to watch the next calculating and be presented with a minefield that is not too difficult, is

Code: Select all

Width: 30 Height 20 Mines 50
a good option.

Code: Select all

Width: 30 Height 20 Mines 30
is for lazy people ... :mrgreen:

Not a good idea right now

Code: Select all

Width: 30 Height 20 Mines 1
This leads to an "Out Of Memory" message. - 8-biters didn't just have advantages ... 8-)

Restrictions And Known Bugs
  • Entering crap when setting the game parameters crashes the program
  • Analysing may lead to strange behaviour when a field has been set to "Empty"
  • Currently the game does not stop when you hit a mine with the "A" key.
  • The end of the game is not yet checked if all mines have been marked successfully.
Game Controls
Cursor keys: Moves the cursor in the field

A: Analyse the minefield at the position where the cursor is -> You can die here ;-)
Q: Set flag at cursor position. Used to mark a mine.
E: Reset/empty the status of the field at the cursor position.

N: New game
H: Show HowTo
C: Redraw minefield (test function)
R: Redraw minefield without colors (test function)

Q: Quit

Alcoholics Anonymous
Posts: 777
Joined: Mon May 29, 2017 7:00 pm

Re: Does anyone remember Minesweeper?

Postby Alcoholics Anonymous » Wed Feb 10, 2021 5:12 am

Nice I will give it a go in the next few days. I guess you've got a recursive visit in there so that you run out of memory for the 1 mine case :)

User avatar
Eratosthenes
Posts: 320
Joined: Mon May 29, 2017 8:17 pm

Re: Does anyone remember Minesweeper?

Postby Eratosthenes » Fri Feb 12, 2021 2:41 pm

Yes. And the stack is really small when using Next BASIC. :roll:

As I didn't manage to use only integer variables in the routine it becomes even worse...

P.S.: As I'm using a PS/2 keyboard on my Next I'm not sure if the key mapping is fine for the original keyboard layout.

I think

QAOP for Up/Down/Left/Right + comfortable keys for the other functions could be a better solution as the cursor keys + the ones I have chosen.

Any suggestions?

P^2.S.: As somebody in a german forum asked for a version for the ZX-Uno, there is an other - very similar - Game running on the 48k and ZX-Uno in 48k Mode. I think it will also run on the Spectrum Next.

See here: Bahrnei The Bear

In this variant you just have to cross the minefield.

Controls:
QAOP: Cursor Position
N: Normal mode (the game starts in HARDCORE mode)
M: Dummy mode
X: To end the game

AndyCalling
Posts: 28
Joined: Thu Feb 27, 2020 9:35 pm

Re: Does anyone remember Minesweeper?

Postby AndyCalling » Mon Feb 22, 2021 10:37 pm

Ah, Minesweeper, that's one of those modern Windows games isn't it?

User avatar
Eratosthenes
Posts: 320
Joined: Mon May 29, 2017 8:17 pm

Re: Does anyone remember Minesweeper?

Postby Eratosthenes » Tue Feb 23, 2021 10:02 pm

@AndyCalling - Even though it came up much earlier (I know the game from a HP pocket calculator) I think Windows made it being well known :D

User avatar
Timbucus
Posts: 287
Joined: Tue May 30, 2017 7:43 pm

Re: Does anyone remember Minesweeper?

Postby Timbucus » Wed Feb 24, 2021 10:00 pm

Nice one - I love these sorts of games...
I'm Infinite Imaginations when not in work... PAWS for thought.

User avatar
Eratosthenes
Posts: 320
Joined: Mon May 29, 2017 8:17 pm

Re: Does anyone remember Minesweeper?

Postby Eratosthenes » Sun Feb 28, 2021 3:05 pm

Thanks a lot!

Here's a different one that was developed on a 48k and as it's not is 100% pure BASIC it runs fine and should be playable on a 3.5MHz device.

The goal of the game is to move from the top left to the bottom right of the screen without hitting a mine. As the mines are placed randomly not every run can be solved. - In the default (HARDCORE-) mode the game is really difficult. The most common mode should be "Normal Mode". ("Dummy Mode" is for testing purpose if any errors occure.)

Of course it has a loading image. Even though this image has absolutely nothing to do with the game I think a game must have a "SCREEN$"! And this one is cute... :roll: - If you are running it on the Next, load it with tape simulation mode ON and at 3.5MHz. Please let me know if you've had any idea what is shown on the screen after 2/3 of the SCREEN$ has been loaded... :mrgreen:

By pressing "i" after loading a small introduction is shown, describing the controls.

If you exit, you can restart without reloading by the command "RUN 900"...

Here the .tap file:
BAHRNEI.zip
(9.46 KiB) Downloaded 69 times

Sorry for the "Bytes: code" text. I've forgotten that I have to "work around this" when loading from tape. Maybe I'll fix this in a later version...

Have a lot of fun. - I will have as my "Moped Saison" starts tomorrow... :twisted:

MfL der Eratosthenes

P.S.: Because the random generator of the Next seems to work differently as the one of the original Spectrum the game most of the runs of the game are unsolveable when Next mode is used. Prerfere to use 48k Mode or USR0 mode when loading the .tap.


Who is online

Users browsing this forum: No registered users and 4 guests