Skip to content

Commit 45b2354

Browse files
committed
Basic code set. Still need tests
1 parent 34d8730 commit 45b2354

File tree

12 files changed

+1655
-86
lines changed

12 files changed

+1655
-86
lines changed

ConLib2005_v_2_4_1/ConLib.h

Lines changed: 1112 additions & 0 deletions
Large diffs are not rendered by default.

ConLib2005_v_2_4_1/ConLib2005.lib

27.9 KB
Binary file not shown.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
-=* ========================== *=-
2+
-=* The ConLib Console Library *=-
3+
-=* VC++ 2005 Express Edition *=-
4+
-=* ========================== *=-
5+
6+
The ConLib library is a set of routines that offer simplified access
7+
to the WIN32 API console manipulation functions. All the programmer
8+
needs to do is include the ConLib header file in any modules calling
9+
the ConLib functions, and also make sure that the ConLib library is
10+
included in the list of files the linker references.
11+
12+
This "readme" document is for users wishing to use ConLib for their
13+
Visual C++ 2005 Express Edition projects. If you are using Visual C++
14+
version 6, you should download the non-custom build from the website
15+
(http://staffwww.fullcoll.edu/sedwards/ConLib/ConLibIntro.htm).
16+
17+
18+
19+
===============================================================
20+
Steps to using the ConLib library for VC++ 2005 Express Edition
21+
===============================================================
22+
23+
1) In any source code modules that use the library routines, you must
24+
be sure to include the ConLib header file, for example:
25+
26+
#include "ConLib.h"
27+
28+
Make sure that the header file is either in the same subdirectory
29+
as your source code modules, or in the path the compiler searches
30+
for #include files.
31+
32+
2) The linker will need access to the ConLib library so your function
33+
calls can be resolved. If you are working with a makefile, simply
34+
add it to the list of libraries. If you are working in a Visual C++
35+
project, do the following:
36+
37+
a) After you've created your project, bring up its properties by
38+
selecting "Project -> <Project Name> Properties..."
39+
40+
b) In the tree control to the left, expand "Configuration
41+
Properties", then "Linker -> Input". To the right you should see
42+
a space for "Additional Dependencies"; place your cursor in this
43+
field and enter "ConLib2005.lib".
44+
45+
c) The linker will need to locate the ConLib library file when you
46+
build your project. The simplest way to achieve this is to
47+
place the appropriate ConLib library file in the same
48+
subdirectory where your source code files are located. An
49+
alternate method is to place the library in the subdirectory of
50+
your own choosing, then updating the library path the linker
51+
searches (you can find this by traversing the menu path "Tools
52+
-> Options -> VC++ Directories". To the right you'll see a
53+
drop-down listbox labeled "Show directoreis for:"; select
54+
"Library files" and then add the location of where you wish to
55+
keep the ConLib2005.lib file on your system.
56+
57+
That's all there is to it! Happy coding!
58+
59+
Scott Edwards
60+
61+
11/19/2006

Jogo da Velha/minimax.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ int evaluate(int aiGrid[3][3])
4949
{
5050
if (aiGrid[i][0] == aiSymbol)
5151
return +10;
52-
else if (aiGrid[i][0] == playerSymbol)
52+
else if (aiGrid[i][0] == -aiSymbol)
5353
return -10;
5454
}
5555
}
@@ -63,7 +63,7 @@ int evaluate(int aiGrid[3][3])
6363
if (aiGrid[0][col] == aiSymbol)
6464
return +10;
6565

66-
else if (aiGrid[0][col] -aiSymbol)
66+
else if (aiGrid[0][col] == -aiSymbol)
6767
return -10;
6868
}
6969
}
@@ -73,15 +73,15 @@ int evaluate(int aiGrid[3][3])
7373
{
7474
if (aiGrid[0][0] == aiSymbol)
7575
return +10;
76-
else if (aiGrid[0][0] -aiSymbol)
76+
else if (aiGrid[0][0] == -aiSymbol)
7777
return -10;
7878
}
7979

8080
if (aiGrid[0][2] == aiGrid[1][1] && aiGrid[1][1] == aiGrid[2][0])
8181
{
8282
if (aiGrid[0][2] == aiSymbol)
8383
return +10;
84-
else if (aiGrid[0][2] -aiSymbol)
84+
else if (aiGrid[0][2] == -aiSymbol)
8585
return -10;
8686
}
8787

0 commit comments

Comments
 (0)