|
Mineswepper
|
|
08-03-2009, 08:51 PM
(This post was last modified: 08-03-2009 09:10 PM by drdebcol.)
Post: #1
|
|||
|
|||
|
Mineswepper
Mineswepper is a common Windows Game, many of people know what i am talking about ! You need to mark mines on a matrix field ! There is an interesting assignment. If you have matrix of integers which represent field of mineswepper, you need to mark all fields that are in contact with mine !
Mines are shown as "-1" in matrix and other fields are "0" zeros ! You need to fill those zeros (where needed) with numbers that show with how many mines is that field in contact (maximum is 8) ! Here is a test example : Input : Code: -1 0 0 0Code: -1 1 0 0Code: program mineswepper;Code: # include <iostream>"I dont know with what weapons World War 3 will be fought with, but i know World War 4 will be fought with stones and sticks" - Albert Einstein |
|||
|
08-03-2009, 09:22 PM
Post: #2
|
|||
|
|||
|
RE: Mineswepper
Nice,
So this is the the basic algorithm to a mine sweeper like game and i see your C++ skills are improving greatly! "Character is determined more by the lack of certain experiences than by those one has had." Friedrich Nietzsche |
|||
|
08-03-2009, 09:28 PM
(This post was last modified: 08-03-2009 09:30 PM by drdebcol.)
Post: #3
|
|||
|
|||
|
RE: Mineswepper
Yeah, i think mineswepper windows programmers couldn't make it better than this !
Maybe i should make that game ! Maybe the biggest part of job in that would be making like 100 buttons with empty label which represent fields ! But it can be made easier with dynamic component declaration, i think i have that procedure somewhere ! And also randomization of mines on first click (you know that in the game you can not get a mine in the first click) ! Everything else is easy ! And yeah, i have been doing some C++ lately and i have to learn some libraries too, like "map" or "iterators" ! "I dont know with what weapons World War 3 will be fought with, but i know World War 4 will be fought with stones and sticks" - Albert Einstein |
|||
|
08-05-2009, 02:47 AM
Post: #4
|
|||
|
|||
|
RE: Mineswepper
lol... i just now discovered that number on field is nu,ber of how much mines field was associated with!!! thanks on info!
Read rules ![]()
|
|||
|
08-05-2009, 03:47 AM
Post: #5
|
|||
|
|||
RE: Mineswepper
(08-05-2009 02:47 AM)l3g1sl4tor Wrote: lol... i just now discovered that number on field is nu,ber of how much mines field was associated with!!! thanks on info!You really didn't know that ? LOL ! "I dont know with what weapons World War 3 will be fought with, but i know World War 4 will be fought with stones and sticks" - Albert Einstein |
|||
|
« Next Oldest | Next Newest »
|









