New Search Method(s)

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

jhaglund
Posts: 173
Joined: Sun May 11, 2008 7:43 am

Re: New Search Method(s)

Post by jhaglund »

Michael Sherwin wrote: A challenge then. In the following position using your methodology how should black proceed to make the most of his chances? There are so many ways for black to proceed that require the breaking of so many 'rules of thumb' along the way by both sides that it would be interesting to see how your methodology would be able to arrive at a best solution. There are also simple continuations like 2 ... e5 that just invite white to establish a Ruy Lopez, but that would hardly be an attempt to maximize blacks chances. No fair using an opening book or a master game or an alpha/beta searcher. Just explain it with your computer programming ideas. Are you up to the challenge?

[D]r1bqkbnr/pppppppp/2n5/1B6/4P3/8/PPPP1PPP/RNBQK1NR b KQkq - 2 2

:?:
Sure. I'll make it as simple as possible so everyone can understand. A working .exe will take awhile with only spare time at hand... I'll be back in a couple weeks. Stay tune...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: New Search Method(s)

Post by bob »

Don wrote:
bob wrote:
Don wrote:
Uri Blass wrote:
Don wrote: I remember reading years ago in some magazine that humans were the fastest non-flying creatures on the planet - when considering long distances. I'm not sure I buy that, but the argument had to do with the idea that we could shed heat better than animals. Dogs have to lose heat mostly through their tongues for instance.
I also do not buy it.

Most humans cannot run long distances(like 40 kilometer)
without stopping in the middle.

Humans who can do it are minority who did special hard training for running long distances and I wonder how many animals did special training for this task.
Most humans are easily capable of running 40 kilometer with training assuming their weight is normal - it's just that our society is insanely fat and out of shape, especially in the United States but it's happening in Europe and everywhere else too with each passing year I have noticed.

Our society is just not based on being able to move long distances on foot but that is the only thing preventing this ability. It's in us, it's just completely dormant for most people. For the past century or two we have had motorized vehicles to move our fat butts around.

Animals may not explicitly train for running long distances, but in the wild it's a way of life for them. So even if they did train it would not add a significant amount of additional conditioning.
I used to bird (quail) hunt a lot with my dad. We had various bird dogs that were trained to respond to hand signals, and they kept up a steady lope all day long except when slowing down to track birds. A dog lopes along faster than a human jogs at a marathon pace. But then again, the dogs had lots of training exercise during the Summer to be ready for bird season. I do not believe humans can cover more ground unless you pick a seriously old and lazy dog and compare to a trained marathon runner...
That matches my experience with Cogi, the boxer who ran circles around me when I was well conditioned and I usually finished in the top 10% of the 10k and half marathons I ran in the 70's.

But I'm not sure you realize how fast the marathoners run. I looked at several world record times for various distances, and computed the pace and the world record marathon pace is faster than almost all high school male runners can run 1 lap around the track or 400 meters. It works out to doing a lap every 72 seconds - for over 100 laps. Even though good runners can do this in less than a minute, probably only 1 kid in 20 can beat 72 seconds.

This is not a casual pace and so a reasonable healthy kid could not keep up with a marathoner for more than a few seconds.

When you are hunting you are not covering ground like a marathoner - not even close.
I am not, but the dog _is_.

As far as times go, when I was in HS, I ran a 10 flat 100, and a 22.5 second 220. My best 440 times I don't remember as I did not run that in track, but I broke 1 minute regularly in training. But as the distances increased, my times increased at a worse than linear rate. I never ran a mile in under 5 minutes, for example, when the world record was more than a minute faster.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: New Search Method(s)

Post by Don »

bob wrote:
Don wrote:
bob wrote:
Don wrote:
Uri Blass wrote:
Don wrote: I remember reading years ago in some magazine that humans were the fastest non-flying creatures on the planet - when considering long distances. I'm not sure I buy that, but the argument had to do with the idea that we could shed heat better than animals. Dogs have to lose heat mostly through their tongues for instance.
I also do not buy it.

Most humans cannot run long distances(like 40 kilometer)
without stopping in the middle.

Humans who can do it are minority who did special hard training for running long distances and I wonder how many animals did special training for this task.
Most humans are easily capable of running 40 kilometer with training assuming their weight is normal - it's just that our society is insanely fat and out of shape, especially in the United States but it's happening in Europe and everywhere else too with each passing year I have noticed.

Our society is just not based on being able to move long distances on foot but that is the only thing preventing this ability. It's in us, it's just completely dormant for most people. For the past century or two we have had motorized vehicles to move our fat butts around.

Animals may not explicitly train for running long distances, but in the wild it's a way of life for them. So even if they did train it would not add a significant amount of additional conditioning.
I used to bird (quail) hunt a lot with my dad. We had various bird dogs that were trained to respond to hand signals, and they kept up a steady lope all day long except when slowing down to track birds. A dog lopes along faster than a human jogs at a marathon pace. But then again, the dogs had lots of training exercise during the Summer to be ready for bird season. I do not believe humans can cover more ground unless you pick a seriously old and lazy dog and compare to a trained marathon runner...
That matches my experience with Cogi, the boxer who ran circles around me when I was well conditioned and I usually finished in the top 10% of the 10k and half marathons I ran in the 70's.

But I'm not sure you realize how fast the marathoners run. I looked at several world record times for various distances, and computed the pace and the world record marathon pace is faster than almost all high school male runners can run 1 lap around the track or 400 meters. It works out to doing a lap every 72 seconds - for over 100 laps. Even though good runners can do this in less than a minute, probably only 1 kid in 20 can beat 72 seconds.

This is not a casual pace and so a reasonable healthy kid could not keep up with a marathoner for more than a few seconds.

When you are hunting you are not covering ground like a marathoner - not even close.
I am not, but the dog _is_.

As far as times go, when I was in HS, I ran a 10 flat 100, and a 22.5 second 220. My best 440 times I don't remember as I did not run that in track, but I broke 1 minute regularly in training. But as the distances increased, my times increased at a worse than linear rate. I never ran a mile in under 5 minutes, for example, when the world record was more than a minute faster.
Yes, when I was doing my longish run the dog was covering much more distance than I was.

It sounds like you also had a lot of foot speed. As I mentioned previously, and I don't know what the current thinking is, people tend to be best suited to some particular distance. Sprinters don't make good marathon runners and visa versa.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: New Search Method(s)

Post by bob »

Don wrote:
bob wrote:
Don wrote:
bob wrote:
Don wrote:
Uri Blass wrote:
Don wrote: I remember reading years ago in some magazine that humans were the fastest non-flying creatures on the planet - when considering long distances. I'm not sure I buy that, but the argument had to do with the idea that we could shed heat better than animals. Dogs have to lose heat mostly through their tongues for instance.
I also do not buy it.

Most humans cannot run long distances(like 40 kilometer)
without stopping in the middle.

Humans who can do it are minority who did special hard training for running long distances and I wonder how many animals did special training for this task.
Most humans are easily capable of running 40 kilometer with training assuming their weight is normal - it's just that our society is insanely fat and out of shape, especially in the United States but it's happening in Europe and everywhere else too with each passing year I have noticed.

Our society is just not based on being able to move long distances on foot but that is the only thing preventing this ability. It's in us, it's just completely dormant for most people. For the past century or two we have had motorized vehicles to move our fat butts around.

Animals may not explicitly train for running long distances, but in the wild it's a way of life for them. So even if they did train it would not add a significant amount of additional conditioning.
I used to bird (quail) hunt a lot with my dad. We had various bird dogs that were trained to respond to hand signals, and they kept up a steady lope all day long except when slowing down to track birds. A dog lopes along faster than a human jogs at a marathon pace. But then again, the dogs had lots of training exercise during the Summer to be ready for bird season. I do not believe humans can cover more ground unless you pick a seriously old and lazy dog and compare to a trained marathon runner...
That matches my experience with Cogi, the boxer who ran circles around me when I was well conditioned and I usually finished in the top 10% of the 10k and half marathons I ran in the 70's.

But I'm not sure you realize how fast the marathoners run. I looked at several world record times for various distances, and computed the pace and the world record marathon pace is faster than almost all high school male runners can run 1 lap around the track or 400 meters. It works out to doing a lap every 72 seconds - for over 100 laps. Even though good runners can do this in less than a minute, probably only 1 kid in 20 can beat 72 seconds.

This is not a casual pace and so a reasonable healthy kid could not keep up with a marathoner for more than a few seconds.

When you are hunting you are not covering ground like a marathoner - not even close.
I am not, but the dog _is_.

As far as times go, when I was in HS, I ran a 10 flat 100, and a 22.5 second 220. My best 440 times I don't remember as I did not run that in track, but I broke 1 minute regularly in training. But as the distances increased, my times increased at a worse than linear rate. I never ran a mile in under 5 minutes, for example, when the world record was more than a minute faster.
Yes, when I was doing my longish run the dog was covering much more distance than I was.

It sounds like you also had a lot of foot speed. As I mentioned previously, and I don't know what the current thinking is, people tend to be best suited to some particular distance. Sprinters don't make good marathon runners and visa versa.
In high school, I was a running back, and played guard on the basketball team. For baseball I generally played either shortstop or center field since I could cover ground pretty quickly. But I was never worth anything at distance running. If you've seen the Lance Armstrong stories, he apparently has some super-physiology characteristics about removing harmful proteins and CO2 from his bloodstream more quickly than 99.99% of the rest of us.
Dann Corbit
Posts: 12545
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: New Search Method(s)

Post by Dann Corbit »

Don wrote: {snip}
It sounds like you also had a lot of foot speed. As I mentioned previously, and I don't know what the current thinking is, people tend to be best suited to some particular distance. Sprinters don't make good marathon runners and visa versa.
There are two different kinds of muscle fiber. There is fast-twitch which is good for sprinting, high-jump and things of that nature. A short burst of power. This kind of muscle is not nearly as good for long distance. Then we have the slow-twitch muscle fiber which is actually more efficient but does not produce the mighty burst of power. Tour de France riders and marathon runners need this sort of muscle fiber. A mix of these fibers is good for middle distance like 800 meters or the mile.

When I was in high school we had a superb athlete named Mark Higginson. He set all kinds of distance records for one mile and up (He ran a 4:12 mile in Richland High School, for instance). The track coach got a bright idea to hold him out of the mile and sneak him into the half mile because the other coach had taken all his best athletes out of the mile and put them into the half mile because he knew that none of them had any chance against Mark in the mile. Unfortunately, he did not even win the 880 yard race. It turns out that his top end speed was about 60 seconds per lap. Even though he could hold it for a very long time (he was an even better two miler and cross country runner!) he just did not have great enough speed for the half mile. Even though Mark Higginson was one of the best track and field athletes in the nation at the time, he was not a great sprinter and his advantage grew more and more with distance (Our cross country team won the state championship 5 years in a row, mostly due to him and our beast of a coach - coach Hepner.)

So there is a big difference in our performances due to the kinds of muscle tissue that we have. Most people have a mix but some have dominantly more of one type or another and these are the ones that really excel at either sprinting or long distance. But having a mix isn't bad either, because it means you can be pretty good at sprinting and pretty good at distance and very well at middle distances. I suspect that I have a mix because I could run a 10.5" 100 yards, and run 2.6 miles in under 14 minutes over hill and over dale (13:30 or so as I recall). I ran 8:12 for the mile and a half when I was in the military, but that was in uniform and wearing combat boots (It makes a bigger difference than you might think -- I was second fastest for the base at every installation I was ever stationed at).

There is a problem in the U.S. with physical fitness, especially now with the kids playing video games instead of playing baseball and climbing trees like we did when I was a kid. I think that there is a bigger difference now between athletic kids who play basketball, etc. and those who do not because there are categories of kids now who are beyond sedentary almost to sedementary!

I saw on TV that lots of schools are cutting out physical education now. So I think the general attitude of a great mass of people is that it is not important. I have always enjoyed playing sports with my kids and all three of my sons have the same love of basketball that I have (by far my most favorite sport). All three of them are far better than I am now. My youngest son seems to have gotten the fast-twitch fiber from his mother (she was a sprinter in high school). He can squat 1,300 pounds. That is mind-blowing to me because I used to think that I was really good at it but when I was his age I could do barely over half of that.

So where are we with the physical capabilities thing?

I think there are several conclusions we can reach:
1. The human body is capable of incredible physical feats, but in order to achieve these feats we have to expend a great amount of effort to get in shape and stay there.
2. There are different types of muscle fiber that tend to highlight different abilities. Someone with nearly 100% fast-twitch muscle fiber would probably become very frustrated if he tried to be come a great marathon runner and someone with nearly 100% slow-twitch muscle fiber would become frustrated if he tried to become a world class 100 meter runner.
3. While not every one can become a great marathon runner, and not everyone can become a great sprinter, we all have the capability to excel at *something* (sprint, long-distance, or middle-distance).
4. True world class athletes are several standard deviations beyond the norm, and I think that most people fail to appreciate how excellent they really are. There are women athletes in the world that can whip me at any sporting event (weight lifting, running, swimming, you name it), and could have done so when I was in my prime (I like to think I would have won at basketball, but I am not even sure about that one). One day, when my grandmother was about 60 years old, she challenged me to a swimming race. I had seven years of swimming lessons, and was 17 years old or so (don't remember exactly, -- could have been 16-18). I could easily swim for several miles and had done so on many occasions. Anyway, I figured I would totally smoke her, because she did not look to be in shape at all, and I worked out like a madman. She beat me like a rug. Every single stroke gave her six inches on me. I was flailing in the water like an egg-beater trying to keep up with her. No way, she was better. It turns out, in her younger days, she was an olympic alternate in swimming. Whatever technique she knew, it was just vastly superior to mine.

A few months ago I saw a really incredible performance by an Ethiopian woman in a middle distance race (somewhere in the 1500M to 5K range, but I forget what the race was). Anyway, she got jostled and fell flat on her face and was behind by half a lap. But she got up and won the race. It was definitely the most inspiring thing in track and field that I have ever seen.

Anyway, looking at this thread carefully, I wonder is it even possible to become any more derailed on the subject of computer programming?

So to bring it back into line, I think that outside endeavors like learning music and hard exercise also have clear benefits to things like programming because excercise of the mind and of the body result in general excellence. But I also think that there is a danger in becoming over-competitive. Look what it can lead to with the cheating use of steroids and sex changes turning men into women just to win a stupid game.

Bottom line? I don't think there is one. Maybe it is time to move this thread to CTF.
jhaglund
Posts: 173
Joined: Sun May 11, 2008 7:43 am

Re: New Search Method(s)

Post by jhaglund »

Well it's been 2 weeks. I have finally started, and after 3 hours, this is what I have so far: ... a pretty good shell of what I want to do.

Basically, the goal: a condition based counter for legal moves. The greater the counter for a move, the better.

Having as many conditions as you can think of will yield better results.

Excuse the crude code.

I don't know when I will have time to work on this more. I hope this helps.

Code: Select all

//Human v1.0
//by Joshua D. Haglund
//December 11th, 2010


// ------------------------------ Version History -----------------------------
// v1.0  - December 11th, 2010
//
// Emulate basic human decision process in chess
//
// ----------------------------------------------------------------------------


#include "iostream"
#include "stdio.h"
#include "fstream"
#include "wchar.h"
#include "stdlib.h"
#include "string.h"
#include <algorithm>
#include <bitset>

#include <conio.h>
#include <windows.h>



using namespace std;


int book;
int book_closed;
int side_to_move;
int move_counter;
int check;
int attacker;
int defender;
int x;
//pieces[0] = empty;
//pieces[1] = pawn;
//pieces[2] = knight;
//pieces[3] = bishop;
//pieces[4] = rook;
//pieces[5] = queen;
//pieces[6] = king;
int sq;
int a1,a2,a3,a4,a5,a6,a7,a8;
int b1,b2,b3,b4,b5,b6,b7,b8;
int c1,c2,c3,c4,c5,c6,c7,c8;
int d1,d2,d3,d4,d5,d6,d7,d8;
int e1,e2,e3,e4,e5,e6,e7,e8;
int f1,f2,f3,f4,f5,f6,f7,f8;
int g1,g2,g3,g4,g5,g6,g7,g8;
int h1,h2,h3,h4,h5,h6,h7,h8;

int menu();
void ClearScreen();
int version();
int trueorfalse();
int opponent_attacks();
int jvalue();
int check_phase_of_game();
int king_safety();
int defend(); 
int attack_piece();
int defenders_available();
int attackers_available();
int capture_attacked();
int support_attacked();
int move_attacked_away();
int block_attacker();
int develop();
int endgame();
int gameplan();
int capture_piece();
int capture_attacker();
int fork();
int pin();
int skewer();
int discovery();
int pawn(int);
int knight(int);
int bishop(int);
int black_bishops();
int rook(int);
int queen(int);
int king(int);
int check_for_castle();
int castle();
int undeveloped_pieces();
int developed_pieces();
int unprotected_pieces();
int protected_pieces();
int center_control();
int passed_pawn();
int doubled_pawns();
int isolated_pawns();
int ep();
int promotion();
int pawn_wall();
int pawn_chain();
int pawn_storm();
int open_files();
int support_pawn();
int semi_open_files();
int battery();
int connected_rooks();
int connected_with_pawn();
int mobility();
int bad_bishop();
int bishop_pair();
int battery();
int fianchetto();
int importance();
int influence();
int check_pieces_being_attacked();
int move_list();
int score(); 
int info();
int about();
int counters();
int position_setup();
int useful_sq();
int useful_piece();
int temp_useful();



int main()
{
  

menu();
    system("pause");
    return 0;
}





// 1 = still not captured
int black_pawn_a7 = 1;
int black_pawn_b7 = 1;
int black_pawn_c7 = 1;
int black_pawn_d7 = 1;
int black_pawn_e7 = 1;
int black_pawn_f7 = 1;
int black_pawn_g7 = 1;
int black_pawn_h7 = 1;

int black_g_knight = 1;
int black_b_knight = 1;
int black_w_bishop = 1;
int black_b_bishop = 1;
int black_a_rook = 1;
int black_h_rook = 1;
int black_queen = 1;

int black_promote1 = 0;
int black_promote2 = 0;


int black_a_file_open = 0;
int black_b_file_open = 0;
int black_c_file_open = 0;
int black_d_file_open = 0;
int black_e_file_open = 0;
int black_f_file_open = 0;
int black_g_file_open = 0;
int black_h_file_open = 0;

int black_1_rank_open = 0;
int black_2_rank_open = 0;
int black_3_rank_open = 0;
int black_4_rank_open = 0;
int black_5_rank_open = 0;
int black_6_rank_open = 0;
int black_7_rank_open = 0;
int black_8_rank_open = 0;

int black_king_check = 0;




int white_pawn_a7 = 1;
int white_pawn_b7 = 1;
int white_pawn_c7 = 1;
int white_pawn_d7 = 1;
int white_pawn_e7 = 1;
int white_pawn_f7 = 1;
int white_pawn_g7 = 1;
int white_pawn_h7 = 1;


int white_g_knight = 1;
int white_b_knight = 1;
int white_w_bishop = 1;
int white_b_bishop = 1;
int white_a_rook = 1;
int white_h_rook = 1;
int white_queen = 1;

int white_promote1 = 0;
int white_promote2 = 0;


int white_a_file_open = 0;
int white_b_file_open = 0;
int white_c_file_open = 0;
int white_d_file_open = 0;
int white_e_file_open = 0;
int white_f_file_open = 0;
int white_g_file_open = 0;
int white_h_file_open = 0;

int white_1_rank_open = 0;
int white_2_rank_open = 0;
int white_3_rank_open = 0;
int white_4_rank_open = 0;
int white_5_rank_open = 0;
int white_6_rank_open = 0;
int white_7_rank_open = 0;
int white_8_rank_open = 0;

int white_king_check = 0;



int book_open = 0; // 1 = true
int phase = 0; // Opening


int check_phase_of_game()
{
//...
if(book)
{
phase = 1; // opening
}
if(book_closed)
{
phase = 2; // middle or endgame
}
if(book_closed && move_counter > 40)
{
phase = 3;
}
cout << " phase: " << phase << endl;
//return phase
system("pause");
menu();
}

int check_pieces_being_attacked()
{
check_phase_of_game();
opponent_attacks();
king_safety();
system("pause");
    menu();

}

int opponent_attacks()
{
if(a1 = 1)
defend();
//...
if(g2 = 1)
defend();
if(g2 != 1)
gameplan();
system("pause");
    menu();

}

int defend()
{
defenders_available();
if(defender = 1) {
support_attacked();
capture_attacker();
move_attacked_away();
block_attacker();
develop();
system("pause");
    menu();
  }
}

int attack()
{
attackers_available();
if(attacker = 1) {
attack_piece();
capture_piece();
fork();
pin();
skewer();
discovery();
develop();
system("pause");
    menu();
   }
}

int develop()
{
//...
pawn(sq);
knight(sq);
bishop(sq);
rook(sq);
queen(sq);
king(sq);
castle();
undeveloped_pieces();
developed_pieces();
unprotected_pieces();
protected_pieces();
center_control();
system("pause");
    menu();
}


int pawn(int sq) {
//...
passed_pawn();
doubled_pawns();
isolated_pawns();
ep();
promotion();
pawn_wall();
pawn_chain();
pawn_storm();
system("pause");
    menu();
}

int knight(int sq)
{
//...
mobility();
importance();
system("pause");
    menu();
}

int bishop(int sq)
{
//...

mobility();
bad_bishop();
bishop_pair();
battery();
fianchetto();
importance();
system("pause");
    menu();

}

int rook(int sq)
{
system("pause");
    menu();
open_files();
semi_open_files();
battery();
connected_rooks();
system("pause");
    menu();
}

int queen(int sq)
{
//...
mobility();
battery();
system("pause");
    menu();
}

int king(int sq)
{
//...
castle();
king_safety();
jvalue();
endgame();
system("pause");
    menu();
}

int importance()
{
system("pause");
    menu();
}

int influence()
{
 system("pause");
    menu();          
}

int bad_bishop()
{
system("pause");
    menu();
}

int bishop_pair()
{
system("pause");
    menu();
}

int fianchetto()
{
system("pause");
    menu();
}


int king_safety()
{
system("pause");
    menu();
}

int defenders_available()
{
system("pause");
    menu();
}

int capture_attacked()
{
    system("pause");
    menu();
}

int capture_attacker()
{
    system("pause");
    menu();
}

int move_attacked_away()
{
    system("pause");
    menu();
}

int block_attacker()
{
    system("pause");
    menu();
}

int attackers_available()
{
    system("pause");
    menu();
}

int attack_piece()
{
    system("pause");
    menu();
}

int capture_piece()
{
    system("pause");
    menu();
}

int passed_pawn()
{
    system("pause");
    menu();
}

int doubled_pawns()
{
    system("pause");
    menu();
}

int isolated_pawns()
{
    system("pause");
    menu();
}

int check_for_castle()
{
    system("pause");
    menu();
}

int support_pawn()
{ 
    system("pause");
    menu();
}



int endgame()
{
system("pause");
    menu();
}

int center_control()
{
system("pause");
    menu();
}

int unprotected_pieces()
{
system("pause");
    menu();
}

int protected_pieces()
{
system("pause");
    menu();
}


int fork()
{
system("pause");
    menu();
}

int pin()
{
system("pause");
    menu();
}

int skewer()
{
system("pause");
    menu();
}

int discovery()
{
system("pause");
    menu();
}

int mobility()
{
system("pause");
    menu();
}

int castle()
{
system("pause");
    menu();
}

int ep()
{
system("pause");
    menu();
}

int promotion()
{
system("pause");
    menu();
}


int undeveloped_pieces()
{
system("pause");
    menu();
}

int developed_pieces()
{
system("pause");
    menu();
}

int open_files()
{
system("pause");
    menu();
}

int semi_open_files()
{
system("pause");
    menu();
}

int connected_rooks()
{
system("pause");
    menu();
}

int connected_with_pawn()
{
system("pause");
    menu();
}

int battery()
{
system("pause");
    menu();
}

int closed_position()
{
system("pause");
    menu();
}

int isolated_pawn()
{

system("pause");
menu();

}


int doubled_pawn()
{

system("pause");
menu();
}

int pawn_wall()
{


system("pause");
menu();
}

int pawn_chain()
{

system("pause");
menu();
}

int pawn_storm()
{

system("pause");
menu();
}



int support_attacked()
{
//g2 = 1 //being attacked
castle(); //can we castle to defend?
if(pawn(sq))
f2 = 1; //capable of supporting if moved g2g3
if(pawn(sq))
h2 = 1; //capable of supporting if moved g2g3
if(g1 = 0) //open, use as supporting sq.
gameplan();
if(rook(sq))
h1 = 1;
if(e2 = 0)
gameplan();
if(f1 = 0)
gameplan();
if(d3 = 0)
gameplan();
if(black_w_bishop = 1)
c4 = 1;

return 0;
system("pause");
menu();
}


int black_bishops()
{
if(black_w_bishop = 1) // = that it still exists
{
check_phase_of_game();
if(phase = 1)
{
book_open;
if(book_closed && move_counter <= 40)
  {
phase = 2;
check_for_castle();
  }
}
if(phase = 2)
{
check_pieces_being_attacked();
king_safety();
defend();
//...
}
if(phase = 3)
  {
support_pawn();
connected_with_pawn();
//...
  }
}
return 0;
system("pause");
menu();
}


int gameplan()
{
    //
//...
/*
c4 = 0; //useful piece
g1 = 0; //useful sq
h1 = 0; // useful piece
f2 = 0; // useful piece, pawn supporter
h2 = 0; // useful piece, pawn supporter
f1 = 0; //open sq
e2 = 0;
d3 = 0;
*/

int s, c, wh, bk, ct, cs;
int empty_counter, occupied_friendly_counter, occupied_enemy_counter, capable_move_counter, moves_counter;

int empty_sqs = 0;
int white_pawns = 0;
int white_knights = 0;
int white_bishops = 0;
int white_rooks = 0;
int white_queens = 0;
int black_pawns = 0;
int black_knights = 0;
int black_bishops = 0;
int black_rooks = 0;
int black_queens = 0;

char position[64];

int piece[64] = {
            4,3,2,5,6,2,3,4,
            1,1,1,1,1,1,1,1,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            1,1,1,1,1,1,1,1,
            4,3,2,5,6,2,3,4
            };
            
            //color of piece
            //1 = black
            //0 = empty
            //2 = white
int piece_color[64] = {
            1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            2,2,2,2,2,2,2,2,
            2,2,2,2,2,2,2,2
            };
           
 cout << "" << endl;
for(s = 0; s < 64;)
{
     
      if(piece[s] == 4 && piece_color[s] == 1)
      cout << "r";
      
      if(piece[s] == 3 && piece_color[s] == 1)
      cout << "n";
      
      if(piece[s] == 2 && piece_color[s] == 1)
      cout << "b";
      
      if(piece[s] == 1 && piece_color[s] == 1)
      cout << "p";
      
      if(piece[s] == 5 && piece_color[s] == 1)
      cout << "q";
      
      if(piece[s] == 6 && piece_color[s] == 1)
      cout << "k";
      
      if(piece[s] == 0)
      cout << ".";

      if(piece[s] == 4 && piece_color[s] == 2)
      cout << "R";
      
      if(piece[s] == 3 && piece_color[s] == 2)
      cout << "N";
      
      if(piece[s] == 2 && piece_color[s] == 2)
      cout << "B";
      
      if(piece[s] == 1 && piece_color[s] == 2)
      cout << "P";
      
      if(piece[s] == 5 && piece_color[s] == 2)
      cout << "Q";
      
      if(piece[s] == 6 && piece_color[s] == 2)
      cout << "K";

if(s == 7 || s == 15 || s == 23 || s == 31 ||
   s == 39 || s == 47 || s == 55 || s == 63){
cout << "" << endl;
c = c + 1;
}
s = s+1;

}
cout << "" << endl ;

cs = 0;

for(cs = 0; cs < 64;){
//identify sq/pc/color?? Okay?!
if(piece[cs] == 0)
empty_sqs = empty_sqs + 1;

if(piece[cs] == 1 && piece_color[cs] == 1)
black_pawns = black_pawns + 1;

if(piece[cs] == 3 && piece_color[cs] == 1)
black_knights = black_knights + 1;

if(piece[cs] == 2 && piece_color[cs] == 1)
black_bishops = black_bishops + 1;

if(piece[cs] == 4 && piece_color[cs] == 1)
black_rooks = black_rooks + 1;

if(piece[cs] == 5 && piece_color[cs] == 1)
black_queens = black_queens + 1;

if(piece[cs] == 1 && piece_color[cs] == 2)
white_pawns = white_pawns + 1;

if(piece[cs] == 3 && piece_color[cs] == 2)
white_knights = white_knights + 1;

if(piece[cs] == 2 && piece_color[cs] == 2)
white_bishops = white_bishops + 1;

if(piece[cs] == 4 && piece_color[cs] == 2)
white_rooks = white_rooks + 1;

if(piece[cs] == 5 && piece_color[cs] == 2)
white_queens = white_queens + 1;

cs = cs + 1;
}
cout << " Black: " << black_pawns << "p" << " " << black_knights << "n" << " " << black_bishops << "b" << " " << black_rooks << "r" << " " << black_queens << "q" << endl;
cout << " White: " << white_pawns << "P" << " " << white_knights << "N" << " " << white_bishops << "B" << " " << white_rooks << "R" << " " << white_queens << "Q" << endl;
cout << " Empty Squares: " << empty_sqs << endl;



cout << "" << endl;
system("pause");
menu();
}

int move_list()
{
    ClearScreen();
    cout << " " << endl;
//...
char pawn_moves[8] = "a2a3";

/*
int castle[2];
int pawn_moves[300];
int bishop_moves[300];
int rook_moves[500];
int queen_moves[1000];
int king_moves[450];
castle[x]; // if possible, try first.
pawn_moves[x]; //d7d5, e7e5, a7a6,
bishop_moves[x]; 
rook_moves[x]; 
queen_moves[x];
king_moves[x];
//...
*/
int piece[64] = {
            4,3,2,5,6,2,3,4,
            1,1,1,1,1,1,1,1,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            1,1,1,1,1,1,1,1,
            4,3,2,5,6,2,3,4
            };

int piece_color[64] = {
            1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            2,2,2,2,2,2,2,2,
            2,2,2,2,2,2,2,2
            };
    

char move[6] = ""; 
int s;
cout << " Enter move: ";
cin >> move;

for(s = 0; s < 1;)
{
      if(move[0] == '1')
      cout << "a";
      if(move[0] == '2')
      cout << "b";
      if(move[0] == '3')
      cout << "c";
      if(move[0] == '4')
      cout << "d";
      if(move[0] == '5')
      cout << "e";
      if(move[0] == '6')
      cout << "f";
      if(move[0] == '7')
      cout << "g";
      if(move[0] == '8')
      cout << "h";
      
      if(move[0] == 'a')
      cout << "a";
      if(move[0] == 'b')
      cout << "b";
      if(move[0] == 'c')
      cout << "c";
      if(move[0] == 'd')
      cout << "d";
      if(move[0] == 'e')
      cout << "e";
      if(move[0] == 'f')
      cout << "f";
      if(move[0] == 'g')
      cout << "g";
      if(move[0] == 'h')
      cout << "h";


      if(move[1] == '1')
      cout << "1";
      if(move[1] == '2')
      cout << "2";
      if(move[1] == '3')
      cout << "3";
      if(move[1] == '4')
      cout << "4";
      if(move[1] == '5')
      cout << "5";
      if(move[1] == '6')
      cout << "6";
      if(move[1] == '7')
      cout << "7";
      if(move[1] == '8')
      cout << "8";
      
      if(move[2] == '1')
      cout << "a";
      if(move[2] == '2')
      cout << "b";
      if(move[2] == '3')
      cout << "c";
      if(move[2] == '4')
      cout << "d";
      if(move[2] == '5')
      cout << "e";
      if(move[2] == '6')
      cout << "f";
      if(move[2] == '7')
      cout << "g";
      if(move[2] == '8')
      cout << "h";

      if(move[2] == 'a')
      cout << "a";
      if(move[2] == 'b')
      cout << "b";
      if(move[2] == 'c')
      cout << "c";
      if(move[2] == 'd')
      cout << "d";
      if(move[2] == 'e')
      cout << "e";
      if(move[2] == 'f')
      cout << "f";
      if(move[2] == 'g')
      cout << "g";
      if(move[2] == 'h')
      cout << "h";      
      
      
      if(move[3] == '1')
      cout << "1";
      if(move[3] == '2')
      cout << "2";
      if(move[3] == '3')
      cout << "3";
      if(move[3] == '4')
      cout << "4";
      if(move[3] == '5')
      cout << "5";
      if(move[3] == '6')
      cout << "6";
      if(move[3] == '7')
      cout << "7";
      if(move[3] == '8')
      cout << "8";
      
      //castle?
      if(move[3] == '-'){
      cout << "O-O-O"; 
      }else   
      if(move[2] == 'O')
      cout << "O-O";
      
      // check? 
      
      if(move[4] == '+')
      cout << "+";
      
      // checkmate?
      
      if(move[5] == '+' && side_to_move == 0){
      cout << "+ (White checkmates.)" << endl;
     }else
      if(move[5] == '+' && side_to_move == 1)
      cout << "+ (Black checkmates.)" << endl;     
       //    cout << move << endl;

//a1-a8 = 11-18
//b1-b8 = 21-28
//h1-h8 = 81-88

       
       
s = s + 1;
}

   
    cout << " " << endl;


int move_from[64] = {
    0, 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
    };
    
int move_to[64] = {
    0, 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
    };
    
                     //18, 27, 36, 45, 54, 63, 72, 81,
                     // 9, 18, 27, 36, 45, 54, 63, 72,
   //add             // 0,  9, 18, 27, 36, 45, 54, 63,
                     // 9,  0,  9, 18, 27, 36, 45, 54,
                     //18,  9,  0,  9, 18, 27, 36, 45,
                     //27, 18,  9,  0,  9, 18, 27, 36, 
                     //36, 27, 18,  9,  0,  9, 18, 27,
                     //45, 36, 27, 18,  9,  0,  9, 18
    
       
     int add_to[64]={18, 27, 36, 45, 54, 63, 72, 81,
                      9, 18, 27, 36, 45, 54, 63, 72,
                      0,  9, 18, 27, 36, 45, 54, 63,
                      -9,  0,  9, 18, 27, 36, 45, 54,
                     -18,  -9,  0,  9, 18, 27, 36, 45,
                     -27, -18,  -9,  0,  9, 18, 27, 36, 
                     -36, -27, -18,  -9,  0,  9, 18, 27,
                     -45, -36, -27, -18,  -9,  0,  9, 18 
                     };
    
    
  //iccf             //18,28, 38, 48, 58, 68, 78, 88,
                     //17,27, 37, 47, 57, 67, 77, 87,
  // to              //16,26, 36, 46, 56, 66, 76, 86,
                     //15,25, 35, 45, 55, 65, 75, 85,
                     //14,24, 34, 44, 54, 64, 74, 84,
                     //13,23, 33, 43, 53, 63, 73, 83,
                     //12,22, 32, 42, 52, 62, 72, 82,
                     //11,21, 31, 41, 51, 61, 71, 81,
  
  int iccf[64]={     18,28, 38, 48, 58, 68, 78, 88, //iccf    
                     17,27, 37, 47, 57, 67, 77, 87,
                     16,26, 36, 46, 56, 66, 76, 86, // to 
                     15,25, 35, 45, 55, 65, 75, 85,
                     14,24, 34, 44, 54, 64, 74, 84,
                     13,23, 33, 43, 53, 63, 73, 83,
                     12,22, 32, 42, 52, 62, 72, 82,
                     11,21, 31, 41, 51, 61, 71, 81
                     };
                     

int i, p, file, rank, file2, rank2, cord, cord2;
int a = 10;
int b = 20;
int c = 30;
int d = 40;
int e = 50;
int f = 60;
int g = 70;
int h = 80;

cout << " " << endl;
for (i = 0; i < 64;)
{
    cout << iccf[i] << " ";
    if(i == 7 || i == 15 || i == 23 || i ==31 || i ==39 || i == 47 || i == 55 || i == 63)
    cout << "" << endl;
     i = i + 1;
}

    cout << " " << endl;
    
 
cout << " " << endl;
for (i = 0; i < 64;)
{
cout << move_from[i] << " ";
    if(i == 7 || i == 15 || i == 23 || i ==31 || i ==39 || i == 47 || i == 55 || i == 63)
    cout << "" << endl;
     i = i + 1;
}

cout << " " << endl;

cout << " " << endl;
for (i = 0; i < 64;)
{

cout << add_to[i] << " ";
    if(i == 7 || i == 15 || i == 23 || i ==31 || i ==39 || i == 47 || i == 55 || i == 63)
    cout << "" << endl;
     i = i + 1;
}

cout << " " << endl;   
    
    
    
 // add
 
// iccf =add_to + move_from
cout << " Result:" << endl;
cout << " " << endl;
for(i = 0; i < 64;)
{
     
      
       cout << move_from[i] + add_to[i] << " ";
       if(i == 7 || i == 15 || i == 23 || i ==31 || i ==39 || i == 47 || i == 55 || i == 63)
    cout << "" << endl;
 i = i + 1; 
}   
  
  cout << "" << endl;  
    
if(move[0] == 'a')
file = a;
if(move[0] == 'b')
file = b;
if(move[0] == 'c')
file = c;
if(move[0] == 'd')
file = d;
if(move[0] == 'e')
file = e;
if(move[0] == 'f')
file = f;
if(move[0] == 'g')
file = g;
if(move[0] == 'h')
file = h;

if(move[1] == '1')
rank = 1;
if(move[1] == '2')
rank = 2;
if(move[1] == '3')
rank = 3;
if(move[1] == '4')
rank = 4;
if(move[1] == '5')
rank = 5;
if(move[1] == '6')
rank = 6;
if(move[1] == '7')
rank = 7;
if(move[1] == '8')
rank = 8;
    
    
if(move[2] == 'a')
file2 = a;
if(move[2] == 'b')
file2 = b;
if(move[2] == 'c')
file2 = c;
if(move[2] == 'd')
file2 = d;
if(move[2] == 'e')
file2 = e;
if(move[2] == 'f')
file2 = f;
if(move[2] == 'g')
file2 = g;
if(move[2] == 'h')
file2 = h;

if(move[3] == '1')
rank2 = 1;
if(move[3] == '2')
rank2 = 2;
if(move[3] == '3')
rank2 = 3;
if(move[3] == '4')
rank2 = 4;
if(move[3] == '5')
rank2 = 5;
if(move[3] == '6')
rank2 = 6;
if(move[3] == '7')
rank2 = 7;
if(move[3] == '8')
rank2 = 8;    
    // work around.
    cord = file+rank;
    cord2 = file2+rank2; 
cout << " MOVE FROM: " << cord << " " << endl;
cout << " MOVE TO: " << cord2 << " " << endl;
/*
cout << rank << endl;
cout << file<< endl;
cout << rank2<< endl;
cout << file2<< endl;
cout << cord << endl;
cout << cord2 << endl;
*/

for(i = 0; i < 64;)
{

       if(i == 7 || i == 15 || i == 23 || i ==31 || i ==39 || i == 47 || i == 55 || i == 63)
    cout << "" << endl;
i = i +1;
}

    system("pause");
//move_list();
    menu();
}


/*

Joshua was the king of kings. 

*/ 


int jvalue() 
{ 


cout << " " << endl; 

string str; 
string strk; 

float jvalue; 
float a,b,c; 
float la,ga,lb,gb,va,vb; 


cout << " Enter Square of Attacker Piece: "; 
cin >> str; 
cout << " Enter Square of Enemy King: "; 
cin >> strk; 

ga = str[0]; 
gb = str[1]; 

la = strk[0]; 
lb = strk[1]; 

a = gb - lb; 
b = lb; 
if(lb > gb) 
a = lb - gb; 
c = a / b; 
va = ga - la; 
vb = gb - lb; 

if(ga < la) 
va = la - ga; 
if(ga > la) 
va = ga - la; 

if(gb < lb) 
vb = lb - gb; 
if(gb > lb) 
vb = gb - lb; 

if(va > 1 || vb >= 1) 
jvalue = va; 
if(vb > 1 || va >= 1) 
jvalue = vb; 
if(va > 1 || vb == 1) 
jvalue = va; 
if(va > 1 || vb == 0) 
jvalue = va; 
if(vb > 1 || va == 1) 
jvalue = va; 
if(vb > 1 || va == 0) 
jvalue = vb; 

if(va == 0 || vb > 0) 
jvalue = vb; 

if(va == 1 || vb > 1) 
jvalue = vb+c; 
if(vb == 1 || va > 1) 
jvalue = va+c; 

if(va == vb) 
jvalue = va; 
if(vb == va) 
jvalue = vb; 

if(va == 0) 
jvalue = vb; 
if(vb == 0) 
jvalue = va; 

cout.precision(5); 
cout.width(5); 
cout << " J-Value to King: " << jvalue << endl; 
system("pause");
ClearScreen();
menu(); 

system("pause"); 
return 0; 
}

// bitset::test


int trueorfalse ()
{
    ClearScreen();
  bitset<5> mybits (string("01011")); // get string<ct> later
  cout << "Reading position...";
  cout << boolalpha;
  for (size_t i=0; i<mybits.size(); ++i)
    cout << mybits.test(i) << endl;
    cout << " " << endl;
system("pause");
 
  menu();
}


void ClearScreen()
  {
  HANDLE                     hStdOut;
  CONSOLE_SCREEN_BUFFER_INFO csbi;
  DWORD                      count;
  DWORD                      cellCount;
  COORD                      homeCoords = { 0, 0 };

  hStdOut = GetStdHandle( STD_OUTPUT_HANDLE );
  if (hStdOut == INVALID_HANDLE_VALUE) return;

  /* Get the number of cells in the current buffer */
  if (!GetConsoleScreenBufferInfo( hStdOut, &csbi )) return;
  cellCount = csbi.dwSize.X *csbi.dwSize.Y;

  /* Fill the entire buffer with spaces */
  if (!FillConsoleOutputCharacter(
    hStdOut,
    (TCHAR) ' ',
    cellCount,
    homeCoords,
    &count
    )) return;

  /* Fill the entire buffer with the current colors and attributes */
  if (!FillConsoleOutputAttribute(
    hStdOut,
    csbi.wAttributes,
    cellCount,
    homeCoords,
    &count
    )) return;

  /* Move the cursor home */
  SetConsoleCursorPosition( hStdOut, homeCoords );
  }
   
  int version()
  { 
      cout << " " << endl;
      cout << " Human v1.00 Beta" << endl;
      cout << " by Joshua D. Haglund" << endl;
      cout << " 12.11.2010" << endl;
      
}

int info()
{
    cout << " " << endl;
   cout << " Info: " << endl;   //
}

int about()
{ 
     cout << " " << endl;
    cout << " About: " << endl;
    cout << " " << endl;
}


int score()
{
    int castling[2]; // if possible, try first.
int pawn_moves[300]; //d7d5, e7e5, a7a6,
int bishop_moves[500]; 
int rook_moves[500]; 
int queen_moves[1000];
int king_moves[450];
            //sq file cord
char a,b,c,d,e,f,g,h;
    a = 'a';
    b = 'b';
    c = 'c';
    d = 'd';
    e = 'e';
    f = 'f';
    g = 'g';
    h = 'h';

            //init sq score
int s[64] = {
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0
            };
int s2[64] = {
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0
            };
            //piece
            // 0 = empty
            // 1 = pawn
            // 3 = knight
            // 2 = bishop
            // 4 = rook
            // 5 = queen
            // 6 = king
int piece[64] = {
            4,3,2,5,6,2,3,4,
            1,1,1,1,1,1,1,1,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            1,1,1,1,1,1,1,1,
            4,3,2,5,6,2,3,4
            };
            
            //color of piece
            //1 = black
            //0 = empty
            //2 = white
int piece_color[64] = {
            1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,
            2,2,2,2,2,2,2,2,
            2,2,2,2,2,2,2,2
            };

                    
            //1 = white sq
            //0 = black sq      
int sq_color[64] = {
            1,0,1,0,1,0,1,0,
            0,1,0,1,0,1,0,1,
            1,0,1,0,1,0,1,0,
            0,1,0,1,0,1,0,1,
            1,0,1,0,1,0,1,0,
            0,1,0,1,0,1,0,1,
            1,0,1,0,1,0,1,0,
            0,1,0,1,0,1,0,1
            };

            
            //r = rank cords
int r[8];
r[0] = 1;
r[1] = 2;
r[2] = 3;
r[3] = 4;
r[4] = 5;
r[5] = 6;
r[6] = 7;
r[7] = 8;

            //f = file cords
int file[8];
file[0] = 1;
file[1] = 2;
file[2] = 3;
file[3] = 4;
file[4] = 5;
file[5] = 6;
file[6] = 7;
file[7] = 8;



            // pawn sq score
int pawn_sq[64] = {
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
};
            
            // knight sq score
int knight_sq[64] = {
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
};
            
            // bishop sq score
int bishop_sq[64] = {
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
};
            
            // rook sq score
int rook_sq[64] = {
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
};
            
            // queen sq score
int queen_sq[64] = {
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
};   
            
            // king sq endgame score
int king_sq_endgame[64] = {
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
            0,  0,  0, 0, 0,  0,  0,  0,
};
            //king side sq attack bonus
int king_sq_k_zone[64] =            
{
            -9, -8, -7, -5, -3,-1, 0,  1,
            -8, -7, -5, -4, -2, 0, 1,  3,
            -7, -6, -5, -3,  0, 1, 3,  5,
            -6, -5, -3,  0,  1, 3, 5,  7,
            -5, -4,  0,  1,  3, 5, 7,  7,
            -4,  0,  1,  3,  5, 7, 7,  8,
             0,  1,  3,  5,  7, 7, 8,  9,
             1,  3,  5,  7,  7, 8, 9,  9
            }; 
            //queen side sq attack bonus
int king_sq_q_zone[64] =
{
    1, 0, -1, -3, -5, -7, -8, -9,
    3, 1,  0, -2, -4, -5, -7, -8,
    5, 3,  1,  0, -3, -5, -6, -7,
    7, 5,  3,  1,  0, -3, -5, -6,
    7, 7,  5,  3,  1,  0, -4, -5,
    8, 7,  7,  5,  3,  1,  0, -4,
    9, 8,  7,  7,  5,  3,  1,  0,
    9, 9,  8,  7,  7,  5,  3,  1
};                   
            
int pawn_val = 100;
int knight_val = 300;
int bishop_val = 300;
int rook_val = 500;
int queen_val = 900;
int king_val = 10000;
int empty_val = 0;


int pieces[6];            
            
            
cout << " " << endl;


 


// static score white
s[0] = pawn_sq[0] + knight_sq[0] + bishop_sq[0] + rook_sq[0] + queen_sq[0];
s[1] = pawn_sq[1] + knight_sq[1] + bishop_sq[1] + rook_sq[1] + queen_sq[1];
s[2] = pawn_sq[2] + knight_sq[2] + bishop_sq[2] + rook_sq[2] + queen_sq[2];
s[3] = pawn_sq[3] + knight_sq[3] + bishop_sq[3] + rook_sq[3] + queen_sq[3];
s[4] = pawn_sq[4] + knight_sq[4] + bishop_sq[4] + rook_sq[4] + queen_sq[4];
s[5] = pawn_sq[5] + knight_sq[5] + bishop_sq[5] + rook_sq[5] + queen_sq[5];
s[6] = pawn_sq[6] + knight_sq[6] + bishop_sq[6] + rook_sq[6] + queen_sq[6];
s[7] = pawn_sq[7] + knight_sq[7] + bishop_sq[7] + rook_sq[7] + queen_sq[7];
s[8] = pawn_sq[8] + knight_sq[8] + bishop_sq[8] + rook_sq[8] + queen_sq[8];
s[9] = pawn_sq[9] + knight_sq[9] + bishop_sq[9] + rook_sq[9] + queen_sq[9];
s[10] = pawn_sq[10] + knight_sq[10] + bishop_sq[10] + rook_sq[10] + queen_sq[10];
s[11] = pawn_sq[11] + knight_sq[11] + bishop_sq[11] + rook_sq[11] + queen_sq[11];
s[12] = pawn_sq[12] + knight_sq[12] + bishop_sq[12] + rook_sq[12] + queen_sq[12];
s[13] = pawn_sq[13] + knight_sq[13] + bishop_sq[13] + rook_sq[13] + queen_sq[13];
s[14] = pawn_sq[14] + knight_sq[14] + bishop_sq[14] + rook_sq[14] + queen_sq[14];
s[15] = pawn_sq[15] + knight_sq[15] + bishop_sq[15] + rook_sq[15] + queen_sq[15];
s[16] = pawn_sq[16] + knight_sq[16] + bishop_sq[16] + rook_sq[16] + queen_sq[16];
s[17] = pawn_sq[17] + knight_sq[17] + bishop_sq[17] + rook_sq[17] + queen_sq[17];
s[18] = pawn_sq[18] + knight_sq[18] + bishop_sq[18] + rook_sq[18] + queen_sq[18];
s[19] = pawn_sq[19] + knight_sq[19] + bishop_sq[19] + rook_sq[19] + queen_sq[19];
s[20] = pawn_sq[20] + knight_sq[20] + bishop_sq[20] + rook_sq[20] + queen_sq[20];
s[21] = pawn_sq[21] + knight_sq[21] + bishop_sq[21] + rook_sq[21] + queen_sq[21];
s[22] = pawn_sq[22] + knight_sq[22] + bishop_sq[22] + rook_sq[22] + queen_sq[22];
s[23] = pawn_sq[23] + knight_sq[23] + bishop_sq[23] + rook_sq[23] + queen_sq[23];
s[24] = pawn_sq[24] + knight_sq[24] + bishop_sq[24] + rook_sq[24] + queen_sq[24];
s[25] = pawn_sq[25] + knight_sq[25] + bishop_sq[25] + rook_sq[25] + queen_sq[25];
s[26] = pawn_sq[26] + knight_sq[26] + bishop_sq[26] + rook_sq[26] + queen_sq[26];
s[27] = pawn_sq[27] + knight_sq[27] + bishop_sq[27] + rook_sq[27] + queen_sq[27];
s[28] = pawn_sq[28] + knight_sq[28] + bishop_sq[28] + rook_sq[28] + queen_sq[28];
s[29] = pawn_sq[29] + knight_sq[29] + bishop_sq[29] + rook_sq[29] + queen_sq[29];
s[30] = pawn_sq[30] + knight_sq[30] + bishop_sq[30] + rook_sq[30] + queen_sq[30];
s[31] = pawn_sq[31] + knight_sq[31] + bishop_sq[31] + rook_sq[31] + queen_sq[31];
s[32] = pawn_sq[32] + knight_sq[32] + bishop_sq[32] + rook_sq[32] + queen_sq[32];
s[33] = pawn_sq[33] + knight_sq[33] + bishop_sq[33] + rook_sq[33] + queen_sq[33];
s[34] = pawn_sq[34] + knight_sq[34] + bishop_sq[34] + rook_sq[34] + queen_sq[34];
s[35] = pawn_sq[35] + knight_sq[35] + bishop_sq[35] + rook_sq[35] + queen_sq[35];
s[36] = pawn_sq[36] + knight_sq[36] + bishop_sq[36] + rook_sq[36] + queen_sq[36];
s[37] = pawn_sq[37] + knight_sq[37] + bishop_sq[37] + rook_sq[37] + queen_sq[37];
s[38] = pawn_sq[38] + knight_sq[38] + bishop_sq[38] + rook_sq[38] + queen_sq[38];
s[39] = pawn_sq[39] + knight_sq[39] + bishop_sq[39] + rook_sq[39] + queen_sq[39];
s[40] = pawn_sq[40] + knight_sq[40] + bishop_sq[40] + rook_sq[40] + queen_sq[40];
s[41] = pawn_sq[41] + knight_sq[41] + bishop_sq[41] + rook_sq[41] + queen_sq[41];
s[42] = pawn_sq[42] + knight_sq[42] + bishop_sq[42] + rook_sq[42] + queen_sq[42];
s[43] = pawn_sq[43] + knight_sq[43] + bishop_sq[43] + rook_sq[43] + queen_sq[43];
s[44] = pawn_sq[44] + knight_sq[44] + bishop_sq[44] + rook_sq[44] + queen_sq[44];
s[45] = pawn_sq[45] + knight_sq[45] + bishop_sq[45] + rook_sq[45] + queen_sq[45];
s[46] = pawn_sq[46] + knight_sq[46] + bishop_sq[46] + rook_sq[46] + queen_sq[46];
s[47] = pawn_sq[47] + knight_sq[47] + bishop_sq[47] + rook_sq[47] + queen_sq[47];
s[48] = pawn_sq[48] + knight_sq[48] + bishop_sq[48] + rook_sq[48] + queen_sq[48];
s[49] = pawn_sq[49] + knight_sq[49] + bishop_sq[49] + rook_sq[49] + queen_sq[49];
s[50] = pawn_sq[50] + knight_sq[50] + bishop_sq[50] + rook_sq[50] + queen_sq[50];
s[51] = pawn_sq[51] + knight_sq[51] + bishop_sq[51] + rook_sq[51] + queen_sq[51];
s[52] = pawn_sq[52] + knight_sq[52] + bishop_sq[52] + rook_sq[52] + queen_sq[52];
s[53] = pawn_sq[53] + knight_sq[53] + bishop_sq[53] + rook_sq[53] + queen_sq[53];
s[54] = pawn_sq[54] + knight_sq[54] + bishop_sq[54] + rook_sq[54] + queen_sq[54];
s[55] = pawn_sq[55] + knight_sq[55] + bishop_sq[55] + rook_sq[55] + queen_sq[55];
s[56] = pawn_sq[56] + knight_sq[56] + bishop_sq[56] + rook_sq[56] + queen_sq[56];
s[57] = pawn_sq[57] + knight_sq[57] + bishop_sq[57] + rook_sq[57] + queen_sq[57];
s[58] = pawn_sq[58] + knight_sq[58] + bishop_sq[58] + rook_sq[58] + queen_sq[58];
s[59] = pawn_sq[59] + knight_sq[59] + bishop_sq[59] + rook_sq[59] + queen_sq[59];
s[60] = pawn_sq[60] + knight_sq[60] + bishop_sq[60] + rook_sq[60] + queen_sq[60];
s[61] = pawn_sq[61] + knight_sq[61] + bishop_sq[61] + rook_sq[61] + queen_sq[61];
s[62] = pawn_sq[62] + knight_sq[62] + bishop_sq[62] + rook_sq[62] + queen_sq[62];
s[63] = pawn_sq[63] + knight_sq[63] + bishop_sq[63] + rook_sq[63] + queen_sq[63];

// static score black
s2[0] = pawn_sq[0] + knight_sq[0] + bishop_sq[0] + rook_sq[0] + queen_sq[0];
s2[1] = pawn_sq[1] + knight_sq[1] + bishop_sq[1] + rook_sq[1] + queen_sq[1];
s2[2] = pawn_sq[2] + knight_sq[2] + bishop_sq[2] + rook_sq[2] + queen_sq[2];
s2[3] = pawn_sq[3] + knight_sq[3] + bishop_sq[3] + rook_sq[3] + queen_sq[3];
s2[4] = pawn_sq[4] + knight_sq[4] + bishop_sq[4] + rook_sq[4] + queen_sq[4];
s2[5] = pawn_sq[5] + knight_sq[5] + bishop_sq[5] + rook_sq[5] + queen_sq[5];
s2[6] = pawn_sq[6] + knight_sq[6] + bishop_sq[6] + rook_sq[6] + queen_sq[6];
s2[7] = pawn_sq[7] + knight_sq[7] + bishop_sq[7] + rook_sq[7] + queen_sq[7];
s2[8] = pawn_sq[8] + knight_sq[8] + bishop_sq[8] + rook_sq[8] + queen_sq[8];
s2[9] = pawn_sq[9] + knight_sq[9] + bishop_sq[9] + rook_sq[9] + queen_sq[9];
s2[10] = pawn_sq[10] + knight_sq[10] + bishop_sq[10] + rook_sq[10] + queen_sq[10];
s2[11] = pawn_sq[11] + knight_sq[11] + bishop_sq[11] + rook_sq[11] + queen_sq[11];
s2[12] = pawn_sq[12] + knight_sq[12] + bishop_sq[12] + rook_sq[12] + queen_sq[12];
s2[13] = pawn_sq[13] + knight_sq[13] + bishop_sq[13] + rook_sq[13] + queen_sq[13];
s2[14] = pawn_sq[14] + knight_sq[14] + bishop_sq[14] + rook_sq[14] + queen_sq[14];
s2[15] = pawn_sq[15] + knight_sq[15] + bishop_sq[15] + rook_sq[15] + queen_sq[15];
s2[16] = pawn_sq[16] + knight_sq[16] + bishop_sq[16] + rook_sq[16] + queen_sq[16];
s2[17] = pawn_sq[17] + knight_sq[17] + bishop_sq[17] + rook_sq[17] + queen_sq[17];
s2[18] = pawn_sq[18] + knight_sq[18] + bishop_sq[18] + rook_sq[18] + queen_sq[18];
s2[19] = pawn_sq[19] + knight_sq[19] + bishop_sq[19] + rook_sq[19] + queen_sq[19];
s2[20] = pawn_sq[20] + knight_sq[20] + bishop_sq[20] + rook_sq[20] + queen_sq[20];
s2[21] = pawn_sq[21] + knight_sq[21] + bishop_sq[21] + rook_sq[21] + queen_sq[21];
s2[22] = pawn_sq[22] + knight_sq[22] + bishop_sq[22] + rook_sq[22] + queen_sq[22];
s2[23] = pawn_sq[23] + knight_sq[23] + bishop_sq[23] + rook_sq[23] + queen_sq[23];
s2[24] = pawn_sq[24] + knight_sq[24] + bishop_sq[24] + rook_sq[24] + queen_sq[24];
s2[25] = pawn_sq[25] + knight_sq[25] + bishop_sq[25] + rook_sq[25] + queen_sq[25];
s2[26] = pawn_sq[26] + knight_sq[26] + bishop_sq[26] + rook_sq[26] + queen_sq[26];
s2[27] = pawn_sq[27] + knight_sq[27] + bishop_sq[27] + rook_sq[27] + queen_sq[27];
s2[28] = pawn_sq[28] + knight_sq[28] + bishop_sq[28] + rook_sq[28] + queen_sq[28];
s2[29] = pawn_sq[29] + knight_sq[29] + bishop_sq[29] + rook_sq[29] + queen_sq[29];
s2[30] = pawn_sq[30] + knight_sq[30] + bishop_sq[30] + rook_sq[30] + queen_sq[30];
s2[31] = pawn_sq[31] + knight_sq[31] + bishop_sq[31] + rook_sq[31] + queen_sq[31];
s2[32] = pawn_sq[32] + knight_sq[32] + bishop_sq[32] + rook_sq[32] + queen_sq[32];
s2[33] = pawn_sq[33] + knight_sq[33] + bishop_sq[33] + rook_sq[33] + queen_sq[33];
s2[34] = pawn_sq[34] + knight_sq[34] + bishop_sq[34] + rook_sq[34] + queen_sq[34];
s2[35] = pawn_sq[35] + knight_sq[35] + bishop_sq[35] + rook_sq[35] + queen_sq[35];
s2[36] = pawn_sq[36] + knight_sq[36] + bishop_sq[36] + rook_sq[36] + queen_sq[36];
s2[37] = pawn_sq[37] + knight_sq[37] + bishop_sq[37] + rook_sq[37] + queen_sq[37];
s2[38] = pawn_sq[38] + knight_sq[38] + bishop_sq[38] + rook_sq[38] + queen_sq[38];
s2[39] = pawn_sq[39] + knight_sq[39] + bishop_sq[39] + rook_sq[39] + queen_sq[39];
s2[40] = pawn_sq[40] + knight_sq[40] + bishop_sq[40] + rook_sq[40] + queen_sq[40];
s2[41] = pawn_sq[41] + knight_sq[41] + bishop_sq[41] + rook_sq[41] + queen_sq[41];
s2[42] = pawn_sq[42] + knight_sq[42] + bishop_sq[42] + rook_sq[42] + queen_sq[42];
s2[43] = pawn_sq[43] + knight_sq[43] + bishop_sq[43] + rook_sq[43] + queen_sq[43];
s2[44] = pawn_sq[44] + knight_sq[44] + bishop_sq[44] + rook_sq[44] + queen_sq[44];
s2[45] = pawn_sq[45] + knight_sq[45] + bishop_sq[45] + rook_sq[45] + queen_sq[45];
s2[46] = pawn_sq[46] + knight_sq[46] + bishop_sq[46] + rook_sq[46] + queen_sq[46];
s2[47] = pawn_sq[47] + knight_sq[47] + bishop_sq[47] + rook_sq[47] + queen_sq[47];
s2[48] = pawn_sq[48] + knight_sq[48] + bishop_sq[48] + rook_sq[48] + queen_sq[48];
s2[49] = pawn_sq[49] + knight_sq[49] + bishop_sq[49] + rook_sq[49] + queen_sq[49];
s2[50] = pawn_sq[50] + knight_sq[50] + bishop_sq[50] + rook_sq[50] + queen_sq[50];
s2[51] = pawn_sq[51] + knight_sq[51] + bishop_sq[51] + rook_sq[51] + queen_sq[51];
s2[52] = pawn_sq[52] + knight_sq[52] + bishop_sq[52] + rook_sq[52] + queen_sq[52];
s2[53] = pawn_sq[53] + knight_sq[53] + bishop_sq[53] + rook_sq[53] + queen_sq[53];
s2[54] = pawn_sq[54] + knight_sq[54] + bishop_sq[54] + rook_sq[54] + queen_sq[54];
s2[55] = pawn_sq[55] + knight_sq[55] + bishop_sq[55] + rook_sq[55] + queen_sq[55];
s2[56] = pawn_sq[56] + knight_sq[56] + bishop_sq[56] + rook_sq[56] + queen_sq[56];
s2[57] = pawn_sq[57] + knight_sq[57] + bishop_sq[57] + rook_sq[57] + queen_sq[57];
s2[58] = pawn_sq[58] + knight_sq[58] + bishop_sq[58] + rook_sq[58] + queen_sq[58];
s2[59] = pawn_sq[59] + knight_sq[59] + bishop_sq[59] + rook_sq[59] + queen_sq[59];
s2[60] = pawn_sq[60] + knight_sq[60] + bishop_sq[60] + rook_sq[60] + queen_sq[60];
s2[61] = pawn_sq[61] + knight_sq[61] + bishop_sq[61] + rook_sq[61] + queen_sq[61];
s2[62] = pawn_sq[62] + knight_sq[62] + bishop_sq[62] + rook_sq[62] + queen_sq[62];
s2[63] = pawn_sq[63] + knight_sq[63] + bishop_sq[63] + rook_sq[63] + queen_sq[63];

int
a8,b8,c8,d8,e8,f8,g8,h8,
a7,b7,c7,d7,e7,f7,g7,h7,
a6,b6,c6,d6,e6,f6,g6,h6,
a5,b5,c5,d5,e5,f5,g5,h5,
a4,b4,c4,d4,e4,f4,g4,h4,
a3,b3,c3,d3,e3,f3,g3,h3,
a2,b2,c2,d2,e2,f2,g2,h2,
a1,b1,c1,d1,e1,f1,g1,h1,h11;


//note: cords are ex: 1118 = a1a8 (11, 18)

a8 = 18;
a7 = 17;
a6 = 16;
a5 = 15;
a4 = 14;
a3 = 13;
a2 = 12;
a1 = 11;

b8 = 28;
b7 = 27;
b6 = 26;
b5 = 25;
b4 = 24;
b3 = 23;
b2 = 22;
b1 = 21;

c8 = 38;
c7 = 37;
c6 = 36;
c5 = 35;
c4 = 34;
c3 = 33;
c2 = 32;
c1 = 31;

d8 = 48;
d7 = 47;
d6 = 46;
d5 = 45;
d4 = 44;
d3 = 43;
d2 = 42;
d1 = 41;

e8 = 58;
e7 = 57;
e6 = 56;
e5 = 55;
e4 = 54;
e3 = 53;
e2 = 52;
e1 = 51;

f8 = 68;
f7 = 67;
f6 = 66;
f5 = 65;
f4 = 64;
f3 = 63;
f2 = 62;
f1 = 61;

g8 = 78;
g7 = 77;
g6 = 76;
g5 = 75;
g4 = 74;
g3 = 73;
g2 = 72;
g1 = 71;

h8 = 88;
h7 = 87;
h6 = 86;
h5 = 85;
h4 = 84;
h3 = 83;
h2 = 82;
h1 = 81;
h11 = 81;

int white_a_pawn[8] = { 11,12,13,14,15,16,17,18};
int white_b_pawn[8] = { 21,22,23,24,25,26,27,28 };
int white_c_pawn[8] = { 31,32,33,34,35,36,37,38 };
int white_d_pawn[8] = { 41,42,43,44,45,46,47,48 };
int white_e_pawn[8] = { 51,52,53,54,55,56,57,58 };
int white_f_pawn[8] = { 61,62,63,64,65,66,67,68 };
int white_g_pawn[8] = { 71,72,73,74,75,76,77,78 };
int white_h_pawn[8] = { 81,82,83,84,85,86,87,88 };

int black_a_pawn[8] = { 11,12,13,14,15,16,17,18};
int black_b_pawn[8] = { 21,22,23,24,25,26,27,28 };
int black_c_pawn[8] = { 31,32,33,34,35,36,37,38 };
int black_d_pawn[8] = { 41,42,43,44,45,46,47,48 };
int black_e_pawn[8] = { 51,52,53,54,55,56,57,58 };
int black_f_pawn[8] = { 61,62,63,64,65,66,67,68 };
int black_g_pawn[8] = { 71,72,73,74,75,76,77,78 };
int black_h_pawn[8] = { 81,82,83,84,85,86,87,88 };

//char knight[??] = {
//       };
//char bishop[??] = {
//       };
//char rook[??] = {
//       };
//char queen[??] = {
//       };
//char king[??] = {
//       };
//char promote[??] = {
//       };
//char ep[??] = {
//       };
//char castle[6] = { "e1g1", "e1c1", "e8g8", "e8c8", "O-O", "O-O-O"
//       };
int eval[1];
int score[1];


//white
eval[0] = 0;
//black
eval[1] = 0;
//white
score[0] = s[56] + s[57] + s[58] + s[59] + s[60] + s[61] + s[62] + s[63] + 
           s[48] + s[49] + s[50] + s[51] + s[52] + s[53] + s[54] + s[55] + 
           s[40] + s[41] + s[42] + s[43] + s[44] + s[45] + s[46] + s[47] + 
           s[32] + s[33] + s[34] + s[35] + s[36] + s[37] + s[38] + s[39] +     
           s[24] + s[25] + s[26] + s[27] + s[28] + s[29] + s[30] + s[31] + 
           s[16] + s[17] + s[18] + s[19] + s[20] + s[21] + s[22] + s[23] +  
           s[8] +  s[9]  + s[10] + s[11] + s[12] + s[13] + s[14] + s[15] + 
           s[0] +  s[1]  + s[2]  + s[3]  + s[4]  + s[5]  + s[6]  + s[7];

//black
score[1] = s2[0] +  s2[1]  + s2[2]  + s2[3]  + s2[4]  + s2[5]  + s2[6]  + s2[7]  +
           s2[8] +  s2[9]  + s2[10] + s2[11] + s2[12] + s2[13] + s2[14] + s2[15] +
           s2[16] + s2[17] + s2[18] + s2[19] + s2[20] + s2[21] + s2[22] + s2[23] + 
           s2[24] + s2[25] + s2[26] + s2[27] + s2[28] + s2[29] + s2[30] + s2[31] + 
           s2[32] + s2[33] + s2[34] + s2[35] + s2[36] + s2[37] + s2[38] + s2[39] +   
           s2[40] + s2[41] + s2[42] + s2[43] + s2[44] + s2[45] + s2[46] + s2[47] +
           s2[48] + s2[49] + s2[50] + s2[51] + s2[52] + s2[53] + s2[54] + s2[55] +
           s2[56] + s2[57] + s2[58] + s2[59] + s2[60] + s2[61] + s2[62] + s2[63]; 
        
int wpawn_count[8] = {1,1,1,1,1,1,1,1};        
int wpcount;
int wpcountv;
wpcount = (wpawn_count[0]+wpawn_count[1]+wpawn_count[2]+wpawn_count[3]+wpawn_count[4]+wpawn_count[5]+wpawn_count[6]+wpawn_count[7]);
wpcountv = wpcount*pawn_val;
int bpawn_count[8] = {1,1,1,1,1,1,1,1};        
int bpcount;[/code:1:ee5a2
Last edited by jhaglund on Sat Dec 11, 2010 12:08 pm, edited 2 times in total.
jhaglund
Posts: 173
Joined: Sun May 11, 2008 7:43 am

Re: New Search Method(s)

Post by jhaglund »

continued...

Code: Select all

int bpcountv;
bpcount = &#40;bpawn_count&#91;0&#93;+bpawn_count&#91;1&#93;+bpawn_count&#91;2&#93;+bpawn_count&#91;3&#93;+bpawn_count&#91;4&#93;+bpawn_count&#91;5&#93;+bpawn_count&#91;6&#93;+bpawn_count&#91;7&#93;);
bpcountv = bpcount*pawn_val;
int wbishop_count&#91;2&#93; = &#123;1,1&#125;;
int wbcount;
int wbcountv;
wbcount = &#40;wbishop_count&#91;0&#93; + wbishop_count&#91;1&#93;);
wbcountv = wbcount*bishop_val;
int bbishop_count&#91;2&#93; = &#123;1,1&#125;;
int bbcount;
int bbcountv;
bbcount = &#40;bbishop_count&#91;0&#93; + bbishop_count&#91;1&#93;);
bbcountv = bbcount*bishop_val;
int wknight_count&#91;2&#93; = &#123;1,1&#125;;
int wncount;
int wncountv;
wncount = &#40;wknight_count&#91;0&#93;+wknight_count&#91;1&#93;);
wncountv = wncount*knight_val;
int bknight_count&#91;2&#93; = &#123;1,1&#125;;
int bncount;
int bncountv;
bncount = &#40;bknight_count&#91;0&#93;+bknight_count&#91;1&#93;);
bncountv = bncount*knight_val;
int wrook_count&#91;2&#93; = &#123;1,1&#125;;
int wrcount;
int wrcountv;
wrcount = &#40;wrook_count&#91;0&#93;+wrook_count&#91;1&#93;);
wrcountv = wrcount*rook_val;
int brook_count&#91;2&#93; = &#123;1,1&#125;;
int brcount;
int brcountv;
brcount = &#40;brook_count&#91;0&#93;+brook_count&#91;1&#93;);
brcountv = brcount*rook_val;
int wqueen_count&#91;1&#93; = &#123;1&#125;;
int wqcount;
int wqcountv;
wqcount = &#40;wqueen_count&#91;0&#93;);
wqcountv = wqcount*queen_val;
int bqueen_count&#91;1&#93; = &#123;1&#125;;
int bqcount;
int bqcountv;
bqcount = &#40;bqueen_count&#91;0&#93;);
bqcountv = bqcount*queen_val;
int wmate,bmate;
int wmaterial, bmaterial;
wmaterial = wpcountv+wbcountv+wncountv+wrcountv+wqcountv;
bmaterial = bpcountv+bbcountv+bncountv+brcountv+wqcountv;

wmate = king_val - score&#91;0&#93;;
bmate = king_val - score&#91;1&#93;;  
int wcount;
int bcount;

wcount = &#40;wpcount+wbcount+wncount+wrcount+wqcount&#41;+1;
bcount = &#40;bpcount+bbcount+bncount+brcount+bqcount&#41;+1;

cout << " "  << endl;
//menu&#40;);
ClearScreen&#40;);
cout << " Board "  << endl;

cout << a8 << b8 << c8 << d8 << e8 << f8 << g8 << h8 << endl;
cout << a7 << b7 << c7 << d7 << e7 << f7 << g7 << h7 << endl;
cout << a6 << b6 << c6 << d6 << e6 << f6 << g6 << h6 << endl;
cout << a5 << b5 << c5 << d5 << e5 << f5 << g5 << h5 << endl;
cout << a4 << b4 << c4 << d4 << e4 << f4 << g4 << h4 << endl;
cout << a3 << b3 << c3 << d3 << e3 << f3 << g3 << h3 << endl;
cout << a2 << b2 << c2 << d2 << e2 << f2 << g2 << h2 << endl;
cout << a1 << b1 << c1 << d1 << e1 << f1 << g1 << h1 << endl;

cout << " "  << endl;


//default sq eval white
cout << " " << endl;
cout << " Score White " << endl;
cout << " " << endl;
cout << s&#91;56&#93; << s&#91;57&#93; << s&#91;58&#93; << s&#91;59&#93; << s&#91;60&#93; << s&#91;61&#93; << s&#91;62&#93; << s&#91;63&#93; << endl;
cout << s&#91;48&#93; << s&#91;49&#93; << s&#91;50&#93; << s&#91;51&#93; << s&#91;52&#93; << s&#91;53&#93; << s&#91;54&#93; << s&#91;55&#93; << endl;
cout << s&#91;40&#93; << s&#91;41&#93; << s&#91;42&#93; << s&#91;43&#93; << s&#91;44&#93; << s&#91;45&#93; << s&#91;46&#93; << s&#91;47&#93; << endl;
cout << s&#91;32&#93; << s&#91;33&#93; << s&#91;34&#93; << s&#91;35&#93; << s&#91;36&#93; << s&#91;37&#93; << s&#91;38&#93; << s&#91;39&#93; << endl;     
cout << s&#91;24&#93; << s&#91;25&#93; << s&#91;26&#93; << s&#91;27&#93; << s&#91;28&#93; << s&#91;29&#93; << s&#91;30&#93; << s&#91;31&#93; << endl;
cout << s&#91;16&#93; << s&#91;17&#93; << s&#91;18&#93; << s&#91;19&#93; << s&#91;20&#93; << s&#91;21&#93; << s&#91;22&#93; << s&#91;23&#93; << endl;
cout <<  s&#91;8&#93; <<  s&#91;9&#93; << s&#91;10&#93; << s&#91;11&#93; << s&#91;12&#93; << s&#91;13&#93; << s&#91;14&#93; << s&#91;15&#93;  << endl;
cout <<  s&#91;0&#93; <<  s&#91;1&#93; <<  s&#91;2&#93; <<  s&#91;3&#93; <<  s&#91;4&#93; <<  s&#91;5&#93; <<  s&#91;6&#93; <<  s&#91;7&#93; << endl;
cout << " " << endl; 
 
 //default sq eval black
cout << " " << endl;
cout << " Score Black " << endl;
cout << " " << endl;
cout <<  s2&#91;0&#93; <<  s2&#91;1&#93; <<  s2&#91;2&#93; <<  s2&#91;3&#93; <<  s2&#91;4&#93; <<  s2&#91;5&#93; <<  s2&#91;6&#93; <<  s2&#91;7&#93; << endl;
cout <<  s2&#91;8&#93; <<  s2&#91;9&#93; << s2&#91;10&#93; << s2&#91;11&#93; << s2&#91;12&#93; << s2&#91;13&#93; << s2&#91;14&#93; << s2&#91;15&#93;  << endl;
cout << s2&#91;16&#93; << s2&#91;17&#93; << s2&#91;18&#93; << s2&#91;19&#93; << s2&#91;20&#93; << s2&#91;21&#93; << s2&#91;22&#93; << s2&#91;23&#93; << endl;
cout << s2&#91;24&#93; << s2&#91;25&#93; << s2&#91;26&#93; << s2&#91;27&#93; << s2&#91;28&#93; << s2&#91;29&#93; << s2&#91;30&#93; << s2&#91;31&#93; << endl;
cout << s2&#91;32&#93; << s2&#91;33&#93; << s2&#91;34&#93; << s2&#91;35&#93; << s2&#91;36&#93; << s2&#91;37&#93; << s2&#91;38&#93; << s2&#91;39&#93; << endl;  
cout << s2&#91;40&#93; << s2&#91;41&#93; << s2&#91;42&#93; << s2&#91;43&#93; << s2&#91;44&#93; << s2&#91;45&#93; << s2&#91;46&#93; << s2&#91;47&#93; << endl;
cout << s2&#91;48&#93; << s2&#91;49&#93; << s2&#91;50&#93; << s2&#91;51&#93; << s2&#91;52&#93; << s2&#91;53&#93; << s2&#91;54&#93; << s2&#91;55&#93; << endl;
cout << s2&#91;56&#93; << s2&#91;57&#93; << s2&#91;58&#93; << s2&#91;59&#93; << s2&#91;60&#93; << s2&#91;61&#93; << s2&#91;62&#93; << s2&#91;63&#93; << endl;
cout << " " << endl; 
 
int wscore;
int bscore;
wscore = wmaterial-bmaterial+score&#91;0&#93;;
bscore = bmaterial-wmaterial+score&#91;1&#93;;
cout << " WHITE PAWN COUNT&#58; " << wpcount << endl;
cout << " WHITE PAWN COUNT VALUE&#58; " << wpcountv << endl;
cout << " BLACK PAWN COUNT&#58; " << bpcount << endl;
cout << " BLACK PAWN COUNT VALUE&#58; " << bpcountv << endl;
cout << " WHITE BISHOP COUNT&#58; " << wbcount << endl;
cout << " WHITE BISHOP COUNT VALUE&#58; " << wbcountv << endl;
cout << " BLACK BISHOP COUNT&#58; " << bbcount << endl; 
cout << " BLACK BISHOP COUNT VALUE&#58; " << bbcountv << endl;
cout << " WHITE KNIGHT COUNT&#58; " << wncount << endl;
cout << " WHITE KNIGHT COUNT VALUE&#58; " << wncountv << endl;
cout << " BLACK KNIGHT COUNT&#58; " << bncount << endl;
cout << " BLACK KNIGHT COUNT VALUE&#58; " << bncountv << endl;
cout << " WHITE ROOK COUNT&#58; " << wrcount << endl;
cout << " WHITE ROOK COUNT VALUE&#58; " << wrcountv << endl;
cout << " BLACK ROOK COUNT&#58; " << brcount << endl;
cout << " BLACK ROOK COUNT VALUE&#58; " << brcountv << endl;
cout << " WHITE QUEEN COUNT&#58; " << wqcount << endl;
cout << " WHITE QUEEN COUNT VALUE&#58; " << wqcountv << endl;
cout << " BLACK QUEEN COUNT&#58; " << wqcount << endl;
cout << " BLACK QUEEN COUNT&#58; " << wqcountv << endl;
cout << " WHITE PIECE COUNT&#58; " << wcount << endl;
cout << " BLACK PIECE COUNT&#58; " << bcount << endl;
cout << " SCORE WHITE&#58; "<< wscore << endl; 
cout << " SCORE BLACK&#58; "<< bscore << endl; 
cout << " EVAL WHITE&#58; " << wscore - bscore << endl; 
cout << " EVAL BLACK&#58; " << bscore - wscore << endl; 
cout << " MATERIAL WHITE&#58; " << wmaterial << endl;
cout << " MATERIAL BLACK&#58; " << bmaterial << endl;
cout << " WHITE MATE&#58; " << wmate << endl;
cout << " BLACK MATE&#58; " << bmate << endl;


int turn;
int i;

cout << " " << endl;
    system&#40;"pause");
    menu&#40;);
&#125;

int counters&#40;)
&#123;
    
    system&#40;"pause");
    menu&#40;);
&#125;

int position_setup&#40;)
&#123;
    
 //&#91;D&#93;r1bqkbnr/pppppppp/2n5/1B6/4P3/8/PPPP1PPP/RNBQK1NR b KQkq - 2 2
 int position&#91;64&#93;;
 int e;
 char a1,a2,a3,a4,a5,a6,a7,a8; //11-18
 char b1,b2,b3,b4,b5,b6,b7,b8;
 char c1,c2,c3,c4,c5,c6,c7,c8;
 char d1,d2,d3,d4,d5,d6,d7,d8;
 char e1,e2,e3,e4,e5,e6,e7,e8;
 char f1,f2,f3,f4,f5,f6,f7,f8;
 char g1,g2,g3,g4,g5,g6,g7,g8;
 char h1,h2,h3,h4,h5,h6,h7,h8; //81-88
 
 char p,b,n,k,q,r;
 char P,B,N,K,Q,R;
 int side_to_move; 
 char black, white;
 char fen&#91;64&#93;= "";
 char i;
 ClearScreen&#40;);
 cout << " " << endl;
 cout << " '+' = white to move, '-' = black to move" << endl;
 cout << " ex&#58; r1bqkbnr/pppppppp/2n5/1B6/4P3/8/PPPP1PPP/RNBQK1NR-" << endl;
 cout << "" << endl;
 cout << " Enter position&#58; ";
 cin >> fen;
 cout << "" << endl;
 cout << " Creating position&#58; " << fen << endl;
 cout << "" << endl;
 
 for&#40;i = 0; i < 64;)
 &#123;
 
if&#40;fen&#91;i&#93; == '/')
cout << "" << endl;
if&#40;fen&#91;i&#93; == '1')
cout << ".";
if&#40;fen&#91;i&#93; == '2')
cout << "..";
if&#40;fen&#91;i&#93; == '3')
cout << "...";
if&#40;fen&#91;i&#93; == '4')
cout << "....";
if&#40;fen&#91;i&#93; == '5')
cout << ".....";
if&#40;fen&#91;i&#93; == '6')
cout << "......";
if&#40;fen&#91;i&#93; == '7')
cout << ".......";
if&#40;fen&#91;i&#93; == '8')
cout << "........";
if&#40;fen&#91;i&#93; == 'p')
cout << "p";
if&#40;fen&#91;i&#93; == 'n')
cout << "n";
if&#40;fen&#91;i&#93; == 'b')
cout << "b";
if&#40;fen&#91;i&#93; == 'q')
cout << "q";
if&#40;fen&#91;i&#93; == 'k')
cout << "k";
if&#40;fen&#91;i&#93; == 'r')
cout << "r";
if&#40;fen&#91;i&#93; == 'P')
cout << "P";
if&#40;fen&#91;i&#93; == 'N')
cout << "N";
if&#40;fen&#91;i&#93; == 'B')
cout << "B";
if&#40;fen&#91;i&#93; == 'Q')
cout << "Q";
if&#40;fen&#91;i&#93; == 'K')
cout << "K"; 
if&#40;fen&#91;i&#93; == 'R')
cout << "R";
if&#40;fen&#91;i&#93; == '+')
cout << "  White to move." << endl;
side_to_move = 1;
if&#40;fen&#91;i&#93; == '-')
cout << "  Black to move." << endl;
side_to_move = 0;
 
 // cout << fen&#91;i&#93;;
 i = i + 1;

&#125;
cout << "" << endl;

    system&#40;"pause");
// gameplan&#40;);   
    menu&#40;);
&#125;

int useful_sq&#40;)
&#123;
    system&#40;"pause");
    menu&#40;);
&#125;

int useful_piece&#40;)
&#123;
    system&#40;"pause");
    menu&#40;);
&#125;

int temp_useful&#40;)
&#123;
    system&#40;"pause");
    menu&#40;);
&#125;




int menu&#40;)&#123;
    int a;
ClearScreen&#40;);
    version&#40;);
    cout << "" << endl;
cout << "  Menu " << endl;
cout << " " << endl;
cout << "  1&#41; Position Setup             31&#41; Pawn " << endl;
cout << "  2&#41; Counters                   32&#41; Knight " << endl;
cout << "  3&#41; J-Value                    33&#41; Bishop" << endl;
cout << "  4&#41; Score                      34&#41; Rook" << endl;
cout << "  5&#41; Defend                     35&#41; Queen" <<endl;
cout << "  6&#41; Defenders                  36&#41; King"<< endl; 
cout << "  7&#41; Attacked                   37&#41; Passed Pawn" << endl;
cout << "  8&#41; Attackers                  38&#41; Isolated Pawn"<< endl; 
cout << "  9&#41; Attack                     39&#41; Pawn Chain"<< endl; 
cout << " 10&#41; Capture Attacked           40&#41; Pawn Wall"<< endl; 
cout << " 11&#41; Capture Attacker           41&#41; Pawn Storm"<< endl; 
cout << " 12&#41; Develop                    42&#41; Doubled Pawn"<< endl; 
cout << " 13&#41; Game Plan                  43&#41; Developed"<< endl;                                       
cout << " 14&#41; End Game                   44&#41; Undeveloped" << endl;
cout << " 15&#41; King Safety                45&#41; Protected" << endl;
cout << " 16&#41; Check Phase of Game        46&#41; Unprotected" << endl;
cout << " 17&#41; Block Attacker             47&#41; Connected Rooks " << endl;
cout << " 18&#41; Support Attacker           48&#41; Bad Bishop" << endl;
cout << " 19&#41; Move Attacked Away         49&#41; Mobility" << endl;
cout << " 20&#41; Capture                    50&#41; Center Control" <<endl;
cout << " 21&#41; Fork                       51&#41; Supported with Pawn"<< endl; 
cout << " 22&#41; Pin                        52&#41; Fianchetto" << endl;
cout << " 23&#41; Skewer                     53&#41; Bishop Pair" << endl; 
cout << " 24&#41; Discovery                  54&#41; Semi Open Files"<< endl; 
cout << " 25&#41; Castle                     55&#41; Open Files"<< endl; 
cout << " 26&#41; Ep                         56&#41; Battery Ram"<< endl; 
cout << " 27&#41; Promotion                  57&#41; Move List - Beta"<< endl; 
cout << " 28&#41; Check for Attack           58&#41; True or False - Beta"<< endl;                                       
cout << " 29&#41; Importance                 59&#41; Version - Info - About " << endl;
cout << " 30&#41; Influence                  60&#41; Exit" << endl;

a = 0;
while ( a!=6&#41;&#123;
      cout << " " << endl;
      cout << " > ";
cin >> a;
     if&#40;a == 1&#41;&#123;
     position_setup&#40;);
     &#125; else
     if&#40;a == 2&#41; &#123;
     counters&#40;);
     &#125; else  
     if&#40;a == 3&#41; &#123;
     jvalue&#40;);
     &#125; else
     if&#40;a == 4&#41; &#123; 
     score&#40;);
     &#125; else
     if&#40;a == 5&#41; &#123;
    defend&#40;);
     &#125; else
     if&#40;a == 6&#41; &#123;
         defenders_available&#40;);
         
          &#125; else
     if&#40;a == 7&#41; &#123;
        opponent_attacks&#40;);
          &#125; else
     if&#40;a == 8&#41; &#123;
        attackers_available&#40;);
          &#125; else
     if&#40;a == 9&#41; &#123;
         attack_piece&#40;);
          &#125; else
     if&#40;a == 10&#41; &#123;
         capture_attacked&#40;);
          &#125; else
     if&#40;a == 11&#41; &#123;
         capture_attacker&#40;);
          &#125; else
     if&#40;a == 12&#41; &#123;
     develop&#40;);
          &#125; else
     if&#40;a == 13&#41; &#123;
     gameplan&#40;);
           &#125;else
     if&#40;a == 14&#41; &#123;
    endgame&#40;);
          &#125; else
     if&#40;a == 15&#41; &#123;
      king_safety&#40;);
          &#125; else
     if&#40;a == 16&#41; &#123;
   check_phase_of_game&#40;);
          &#125; else

     if&#40;a == 17&#41; &#123;
          block_attacker&#40;);
          &#125; else    
     if&#40;a== 18&#41; &#123;        
           support_attacked&#40;);     
           &#125; else   
      if&#40;a == 19&#41; &#123;
           move_attacked_away&#40;);
           &#125;else  
     if&#40;a == 20&#41; &#123;
          capture_piece&#40;);                   
          &#125; else     
     if&#40;a == 21&#41; &#123;
          fork&#40;); 
          &#125; else
     if&#40;a == 22&#41; &#123;
          pin&#40;);
          &#125;else
     if&#40;a == 23&#41; &#123;
       skewer&#40;);
          &#125;else
    if&#40;a==24&#41;&#123;
          discovery&#40;); 
          &#125;else
    if&#40;a==25&#41;&#123;
          castle&#40;);
          &#125;else
    if&#40;a==26&#41;&#123;
         ep&#40;);
          &#125;else
    if&#40;a ==27&#41;&#123;
         promotion&#40;);
         &#125;else
    if&#40;a == 28&#41;&#123;
        check_pieces_being_attacked&#40;);
         &#125;else
    if&#40;a == 29&#41;&#123;
         importance&#40;);
         &#125;else
         if&#40;a == 30&#41;&#123;
     influence&#40;);
     &#125; else
     if&#40;a == 31&#41;&#123;
     pawn&#40;sq&#41;;
     &#125; else
     if&#40;a == 32&#41; &#123;
     knight&#40;sq&#41;;
     &#125; else  
     if&#40;a == 33&#41; &#123;
     bishop&#40;sq&#41;;
     &#125; else
     if&#40;a == 34&#41; &#123; 
     rook&#40;sq&#41;;
     &#125; else
     if&#40;a == 35&#41; &#123;
     queen&#40;sq&#41;;
     &#125; else
     if&#40;a == 36&#41; &#123;
     king&#40;sq&#41;;
          &#125; else
     if&#40;a == 37&#41; &#123;
     passed_pawn&#40;);
          &#125; else
     if&#40;a == 38&#41; &#123;
     isolated_pawn&#40;);
          &#125; else
     if&#40;a == 39&#41; &#123;
     pawn_chain&#40;);
          &#125; else
     if&#40;a == 40&#41; &#123;
     pawn_wall&#40;);
          &#125; else
     if&#40;a == 41&#41; &#123;
      pawn_storm&#40;);
          &#125; else
     if&#40;a == 42&#41; &#123;
     doubled_pawn&#40;);
          &#125; else
     if&#40;a == 43&#41; &#123;
     developed_pieces&#40;);
           &#125;else
     if&#40;a == 44&#41; &#123;
    undeveloped_pieces&#40;);
          &#125; else
     if&#40;a == 45&#41; &#123;
     protected_pieces&#40;);
          &#125; else
     if&#40;a == 46&#41; &#123;
     unprotected_pieces&#40;);
          &#125; else

     if&#40;a == 47&#41; &#123;
     connected_rooks&#40;);
          &#125; else    
     if&#40;a== 48&#41; &#123;        
     bad_bishop&#40;);
           &#125; else   
      if&#40;a == 49&#41; &#123;
      mobility&#40;);
           &#125;else  
     if&#40;a == 50&#41; &#123;
     center_control&#40;);
                   
          &#125; else     
     if&#40;a == 51&#41; &#123;
     support_pawn&#40;); 
          &#125; else
     if&#40;a == 52&#41; &#123;
    fianchetto&#40;);
          &#125;else
     if&#40;a == 53&#41; &#123;
  bishop_pair&#40;);
                   
          &#125;else
    if&#40;a==54&#41;&#123;
      semi_open_files&#40;); 
          &#125;else
    if&#40;a==55&#41;&#123;
      open_files&#40;);
          &#125;else
    if&#40;a==56&#41;&#123;
         battery&#40;);
          &#125;else
    if&#40;a ==57&#41;&#123;
          move_list&#40;);
         &#125;else
    if&#40;a == 58&#41;&#123;
        trueorfalse&#40;);
         &#125;else
    if&#40;a == 59&#41;&#123;
         ClearScreen&#40;);
         version&#40;);
         info&#40;);
         about&#40;);
         system&#40;"pause");
         menu&#40;);
         &#125;
         else  
     if&#40;a == 60&#41; &#123;
     exit&#40;1&#41;;
     &#125;     
     break;                    
     if&#40;a != 0 || 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&#41;&#123;

     a = 0;
     &#125;

&#125; cout << " " << endl;
 cout << " You're menu choice wasn't valid" << endl;
 system&#40;"pause");
 ClearScreen&#40;);
  menu&#40;);
&#125;
UncombedCoconut
Posts: 319
Joined: Fri Dec 18, 2009 11:40 am
Location: Naperville, IL

Re: New Search Method(s)

Post by UncombedCoconut »

for(0..1e9){print":shock:\n";}
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: New Search Method(s)

Post by AlvaroBegue »

Code: Select all

     if&#40;a != 0 || 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&#41;&#123;

     a = 0;
     &#125;
Your code is wrong in so many ways. I picked that piece just as an illustration of how little programming you know. You need to learn how to program for another 5 years or so before you can make any significant contribution to this field. Perhaps I am being generous.

Please, stop wasting our time.
UncombedCoconut
Posts: 319
Joined: Fri Dec 18, 2009 11:40 am
Location: Naperville, IL

Re: New Search Method(s)

Post by UncombedCoconut »

AlvaroBegue wrote:Your code is wrong in so many ways. I picked that piece just as an illustration of how little programming you know. You need to learn how to program for another 5 years or so before you can make any significant contribution to this field. Perhaps I am being generous.

Please, stop wasting our time.
The quoted code can do no harm since it would never be executed. ;)

Joshua: A well-spent year can greatly improve your programming skills; I disagree with the idea of 5 being a minimum. But from your post it seems that you were more interested in proving a point than in writing usable or clean (or even functional) code. Such attitudes will not lead to progress.