Line 11... |
Line 11... |
//
|
//
|
//#include "util.h"
|
//#include "util.h"
|
//#include "connect6.h"
|
//#include "connect6.h"
|
//#include<stdio.h>
|
//#include<stdio.h>
|
#include "./shared.h"
|
#include "./shared.h"
|
//#include "pico.h"
|
//#ifdef PICO_SYSC_SIM
|
|
#include "pico.h"
|
|
//#endif
|
|
|
// Subtract this many points for moves at the edges.
|
// Subtract this many points for moves at the edges.
|
#define EDGEPENALTY 5
|
#define EDGEPENALTY 5
|
|
|
using namespace std;
|
using namespace std;
|
Line 106... |
Line 108... |
// //moves->len=0;
|
// //moves->len=0;
|
// // /*moves = */ai_adjacent(board,moves);
|
// // /*moves = */ai_adjacent(board,moves);
|
// aimoves_choose(moves, move);
|
// aimoves_choose(moves, move);
|
// }
|
// }
|
//}
|
//}
|
|
int id;
|
int connect6ai_synth(int firstmove,char movein[8], char colour, char moveout[8]){
|
int connect6ai_synth(int firstmove,char movein[8], char colour, char moveout[8]){
|
//int id= PICO_initialize_PPA(ai_threats);
|
//#ifdef PICO_SYSC_SIM
|
|
//id= PICO_initialize_PPA(ai_threats);
|
|
//PICO_set_task_overlap(id, 2);
|
|
//#endif
|
#pragma bitsize firstmove 17
|
#pragma bitsize firstmove 17
|
char moveoutm[8];
|
char moveoutm[8];
|
#pragma internal_blockram moveoutm
|
#pragma internal_blockram moveoutm
|
short x,y,highx = 0;
|
short x,y,highx = 0;
|
//Board *myboard ;
|
//Board *myboard ;
|
static Board myboard;//={0,0,0,0,0,0,0,0,0,0,0,{{0}}};
|
static Board myboard;//={0,0,0,0,0,0,0,0,0,0,0,{{0}}};
|
//#pragma read_write_ports board.data combined 2
|
//#pragma read_write_ports board.data combined 2
|
//#pragma preserve_array myboard.data
|
//#pragma preserve_array myboard.data
|
#pragma internal_blockram myboard
|
#pragma internal_blockram myboard
|
|
//#pragma multi_buffer myboard 2
|
//#pragma no_memory_analysis myboard
|
//#pragma no_memory_analysis myboard
|
static unsigned int current_random = 10;
|
static unsigned int current_random = 10;
|
AIMove move,move_threat,move_adj;
|
AIMove move,move_threat,move_adj;
|
//#pragma internal_blockram move
|
//#pragma internal_blockram move
|
//#pragma no_memory_analysis move
|
//#pragma no_memory_analysis move
|
Line 161... |
Line 168... |
}
|
}
|
}
|
}
|
int i;
|
int i;
|
#pragma bitsize i 6
|
#pragma bitsize i 6
|
|
|
|
//#pragma num_iterations(1,2,2)
|
|
//#pragma unroll
|
for(i=myboard.moves_left;i>0;i--){
|
for(i=myboard.moves_left;i>0;i--){
|
//aimoves_free(&moves);
|
//aimoves_free(&moves);
|
move.x=-1;
|
move.x=-1;
|
move.y=-1;
|
move.y=-1;
|
|
|
Line 242... |
Line 251... |
//place_piece_type(&myboard,move.x,move.y,myboard.turn);
|
//place_piece_type(&myboard,move.x,move.y,myboard.turn);
|
//
|
//
|
// /// Convert the int coordinates to corresponding ASCII chars
|
// /// Convert the int coordinates to corresponding ASCII chars
|
//move_to_ascii(move.x+1,move.y+1,&moveout[4]);
|
//move_to_ascii(move.x+1,move.y+1,&moveout[4]);
|
//}
|
//}
|
|
//#ifdef PICO_SYSC_SIM
|
|
//PICO_sync_task(id, 1);
|
//PICO_finalize_PPA(id);
|
//PICO_finalize_PPA(id);
|
|
//#endif
|
return 0;
|
return 0;
|
}
|
}
|
|
|
|
|
|
|