facebook twitter hatena line email

「将棋プログラム/フリーライブラリ」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(技巧をつかったサーバーレスAPI)
(上記qiitaのna-o-ysさんの技巧を使ったAPIのレスポンス例)
 
(同じ利用者による、間の5版が非表示)
行3: 行3:
 
==技巧をつかったサーバーレスAPI==
 
==技巧をつかったサーバーレスAPI==
 
https://qiita.com/na-o-ys/items/b04ce27732c82b6beb9b
 
https://qiita.com/na-o-ys/items/b04ce27732c82b6beb9b
 +
https://qiita.com/muzudho1/items/8f940f8b4c679c23a174
  
 
以下コマンドを実行すればコンソールで実行できる
 
以下コマンドを実行すればコンソールで実行できる
  
 
https://hub.docker.com/r/naoys/gikou/
 
https://hub.docker.com/r/naoys/gikou/
 
  
 
  docker run -it naoys/gikou
 
  docker run -it naoys/gikou
 
  (interactive USI session)
 
  (interactive USI session)
 
  > usi
 
  > usi
id name Gikou 20160606
+
続きは以下をusiを参考
id author Yosuke Demura
+
 
option name BookMaxPly type spin default 50 min 0 max 50
+
[[将棋プログラム/技巧/mac]] [ショートカット]
option name ByoyomiMargin type spin default 100 min 0 max 10000
+
 
option name DrawScore type spin default 0 min -200 max 200
+
==上記qiitaのna-o-ysさんの技巧を使ったAPIのレスポンス例==
  option name FischerMargin type spin default 12000 min 0 max 60000
+
ttps://17xn1ovxga.execute-api.ap-northeast-1.amazonaws.com/production/gikou?byoyomi=1&position=sfen+lnB2gsnl%2f5s1k1%2fprp%2bPppgpp%2f3R2p2%2f1p7%2f2P6%2fPPN1PPPPP%2f2S4K1%2fL2G1GSNL+w+bp+1
option name MinBookScoreForBlack type spin default 0 min -500 max 500
+
option name MinBookScoreForWhite type spin default -180 min -500 max 500
+
option name MinThinkingTime type spin default 1000 min 10 max 60000
+
option name MultiPV type spin default 1 min 1 max 700
+
option name NarrowBook type check default false
+
option name OwnBook type check default true
+
option name SuddenDeathMargin type spin default 60 min 0 max 600
+
option name Threads type spin default 2 min 1 max 64
+
option name TinyBook type check default false
+
usiok
+
> setoption name USI_Ponder value false
+
> setoption name USI_Hash value 256
+
> setoption name MultiPV value 1
+
> isready
+
readyok
+
> usinewgame
+
> position startpos moves 2g2f 8c8d 7g7f 4a3b 6i7h 8d8e 8h7g 3c3d 7i8h 2b7g+ 8h7g 3a4b 3i3h 7a7b 4g4f 6c6d 3g3f 7b6c 5i6h 4b3c 3h4g 7c7d
+
> go btime 0 wtime 0 byoyomi 3000
+
info depth 1 seldepth 1 time 1 nodes 190 nps 190000 hashfull 142 score cp 151 multipv 1 pv 6h7i
+
info depth 2 seldepth 2 time 1 nodes 827 nps 827000 hashfull 142 score cp 227 multipv 1 pv 4i5h 6a5b
+
...
+
info depth 21 seldepth 22 time 2904 nodes 2092176 nps 720446 hashfull 176 score cp 104 multipv 1 pv 9g9f 9c9d 1g1f 1c1d 6h7i 6a5b 2i3g 8a7c 6g6f 5a4b 4g5f 6c5d 4f4e 4b3a 4i5h 5b6c 2h4h 6d6e 6f6e 5d6e
+
bestmove 9g9f
+
  
局面をsfenでも入力できた
+
<pre>
> sfen lnsg1k3/1r3+P3/p1ppp3p/7+B1/6p2/1+pP2L3/P2PPPP1P/9/LNSGKGSNL w BGSNP2r 1
+
{"request":{"byoyomi":"1","position":"sfen lnB2gsnl/5s1k1/prp+Pppgpp/3R2p2/1p7/2P6/PPN1PPPPP/2S4K1/L2G1GSNL w bp 1"},"bestmove":"8e8f","bestpv":{"pv":["8e8f","8g8f","8c8f","6c5c","8f8h+","5c4b","3a4b"],"raw_string":"info depth 7 seldepth 7 time 10 nodes 5672 nps 567200 hashfull 0 score cp -1229 multipv 1 pv 8e8f 8g8f 8c8f 6c5c 8f8h+ 5c4b 3a4b","depth":7,"seldepth":7,"time":10,"nodes":5672,"nps":567200,"hashfull":0,"score_cp":-1229,"multipv":1},"info_list":[{"pv":["8e8f","8g8f"],"raw_string":"info depth 1 seldepth 1 time 3 nodes 1238 nps 412666 hashfull 0 score cp -1175 multipv 1 pv 8e8f 8g8f","depth":1,"seldepth":1,"time":3,"nodes":1238,"nps":412666,"hashfull":0,"score_cp":-1175,"multipv":1},{"pv":["8e8f","8g8f"],"raw_string":"info depth 2 seldepth 2 time 3 nodes 1529 nps 509666 hashfull 0 score cp -1175 multipv 1 pv 8e8f 8g8f","depth":2,"seldepth":2,"time":3,"nodes":1529,"nps":509666,"hashfull":0,"score_cp":-1175,"multipv":1},{"pv":["8e8f","8g8f","8c8f"],"raw_string":"info depth 3 seldepth 3 time 4 nodes 1862 nps 465500 hashfull 0 score cp -1263 multipv 1 pv 8e8f 8g8f 8c8f","depth":3,"seldepth":3,"time":4,"nodes":1862,"nps":465500,"hashfull":0,"score_cp":-1263,"multipv":1},{"pv":["8e8f","8g8f","8c8f","6c5c"],"raw_string":"info depth 4 seldepth 4 time 5 nodes 2258 nps 451600 hashfull 0 score cp -1263 multipv 1 pv 8e8f 8g8f 8c8f 6c5c","depth":4,"seldepth":4,"time":5,"nodes":2258,"nps":451600,"hashfull":0,"score_cp":-1263,"multipv":1},{"pv":["8e8f","8g8f","8c8f","6c5c","8f8h+"],"raw_string":"info depth 5 seldepth 5 time 5 nodes 2863 nps 572600 hashfull 0 score cp -1270 multipv 1 pv 8e8f 8g8f 8c8f 6c5c 8f8h+","depth":5,"seldepth":5,"time":5,"nodes":2863,"nps":572600,"hashfull":0,"score_cp":-1270,"multipv":1},{"pv":["8e8f","8g8f","8c8f","6c5c","8f8h+","6d6a+"],"raw_string":"info depth 6 seldepth 6 time 7 nodes 3956 nps 565142 hashfull 0 score cp -1270 multipv 1 pv 8e8f 8g8f 8c8f 6c5c 8f8h+ 6d6a+","depth":6,"seldepth":6,"time":7,"nodes":3956,"nps":565142,"hashfull":0,"score_cp":-1270,"multipv":1},{"pv":["8e8f","8g8f","8c8f","6c5c","8f8h+","5c4b","3a4b"],"raw_string":"info depth 7 seldepth 7 time 10 nodes 5672 nps 567200 hashfull 0 score cp -1229 multipv 1 pv 8e8f 8g8f 8c8f 6c5c 8f8h+ 5c4b 3a4b","depth":7,"seldepth":7,"time":10,"nodes":5672,"nps":567200,"hashfull":0,"score_cp":-1229,"multipv":1}]}
> go btime 0 wtime 0 byoyomi 3000
+
</pre>
info depth 1 seldepth 1 time 1 nodes 2 nps 2000 hashfull 0 score mate -2 multipv 1 pv 8b4b
+
info depth 2 seldepth 3 time 1 nodes 5 nps 5000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
+
info depth 3 seldepth 3 time 1 nodes 8 nps 8000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
+
info depth 4 seldepth 3 time 1 nodes 11 nps 11000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
+
info depth 5 seldepth 3 time 1 nodes 14 nps 14000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
+
info depth 6 seldepth 3 time 1 nodes 17 nps 17000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
+
info depth 7 seldepth 3 time 1 nodes 20 nps 20000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
+
info depth 8 seldepth 3 time 1 nodes 23 nps 23000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
+
info depth 9 seldepth 3 time 1 nodes 26 nps 26000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
+
bestmove 8b4b
+

2018年12月8日 (土) 01:28時点における最新版

http://www.computer-shogi.org/library/

技巧をつかったサーバーレスAPI

https://qiita.com/na-o-ys/items/b04ce27732c82b6beb9b https://qiita.com/muzudho1/items/8f940f8b4c679c23a174

以下コマンドを実行すればコンソールで実行できる

https://hub.docker.com/r/naoys/gikou/

docker run -it naoys/gikou
(interactive USI session)
> usi

続きは以下をusiを参考

将棋プログラム/技巧/mac [ショートカット]

上記qiitaのna-o-ysさんの技巧を使ったAPIのレスポンス例

ttps://17xn1ovxga.execute-api.ap-northeast-1.amazonaws.com/production/gikou?byoyomi=1&position=sfen+lnB2gsnl%2f5s1k1%2fprp%2bPppgpp%2f3R2p2%2f1p7%2f2P6%2fPPN1PPPPP%2f2S4K1%2fL2G1GSNL+w+bp+1

{"request":{"byoyomi":"1","position":"sfen lnB2gsnl/5s1k1/prp+Pppgpp/3R2p2/1p7/2P6/PPN1PPPPP/2S4K1/L2G1GSNL w bp 1"},"bestmove":"8e8f","bestpv":{"pv":["8e8f","8g8f","8c8f","6c5c","8f8h+","5c4b","3a4b"],"raw_string":"info depth 7 seldepth 7 time 10 nodes 5672 nps 567200 hashfull 0 score cp -1229 multipv 1 pv 8e8f 8g8f 8c8f 6c5c 8f8h+ 5c4b 3a4b","depth":7,"seldepth":7,"time":10,"nodes":5672,"nps":567200,"hashfull":0,"score_cp":-1229,"multipv":1},"info_list":[{"pv":["8e8f","8g8f"],"raw_string":"info depth 1 seldepth 1 time 3 nodes 1238 nps 412666 hashfull 0 score cp -1175 multipv 1 pv 8e8f 8g8f","depth":1,"seldepth":1,"time":3,"nodes":1238,"nps":412666,"hashfull":0,"score_cp":-1175,"multipv":1},{"pv":["8e8f","8g8f"],"raw_string":"info depth 2 seldepth 2 time 3 nodes 1529 nps 509666 hashfull 0 score cp -1175 multipv 1 pv 8e8f 8g8f","depth":2,"seldepth":2,"time":3,"nodes":1529,"nps":509666,"hashfull":0,"score_cp":-1175,"multipv":1},{"pv":["8e8f","8g8f","8c8f"],"raw_string":"info depth 3 seldepth 3 time 4 nodes 1862 nps 465500 hashfull 0 score cp -1263 multipv 1 pv 8e8f 8g8f 8c8f","depth":3,"seldepth":3,"time":4,"nodes":1862,"nps":465500,"hashfull":0,"score_cp":-1263,"multipv":1},{"pv":["8e8f","8g8f","8c8f","6c5c"],"raw_string":"info depth 4 seldepth 4 time 5 nodes 2258 nps 451600 hashfull 0 score cp -1263 multipv 1 pv 8e8f 8g8f 8c8f 6c5c","depth":4,"seldepth":4,"time":5,"nodes":2258,"nps":451600,"hashfull":0,"score_cp":-1263,"multipv":1},{"pv":["8e8f","8g8f","8c8f","6c5c","8f8h+"],"raw_string":"info depth 5 seldepth 5 time 5 nodes 2863 nps 572600 hashfull 0 score cp -1270 multipv 1 pv 8e8f 8g8f 8c8f 6c5c 8f8h+","depth":5,"seldepth":5,"time":5,"nodes":2863,"nps":572600,"hashfull":0,"score_cp":-1270,"multipv":1},{"pv":["8e8f","8g8f","8c8f","6c5c","8f8h+","6d6a+"],"raw_string":"info depth 6 seldepth 6 time 7 nodes 3956 nps 565142 hashfull 0 score cp -1270 multipv 1 pv 8e8f 8g8f 8c8f 6c5c 8f8h+ 6d6a+","depth":6,"seldepth":6,"time":7,"nodes":3956,"nps":565142,"hashfull":0,"score_cp":-1270,"multipv":1},{"pv":["8e8f","8g8f","8c8f","6c5c","8f8h+","5c4b","3a4b"],"raw_string":"info depth 7 seldepth 7 time 10 nodes 5672 nps 567200 hashfull 0 score cp -1229 multipv 1 pv 8e8f 8g8f 8c8f 6c5c 8f8h+ 5c4b 3a4b","depth":7,"seldepth":7,"time":10,"nodes":5672,"nps":567200,"hashfull":0,"score_cp":-1229,"multipv":1}]}