mirror of
https://github.com/OMGeeky/hcsalmon1-Chess-Engine-Test.git
synced 2026-02-23 15:49:51 +01:00
Add files via upload
This commit is contained in:
25
Odin/boardutils.odin
Normal file
25
Odin/boardutils.odin
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
IsOccupied :: proc(bitboard: u64, square: int) -> bool {
|
||||
return (bitboard & SQUARE_BBS[square]) != 0
|
||||
}
|
||||
|
||||
GetOccupiedIndex :: proc(square: int) -> int {
|
||||
for i := 0; i < 12; i+=1 {
|
||||
if IsOccupied(PieceArray[i], square) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return EMPTY
|
||||
}
|
||||
|
||||
OutOfBounds :: proc(move: int) -> bool {
|
||||
|
||||
if move < 0 {
|
||||
return true
|
||||
}
|
||||
if move > 63 {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user