Lowyat.NET Forums

Welcome Guest ( Log In | Register )

LYN wins Intel-Lenovo-Tangs Blogathon challenge. Thank you everybody!
 
RSS feedBump TopicReply to this topicStart new topicStart Poll

Outline · [ Standard ] · Linear+

> Minesweeper in C, Minesweeper in C

gnush85
post Oct 18 2009, 03:43 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #1


On my way
****

Group: Senior Member
Posts: 667
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Aug 2007
From: Don't Bother





how to use # to cover all the slot in the mine board?
i already create the mine out..but don know how to cover it with #
i use assigning the value to the array for mine
can i use printf to cover up?and will the data gone after i cover?
or any other method?
user posted image

i settle the problem already, but found another problem
using @ as cursor on the mine as selector...i cant program it..
how to make it?


Added on October 19, 2009, 9:56 amno one reply = =
can i pass the value to the struct and change its certain value inside the struct?

This post has been edited by gnush85: Oct 19 2009, 09:56 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
sarcastizer
post Oct 19 2009, 11:10 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #2


Newbie
*

Group: Junior Member
Posts: 19
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Aug 2009





Hi.

Perhaps you can have two sets of arrays? One to store the default location of the mines, and the second to store what is going to appear on screen, which I understand will be '#'.

Are you going to navigate with the keyboard arrow key? If yes, maybe you can substitute the position in the minesweeper grid with '@' and store the original value in a sepearate variable temporarily.

Hope this will help you solve your problems.



User is offlineProfile CardPM
Go to the top of the page
+Quote Post
cic.lemur
post Oct 21 2009, 10:57 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #3


Getting Started
**

Group: Junior Member
Posts: 258
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Dec 2006





As far as I know C++ does not have a LOCATE command like in Basic, which means moving about the @ cursor about will mean needing to reprint the whole board.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
gnush85
post Oct 24 2009, 06:32 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #4


On my way
****

Group: Senior Member
Posts: 667
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Aug 2007
From: Don't Bother





i have a question here:
for(r=0;r<9;r++)
{
for(c=0;c<9;c++)
{
if(r==0)
{
if(c==0)
{
blabla;
}
if(c==9)
{
blabla;
}
}

}
}
can this work?and would that c=0 always have the condition of r=0?means r==0 &&c==0?don know how t post code here..

This post has been edited by gnush85: Oct 24 2009, 06:35 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Squall_Chua
post Oct 24 2009, 06:38 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #5


Getting Started
**

Group: Junior Member
Posts: 189
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Aug 2006




there is a gotoxy() function that can help u to do that
i think it should be located in "conio.h"
i have done pretty much the same thing few years ago though
laugh.gif laugh.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
eclectice
post Oct 28 2009, 09:50 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #6


Regular
******

Group: Senior Member
Posts: 1,998
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Mar 2008




QUOTE(Squall_Chua @ Oct 24 2009, 06:38 PM)
there is a gotoxy() function that can help u to do that
i think it should be located in "conio.h"
i have done pretty much the same thing few years ago though
laugh.gif  laugh.gif
*


Such functions only exist in pre-C99 C++ Standard old Microsoft Visual C++ and Borland Turbo C++.

http://en.wikipedia.org/wiki/Conio.h
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Bump TopicReply to this topicTopic OptionsStart new topic
 



----debug section please ignore----
Lo-Fi Version Time is now: 24th November 2009 - 08:17 PM
All Rights Reserved 2003-2009 Vijandren Ramadass (~living on a prayer~)