-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlabirinth.c
More file actions
62 lines (61 loc) · 1.73 KB
/
labirinth.c
File metadata and controls
62 lines (61 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#define N 30
char Buchstaben[N]={'I','A',
'A','I','B','C',
'B','A','F','O',
'C','A','D','E',
'D','C','F','E',
'E','C','D','O',
'F','B','D','O',
'O','B','E','F'};
int count=0;
while(count<N){
//fühlt unser Labirinth aus
x=malloc(sizeof(struct nodeitem));
y=malloc(sizeof(struct nodeitem));
x->name[0]=Buchstaben[count]; x->name[1]='\0';
count++;
y->name[0]=Buchstaben[count]; y->name[1]='\0';
count++;
x->next=y;
if(count==2){//da am Anfang steht es mazestruc in ersten Reihe
mlist1=malloc(sizeof(struct connect));
mlist1->nlist=x;
mazestruc=mlist1;
}
else{
y1=y;
anker2=x;
x=malloc(sizeof(struct nodeitem));
y=malloc(sizeof(struct nodeitem));
x->name[0]=Buchstaben[count]; x->name[1]='\0';
count++;
y->name[0]=Buchstaben[count]; y->name[1]='\0';
count++;
x->next=y;
y1->next=x;
mlist1=malloc(sizeof(struct connect));
mlist1->nlist=anker2;
mlist2->next=mlist1;
}
//-----------------------------------
x=malloc(sizeof(struct nodeitem));
y=malloc(sizeof(struct nodeitem));
x->name[0]=Buchstaben[count]; x->name[1]='\0';
count++;
y->name[0]=Buchstaben[count]; y->name[1]='\0';
count++;
x->next=y;
y1=y;
anker2=x;
x=malloc(sizeof(struct nodeitem));
y=malloc(sizeof(struct nodeitem));
x->name[0]=Buchstaben[count]; x->name[1]='\0';
count++;
y->name[0]=Buchstaben[count]; y->name[1]='\0';
count++;
x->next=y;
y1->next=x;
mlist2=malloc(sizeof(struct connect));
mlist2->nlist=anker2;
mlist1->next=mlist2;
}