0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

目指せ!第14回UEC杯コンピューター囲碁大会<本編> Step [O15o__10o0] 盤サイズの変更

Last updated at Posted at 2022-10-12

目指せ!第14回UEC杯コンピューター囲碁大会<本編> Step [O15o__10o0] 盤サイズの変更

連載の目次

📖 目指せ!第14回UEC杯コンピューター囲碁大会<本編>

Step [O15o__10o0] 盤サイズの変更 - resize コマンド

Step [O15o__11o0] コマンド実装 - kernel.go ファイル

👇 以下の既存ファイルを編集してほしい

  	📂 kifuwarabe-uec14
	├── 📂 kernel
  	│	├── 📄 board_area.go
  	│	├── 📄 o12o__11o1o0_board.go
	│	├── 📄 go.mod
👉 	│	├── 📄 kernel.go
 	│	├── 📄 logger.go
 	│	└── 📄 stone.go
    ├── 📄 .gitignore
 	├── 📄 engine_config.go
  	├── 📄 engine.toml
    ├── 📄 go.mod
  	├── 📄 go.work
	└── 📄 main.go

👇 がんばって、 Execute メソッドに挿入してほしい

// ...略...

	// この下にコマンドを挟んでいく
	// -------------------------

	case "boardsize": // [O15o__11o0]
		// Example: `boardsize 19`
		var sideLength, err = strconv.Atoi(tokens[1])

		if err != nil {
			logg.C.Infof("? unexpected sideLength:%s\n", tokens[1])
			logg.J.Infow("error", "sideLength", tokens[1])
			return true
		}

		k.Position.Board.Init(sideLength, sideLength)
		logg.C.Info("=\n")
		logg.J.Infow("ok")

		return true

	// ...略...

	// この上にコマンドを挟んでいく
	// -------------------------

// ...略...

Step [O15o__12o0] 動作確認

👇 以下のコマンドをコピーして、ターミナルに貼り付けてほしい

Input:

go run .

これで、思考エンジン内の入力待機ループに入った

👇 以下のコマンドをコピーして、ターミナルに貼り付けてほしい

Input:

boardsize 9

Output > Console:

[2022-09-12 20:44:12]   # boardsize 9
[2022-09-12 20:44:12]   =

Output > Log > Plain:

2022-09-12T20:44:12.860+0900	# boardsize 9
2022-09-12T20:44:12.896+0900	=

Output > Log > Json:

{"level":"info","ts":"2022-09-12T20:44:12.894+0900","caller":"kifuwarabe-uec14/main.go:61","msg":"input","command":"boardsize 9"}
{"level":"info","ts":"2022-09-12T20:44:12.896+0900","caller":"kernel/kernel.go:76","msg":"ok"}

Input:

board

Output:

[2022-09-12 20:56:20]   # board
[2022-09-12 20:56:20]   = board:'''
. +++++++++++
. +.........+
. +.........+
. +.........+
. +.........+
. +.........+
. +.........+
. +.........+
. +.........+
. +.........+
. +++++++++++
. '''

Step [O15o__13o0]

Removed

Step [O15o__13o1o0]

Moved to O11o__10o_2o0

Step [O15o__13o2o_1o0]

Moved to [O11o__10o_3o0]

Step [O15o__13o2o_2o0]

Moved to [O11o__10o_4o0]

Step [O15o__13o2o_3o0]

Merged to [O11o_3o0]

Step [O15o__13o2o_4o0]

Moved to [O11o__10o_6o0]

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?