-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCell.cpp
46 lines (41 loc) · 908 Bytes
/
Cell.cpp
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
#include "Cell.h"
#include "Windows.h"
#include <iostream>
#include "checkML.h"
using namespace std;
void initCell(tCell &cell) {
cell.state = Empty;
fullSet(cell.set);
}
void fillCell(tCell &cell, char c, bool fixed) { //Check it outa
if (c == ' ') {
cell.state = Empty;
}
else{
cell.state = Full;
}
if (fixed) {
cell.state = Fixed;
}
cell.number = c;
}
void drawCell(const tCell &cell) {
HANDLE hConsoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
if (cell.state == Fixed) {
SetConsoleTextAttribute(hConsoleHandle, 144); //blue
}
else if (cell.state == Full) {
SetConsoleTextAttribute(hConsoleHandle, 192); //red
}
cout << cell.number;
SetConsoleTextAttribute(hConsoleHandle, 15);
}
bool isSimple(const tCell & cell, int & number) { //Check it outa
bool itIs = false;
if (cell.state == Empty) {
if (one(cell.set, number)) {
itIs = true;
}
}
return itIs;
}