By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,112 Members | 1,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,112 IT Pros & Developers. It's quick & easy.

Memory game--> HELP

P: 3
I am looking for the game 'memory' in C code.
This is pretty urgent, so any replies would be appreciated.
Thanx
Dec 18 '06 #1
Share this Question
Share on Google+
4 Replies


10K+
P: 13,264
I am looking for the game 'memory' in C code.
This is pretty urgent, so any replies would be appreciated.
Thanx
This is not a vey good way of asking for help. Perhaps you should have a look at the posting guidelines.
Dec 18 '06 #2

P: 3
And which guide line would you be referring to?
I am looking for the function code of the game. How is that a problem to you?
Dec 21 '06 #3

10K+
P: 13,264
And which guide line would you be referring to?
I am looking for the function code of the game. How is that a problem to you?
I was refering to these guidelines.

As you can see by the number of responses you got that people here are more inclined to help those who are willing to put in some effort themselves first.
Dec 21 '06 #4

P: 3
ok well ... this is what i got so far. The idea is to lett the user put in the amount of rows and colums for the memory game. but i cant get it to work. basicly i suck at programming, but i gotta find how to make this work. also the table (memory field) has to get filled with black boxes, and when clicked on (using conio.h) it should show whats under it (the memory sign).
btw rij (rijen) means row/rows
and kolom/kolommen means colums
so NOW can anyone help me out?


#include <stdio.h>
#include <string.h>
#include <stdlib.h>

/*
char k=128;
printf("Het Asci teken: %c",k);
*/

int main(void)
{
char**rijen;
char**kolommen;
char k=128;
int rij, kolom, i, j;
printf("Geef het aantal rijen: ");
scanf("%d%*c", &rij);
rijen = calloc( sizeof(char*), rij);
printf("Geef het aantal kolommen: ");
scanf("%d%*c", &kolom);
kolommen = calloc( sizeof(char*), kolom);

for (i=0;i<rij;i++)
{
strcpy(rijen[i], k);
}
for (j=0;j<kolom;j++)
{
strcpy(kolommen[j], k);
}
for (i=0;i<rij;i++)
{
printf("%c",rijen[i]);
free(rijen[i]);
}
for (j=0;j<kolom;j++)
{
printf("%c",kolommen[i]);
free(kolommen[j]);
}
return 0;
}
Dec 23 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.