3 Replies - 4943 Views - Last Post: 11 June 2010 - 07:46 AM Rate Topic: -----

#1 Tootsman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-January 10

How to write a memory game using visual studio 2008

Post icon  Posted 22 January 2010 - 07:40 AM

If you match two same colours or pictures, you get some points. There should be nine pairs of hidden pictures/colours but shows up when clicked but should not in the same order or line. There has to be a count down timer as well.
Is This A Good Question/Topic? 0
  • +

Replies To: How to write a memory game using visual studio 2008

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9057
  • View blog
  • Posts: 34,001
  • Joined: 12-June 08

Re: How to write a memory game using visual studio 2008

Posted 22 January 2010 - 09:18 AM

View PostTootsman, on 22 Jan, 2010 - 08:40 AM, said:

If you match two same colours or pictures, you get some points. There should be nine pairs of hidden pictures/colours but shows up when clicked but should not in the same order or line. There has to be a count down timer as well.


This homework is making the rounds again? Can we start tracking the percentage of common homework themes and dates to trend them?
Was This Post Helpful? 0
  • +
  • -

#3 Vagnagun  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 11-June 10

Re: How to write a memory game using visual studio 2008

Posted 11 June 2010 - 02:13 AM

Hi,I'm new here and I have a important question.
I have the same program how Tootsman use it.
I must write for a friend Memory the game. But I have not idea how I must write the random generator for the pictueres. Can you help me pls?

CU
Vagnagun
Was This Post Helpful? 0
  • +
  • -

#4 Frinavale  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 203
  • View blog
  • Posts: 776
  • Joined: 03-June 10

Re: How to write a memory game using visual studio 2008

Posted 11 June 2010 - 07:46 AM

Hi, Vagnagun :)

At least your question is a little bit easier to answer than "how do I create a program" (which is a Huge question!).

To generate a random number you should use the Random class.

Be sure to check out that link because it covers the topic very well and includes examples on how to use the Random class, problems that you may encounter, solutions to the problems etc.

What I would do is create some sort of class that could be used as the "thing" that displays the images to click on (a UserControl maybe). Then in my main program I would create an array of these controls, using the Random class to randomly retrieve pictures for each of the UserControls.

Or, you could assign the pictures in a not so random way to each user control but use the Random class to randomly insert the UserControl into the array.

There's a Lot of ways you can do this. It all depends on how you are designing your system and where this "randomness" is implemented (in the main application code or in the UserControl...or where?)

Happy Coding!

-Frinny
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1