Skip to content

Commit 7772042

Browse files
committed
handle go command in fenstring
1 parent 3d292d3 commit 7772042

File tree

3 files changed

+34
-11
lines changed

3 files changed

+34
-11
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33
*.pprof
44
*.png
55
*.gif
6+
*.jpg
67
*.svg
7-
temp.go
8+
*.c
9+
See_c/*.*
10+
temp.go
11+
See_c/SEE_Pradu.txt

.vscode/settings.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
"design.png": true,
55
"**/*.exe": true,
66
"**/*.png": true,
7-
".gitignore": true,
87
"temp.go": true,
98
"README.md": true,
109
"LICENSE": true,
11-
"uci_example.txt": true
12-
}
10+
"uci_example.txt": true,
11+
"**/*.jpg": true,
12+
".gitignore": true,
13+
"See_c": true
14+
},
15+
"cSpell.words": [
16+
"Pval",
17+
"finished"
18+
]
1319
}

move.go

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,33 @@ const (
1313
)
1414

1515
var pieceRules [nP][]int // not pawns
16-
type moveList struct {
17-
mv []move
18-
}
16+
1917
func init() {
2018
pieceRules[Rook] = append(pieceRules[Rook], E)
2119
pieceRules[Rook] = append(pieceRules[Rook], W)
2220
pieceRules[Rook] = append(pieceRules[Rook], N)
2321
pieceRules[Rook] = append(pieceRules[Rook], S)
2422
}
2523

26-
func (ml *moveList) add(mv move) {
27-
ml.mv = append(ml.mv, mv)
28-
}
29-
3024
type move uint64
25+
type moveList []move
26+
func (mvs *moveList) add(mv move) {
27+
*mvs = append(*mvs, mv)
28+
}
3129

3230
var ml = moveList{}
31+
32+
///////////////////////////////
33+
/*
34+
func (m move) pack(fr, to, cp, pr, ep, castl int) move {
35+
packed := uint32(0)
36+
packed = uint32(fr)
37+
packed |= uint32(to)<<6 // fr needs 6 bits first
38+
packed |= uint32(cp)<<(6+6) // fr+to needs 12 bits first
39+
packed |= uint32(pr)<<(6+6+4) // cp needs 4 bits (with color = p12)
40+
packed |= uint32(ep)<<(6+6+4+4) // pr needs 4 bits
41+
packed |= uint32(castl)<<(6+6+4+4+6) // ep needs 6 bits ( and castl needs 4)
42+
// we use 6+6+4+4+6+4 = 30 That means we have 32 bits left for move value
43+
return move(packed)
44+
}
45+
*/

0 commit comments

Comments
 (0)