-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_aux.c
51 lines (43 loc) · 898 Bytes
/
main_aux.c
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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bool.h"
#include "macro.h"
#include "ADT_Error.h"
#include "main_aux.h"
#include "game.h"
bool mainAux_readCommand(char* command){
int l=0;
char c;
/* fseek(stdin,0,SEEK_END);*/
if (NULL == fgets(command,COMMAND_LEN,stdin)){
return FALSE;
}
l = strlen(command);
c = *(command+(l-1));
if( c != '\n' ){
return FALSE;
}
return TRUE;
}
/**
* each cell contain 4 char:
* space char, two digits(printf "%2d") & blank,
* '.' for fixed otherwith space,
* '*' for error otherwith space
*/
void mainAux_printBoard(Game* _game){
printBoard(_game);
}
void mainAux_printExit(){
printf("Exiting...\n");
}
void mainAux_printError(ADTErr err){
HandleErr(err);
}
void mainAux_printHint(int dig){
printf("Hint: cell can be: %d\n", dig);
}
void mainAux_printGameFinish(){
printf("Puzzle finished...\n");
}