11
This commit is contained in:
parent
ad4be0ff41
commit
a1486dbb0d
@ -56,11 +56,13 @@ void run_expert_system(Node *node) {
|
|||||||
}
|
}
|
||||||
printf("%s\n", node->text);
|
printf("%s\n", node->text);
|
||||||
printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost\n");
|
printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost\n");
|
||||||
|
|
||||||
char answer;
|
char answer;
|
||||||
if (scanf(" %c", &answer) != 1) {
|
if (scanf(" %c", &answer) != 1) {
|
||||||
printf("Koniec\n");
|
printf("Koniec\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (answer == 'a') {
|
if (answer == 'a') {
|
||||||
node = node->yes;
|
node = node->yes;
|
||||||
} else if (answer == 'n') {
|
} else if (answer == 'n') {
|
||||||
@ -72,6 +74,7 @@ void run_expert_system(Node *node) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void free_tree(Node *node) {
|
void free_tree(Node *node) {
|
||||||
if (node) {
|
if (node) {
|
||||||
free_tree(node->yes);
|
free_tree(node->yes);
|
||||||
|
Loading…
Reference in New Issue
Block a user