I icreated a two-dimensional array in which i placed two stack of cards. One is numerical and one is random. Then i created two sets of strings which i tried to assign to the cards so I could print them out. I was able to give the initalized cards a pointer to their address in a loop. Outside the loop I created a function where I placed my strings but I can't get the code right to give the strings to the address of the cards i pre-initialized.
for (int i=0; i<frags; i++)
{
story[i][0] = i + 1; //here is where i initialized the deck and
story[i][1] = rand(); // set the pointer to the address
p1[i][0] = &story[i][0];
p1[i][1] = &story[i][1];
}
Assign1(num);
//i called assign1 but cant figure how to
//match the sent. to init. numbers outside
//or inside the subroutine
void Assign1(int num)
{ .
static char *sen[20] = {
"the farmer drove to the city"
"the brakes were slipping"
"the road got very wet"
"water ran down the hill"
"potatoes spilled everywhere"
"she laid an egg"
"the feathers went flying"
"the duck went straight up in the air"
"the dog ran quickly after it"
"everything was planted last spring"
"the clock seemed to tick faster"
"flowers will sprout soon"
"the black cat crossed in front"
"some hay fell off the truch"
"martians landed in my cereal"
"you can't spell dumbass without ass"
"the truck went faster"
"wheel fell off the right side"
"the jester was entertaining the court\n"
"a plane flew overhead"
};
static char *add[15] = {
"when",
"in order that",
"because",
"after",
"although",
"as long as",
"since",
"even though",
"so that",
"while",
"including",
"except",
"such as",
"in addition to"
};
}
inti file looked like this
Original Deck
10112
16597
237
23820
29036
72
23854
8636
6974
3686
13911
6395
1430
22111
25511
Element
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15