@@ -14,14 +14,14 @@ var mRookTab [64]sMagic
1414
1515// all attacks from current square
1616func (m * sMagic ) atks (b * boardStruct ) bitBoard {
17- return m .toSqBB [int (((b .allBB () & m .innerBB )* bitBoard (m .magic )) >> m .shift )]
17+ return m .toSqBB [int (((b .allBB ()& m .innerBB )* bitBoard (m .magic ))>> m .shift )]
1818}
1919
2020func initMagic () {
2121 fmt .Println ("starting init() for magic.go" )
2222
2323 // bishops
24- fillOptimalMagicsB ()
24+ // fillOptimalMagicsB()
2525 for sq := A1 ; sq <= H8 ; sq ++ {
2626 mBishopTab [sq ].shift = uint (64 - nBBits [sq ])
2727 mBishopTab [sq ].innerBB = bitBoard (innerBAtks (sq ))
@@ -59,7 +59,7 @@ func prepareMagicB() {
5959 // all bit combinations for fr and all possible blockers
6060 cnt := bitCombs (0x0 , fr , fr , 0 , & maxM , & mBishopTab [fr ], dirsB )
6161 _ = cnt
62- // fmt.Println("bishop on", sq2Fen[fr], "#of combinations", cnt, "maxIx", maxM)
62+ // fmt.Println("bishop on", sq2Fen[fr], "#of combinations", cnt, "maxIx", maxM)
6363 }
6464}
6565
@@ -71,7 +71,7 @@ func prepareMagicR() {
7171 // all bit combinations for fr and all possible moves (toSqBB)
7272 cnt := bitCombs (0x0 , fr , fr , 0 , & maxM , & mRookTab [fr ], dirsR )
7373 _ = cnt
74- // fmt.Println("rook on", sq2Fen[fr], "#of combinations", cnt, "maxIx", maxM)
74+ // fmt.Println("rook on", sq2Fen[fr], "#of combinations", cnt, "maxIx", maxM)
7575 }
7676}
7777
@@ -96,7 +96,7 @@ func bitCombs(wBits bitBoard, fr, currSq, currIx int, maxM *int, mTabEntry *sMag
9696 }
9797 toBB := bitBoard (computeAtks (fr , dirs , uint64 (wBits )))
9898
99- if (* toSqBB )[int (m )] != 0x0 && (* toSqBB )[int (m )] != toBB && fr == F8 { // for bishop
99+ if (* toSqBB )[int (m )] != 0x0 && (* toSqBB )[int (m )] != toBB { // for bishop
100100 fmt .Println ("we have problem" , sq2Fen [fr ], "with ix" , int (m ), "wBits:\n " , bitBoard (wBits ).Stringln ())
101101 fmt .Println ((* toSqBB )[int (m )].Stringln ())
102102 fmt .Printf ("%X\n " , uint64 ((* toSqBB )[int (m )]))
@@ -251,7 +251,6 @@ func innerBAtks(sq int) uint64 {
251251 r --
252252 f ++
253253 }
254-
255254 return atkBB
256255}
257256
@@ -418,7 +417,7 @@ var nBBits = [64]int{
418417// Thanks to Tord Romstad code from:
419418// https://chessprogramming.wikispaces.com/Looking+for+Magics
420419// This site will soon be closed down and moved somewhere else
421- // Search for "Feeding in randoms Tord Romstad"
420+ // Search for "Feeding in randoms Tord Romstad"
422421
423422var magicB = [64 ]uint64 {
424423 0xc085080200420200 ,
@@ -573,4 +572,4 @@ func findDuplicates(toBBTab []bitBoard, fr int, magic uint64) int {
573572 }
574573 return cntDup
575574}
576- */
575+ */
0 commit comments