What's the best way to draw a minesweeper field

This is a discussion on What's the best way to draw a minesweeper field within the C Programming forums, part of the General Programming Boards category; Right now, I have to do the minesweeper game for a college project... I don't have a problem (for now) ...

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    158

    What's the best way to draw a minesweeper field

    Right now, I have to do the minesweeper game for a college project... I don't have a problem (for now) in coding the game and such cause I've already code it in visual basic a few years ago and I can always see my code in VB...

    Anyway, I'm doing this in C and in text/console mode without the support of any graphics mode... What I need, is suggestions on the best way to design the minefield, the mines, the numbers and the spaces, what's the best way to represent all this "graphicaly"? In other words, with ascii characters only...

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by Nazgulled View Post
    Right now, I have to do the minesweeper game for a college project... I don't have a problem (for now) in coding the game and such cause I've already code it in visual basic a few years ago and I can always see my code in VB...

    Anyway, I'm doing this in C and in text/console mode without the support of any graphics mode... What I need, is suggestions on the best way to design the minefield, the mines, the numbers and the spaces, what's the best way to represent all this "graphicaly"? In other words, with ascii characters only...
    You can still do a lot with colors (background and foreground) in console mode. ASCII 175, 176 & 177 are the three that I've used the most for this. They give a nice texture to an otherwise blank and blah, square.

    A red asterisk * makes a nice bomb, I think. A complimentary or contrasting color can be used for the border of the minefield and something to differentiate the different numbers of mines adjacent to an uncovered square, is good.

    You'll want to use the windows Goto(x,y) function, of course. (not to be confused with the conio.h function of goto(x,y) ).

    Making your squares 5 chars wide and 3 high, and adjusting the font in the console properties, makes your squares , well, square, and then it's easy to center a number, a bomb, whatever, inside the square.

    A great project - have fun.

    Adak
    Last edited by Adak; 05-08-2007 at 01:26 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Looking for a little assistance with item class design...
    By Raigne in forum Game Programming
    Replies: 5
    Last Post: 10-22-2008, 08:55 AM
  2. Which is the better way to draw?
    By g4j31a5 in forum Game Programming
    Replies: 16
    Last Post: 01-22-2007, 10:56 PM
  3. Please critique and suggest improvements for parser
    By Queue in forum C Programming
    Replies: 14
    Last Post: 09-28-2006, 08:28 PM
  4. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  5. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21