-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.odin
42 lines (31 loc) · 1.08 KB
/
main.odin
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
package bbc
import "core:fmt"
import "core:c/libc"
// FEN debug positions
empty_board :: "8/8/8/8/8/8/8/8 w - - "
start_position :: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 "
tricky_position :: "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1 "
killer_position :: "rnbqkb1r/pp1p1pPp/8/2p1pP2/1P1P4/3P3P/P1P1P3/RNBQKBNR w KQkq e6 0 1"
cmk_position :: "r2q1rk1/ppp2ppp/2n1bn2/2b1p3/3pP3/3P1NPP/PPP1NPB1/R1BQ1RK1 b - - 0 9 "
main :: proc() {
init_all()
parse_fen("r3k2r/p1ppRpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R b KQkq - 0 1 ")
print_board()
move_list : Moves
generate_moves(&move_list)
start := get_time_ms()
for move_count in 0..< move_list.count {
move := move_list.moves[move_count]
copy_board()
if make_move(move, ALL_MOVES) == 0 {
//fmt.printf("Movimento não legal!\n")
continue
}
print_board()
libc.getchar()
take_back()
print_board()
libc.getchar()
}
fmt.printf("tempo: %v ms\n", get_time_ms() - start)
}