* The following terms apply to the enhanced version of XBoard distributed
* by the Free Software Foundation:
* ------------------------------------------------------------------------
- * This program is free software; you can redistribute it and/or modify
+ *
+ * GNU XBoard is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation, either version 3 of the License, or (at
+ * your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * GNU XBoard is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with this program. If not, see http://www.gnu.org/licenses/. *
+ *
* ------------------------------------------------------------------------
*/
#include <stdio.h>
#include <string.h>
+#include <time.h>
+#include <stdlib.h>
#include "common.h"
#include "backend.h"
uint64 hash(int moveNr)
{
- char c;
- int p, r, f, i, p_enc, squareNr, pieceGroup;
+ int r, f, p_enc, squareNr, pieceGroup;
uint64 key=0, Zobrist;
for(f=BOARD_LEFT; f<BOARD_RGHT; f++){
for(i=0; i<count; i++){
total_weight += entries[i].weight;
}
- srandom( time(0) );
j = (random() & 0x7FFF) * total_weight >> 15; // create random < total_weight
total_weight = 0;
for(i=0; i<count; i++){