forked from nrchaudhry/DLDProject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PROOF.BAK
executable file
·126 lines (115 loc) · 2.8 KB
/
PROOF.BAK
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#include <graphics.h>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <dos.h>
#include <string.h>
#include "c:\cld\basic.h"
#include "c:\cld\mouse.h"
#include "c:\cld\circuit.h"
void distributive(void);
void commanproof(int col,int row,char name[]);
void endproof(void);
void xbar(int col,int row);
void ybar(int col,int row);
void xbar1(int col,int row);
void ybar1(int col,int row);
int button;
void main(void)
{ int gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"c:\\tc\\bgi");
commanproof(110,6,"Consensus Laws");
setcolor(15);
line(getmaxx()/2,75,getmaxx()/2,getmaxy()-75);
setcolor(0);
line(getmaxx()/2-10,75,getmaxx()/2-10,getmaxy()-75);
setcolor(1);
settextstyle(1,0,2);
outtextxy(25,90,"a) X.Y+Y.Z+ .Z = X.Y+ .Z");
xbar1(145,90);xbar1(265,90);
outtextxy(312,90,"b)(X+Y)(Y+Z)( +Z) = (X+Y)( +Z)");
xbar1(440,90);xbar1(577,90);
setcolor(0);
settextstyle(2,0,6);
// proof of a part.
outtextxy(62,140,"e.g X=1, Y=2 and Z=3");
outtextxy(40,170,"Put the values in this eq.");
outtextxy(62,220,"1 + (2.3) = (1 + 2).(1 + 3)");
outtextxy(112,250,"1 + 6 = 3 . 4");
outtextxy(152,280,"7 = 7");
// proof of b part.
outtextxy(362,140,"e.g X=1, Y=2 and Z=3");
outtextxy(342,170,"Put the values in this eq.");
outtextxy(360,220,"1 . (2 + 3) = 1 . 2 + 1 . 3");
outtextxy(415,250,"1 . 5 = 2 + 3");
outtextxy(450,280,"5 = 5");
setcursorpos(getmaxx()/2,getmaxy()/2);
cursoron();
endproof();
}
void commanproof(int col,int row,char name[])
{
comman3(0, 0, getmaxx(), getmaxy(), 11);
comman(0, 0, getmaxx(), 75,9);
settextstyle(TRIPLEX_FONT, HORIZ_DIR, 6);
setcolor(0);
outtextxy(col,row,name);
outtextxy(col+1,row+1,name);
setcolor(14);
outtextxy(col-1,row-2,name);
outtextxy(col-2,row-2,name);
comman3(15,76,getmaxx()-15,getmaxy()-15,15);
line(getmaxx()/2,75,getmaxx()/2,getmaxy()-75);
line(15,getmaxy()-75,getmaxx()-15,getmaxy()-75);
comman(270,420,370,450,7);
settextstyle(1,0,4);
outtextxy(300,415,"Ok");
}
void endproof(void)
{
int iop=0,flag=0;
while (iop != 1)
{
button=getcursorpos(&x,&y);
if (button)
{
flag=1;
if (x >= 270 && x <= 370 && y >= 420 && y <= 450)
{
press1(270,420,370,450);
}
}
if ((!button)&&(flag))
{
flag=0;
press2(270,420,370,450);
delay(150);
if (x >= 270 && x <= 370 && y >= 420 && y <= 450)
{
sound();
iop=1;
cursoroff();
}
}
}
}
void xbar(int col,int row)
{
outtextxy(col,row,"X");
outtextxy(col,row-10,"-");
}
void ybar(int col,int row)
{
outtextxy(col,row,"Y");
outtextxy(col,row-10,"-");
}
void xbar1(int col,int row)
{
outtextxy(col,row,"X");
outtextxy(col+1,row-12,"-");
}
void ybar1(int col,int row)
{
outtextxy(col,row,"Y");
outtextxy(col+1,row-12,"-");
}