URL
https://opencores.org/ocsvn/connect-6/connect-6/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 7 |
Rev 11 |
Line 221... |
Line 221... |
|
|
int i = 0;
|
int i = 0;
|
int top;
|
int top;
|
AIMoves moves1;
|
AIMoves moves1;
|
#pragma bitsize i 4
|
#pragma bitsize i 4
|
// if (!moves || !moves->len)
|
if (!moves || !moves->len)
|
// return 0;
|
return 0;
|
// //aimoves_sort(moves);
|
aimoves_sort(moves);
|
// for (top = 0; top < moves->len &&
|
for (top = 0; top < moves->len &&
|
// moves->data[top].weight == moves->data[0].weight; top++);
|
moves->data[top].weight == moves->data[0].weight; top++);
|
// if (top)
|
if (top)
|
// //i = my_irand(top,current_random);//g_random_int_range(0, top);
|
//i = my_irand(top,current_random);//g_random_int_range(0, top);
|
// i=0;
|
i=0;
|
//
|
|
// *move = moves->data[i];
|
*move = moves->data[i];
|
// return 1;
|
return 1;
|
/*---------------------------------------
|
/*---------------------------------------
|
Rewritten for Hardware
|
Rewritten for Hardware
|
---------------------------------------*/
|
---------------------------------------*/
|
//for (top = 0; top < moves->len; top++){
|
//for (top = 0; top < moves->len; top++){
|
// if(top==0) {
|
// if(top==0) {
|
Line 251... |
Line 251... |
// return 1;
|
// return 1;
|
// }
|
// }
|
//}
|
//}
|
// return 0;
|
// return 0;
|
if(!moves|| !moves->len) return 0;
|
if(!moves|| !moves->len) return 0;
|
else {*move=moves->data[index[i]];return 1;}
|
else {*move=moves->data[i];return 1;}
|
|
|
|
|
}
|
}
|
//
|
//
|
//void aimoves_crop(AIMoves *moves, unsigned int n)
|
//void aimoves_crop(AIMoves *moves, unsigned int n)
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.