Randoming out pictures

Allright, so I'm trying to create a memory game and this is what I've written in the code so far. I'm using Visual Studio Forms Application btw so it's .net language.

Form1.h
1
2
3
4
5
6
7
8
9
10
11
public ref class Form1 : public System::Windows::Forms::Form
	{
	public:
		array<String^>^ randomKort;
		Form1(void)
		{
			InitializeComponent();
			//
			randomKort = gcnew array<String^>( 12 );
			//
		}


Form1.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void bildrand()
		 {
			 randomKort[0] = "H:/Programmering1/Memory/Bilder/pilar.png";
			 randomKort[1] = "H:/Programmering1/Memory/Bilder/pilar.png";
			 randomKort[2] = "H:/Programmering1/Memory/Bilder/star.png";
			 randomKort[3] = "H:/Programmering1/Memory/Bilder/star.png";
			 randomKort[4] = "H:/Programmering1/Memory/Bilder/sweg.jpg";
			 randomKort[5] = "H:/Programmering1/Memory/Bilder/sweg.jpg";
			 randomKort[6] = "H:/Programmering1/Memory/Bilder/Khanda.jpg";
			 randomKort[7] = "H:/Programmering1/Memory/Bilder/Khanda.jpg";
			 randomKort[8] = "H:/Programmering1/Memory/Bilder/pil.png";
			 randomKort[9] = "H:/Programmering1/Memory/Bilder/pil.png";
			 randomKort[10] = "H:/Programmering1/Memory/Bilder/genbot2.png";
			 randomKort[11] = "H:/Programmering1/Memory/Bilder/genbot2.png";
			 
		 }


card.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once
#include <stdlib.h>
#include <time.h>

ref class Kort
{
	//srand ( time(NULL) ); //initialize the random seed
	//const int arrayNum[12] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
	//int RandIndex = rand() % (12); //generates a random number between 0 and 11

public:
	int random()
	{
		int RandIndex = rand() % (12);
		return RandIndex;
	}
};


I've 6 different pictures which I want to get randomed out twice in the program but I have no idea how I'm going to do this. This is as far as I've gotten. Need some help from you guys.
Topic archived. No new replies allowed.