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 );
//
}
#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.