From 143ec53b666af873878e5ae0d082160f6438dc16 Mon Sep 17 00:00:00 2001 From: NoahLan <6995syu@163.com> Date: Mon, 18 Dec 2023 16:17:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20sync=E9=80=BB=E8=BE=91=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20setLevel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ngochess/gtp/gtp.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ngochess/gtp/gtp.go b/ngochess/gtp/gtp.go index 55000b9..4e9591a 100644 --- a/ngochess/gtp/gtp.go +++ b/ngochess/gtp/gtp.go @@ -327,12 +327,13 @@ func (e *GtpEngine) SetFreeHandicap(vexArr ...string) bool { // Sync 同步 // handicaps: points of all handicaps // plays: [][2]string -> [["B","A1"]] -func (e *GtpEngine) Sync(size int, komi float64, handicaps []string, plays [][]string) bool { +func (e *GtpEngine) Sync(size int, komi float64, level int, handicaps []string, plays [][]string) bool { // 1. komi // 2. boardsize - // 3. clear_board - // 4. set_free_handicap pos1 pos2 ... - // 5~n. play X XX + // 3. set_level + // 4. clear_board + // 5. set_free_handicap pos1 pos2 ... + // 6~n. play X XX playAllFn := func() bool { return narr.Every(plays, func(_ int, v []string) bool { @@ -346,6 +347,7 @@ func (e *GtpEngine) Sync(size int, komi float64, handicaps []string, plays [][]s return e.Komi(komi) && e.BoardSize(size) && + e.SetLevel(level) && e.ClearBoard() && e.SetFreeHandicap(handicaps...) && playAllFn()