将棋ウォーズで削除されたアカウントの棋譜を検討してみる

将棋ウォーズで大会のランキング1位になったプレーヤー(以下「件のプレーヤー」と呼ぶ)が大会直後にアカウントを消したということで,ごく一部の界隈が盛り上がっている.

詳しくは以下の記事などを参照してほしい.

偶然にも当該アカウントの棋譜を取得してあったので,その棋譜を少しだけ検討してみる.

検討する

前回の記事

将棋ウォーズのデータを解析する - 盗んだ統計で走り出す

で使ったデータをそのまま流用する.データの詳細についてはそちらを参照してほしい.

In [1]:
import pymongo
from collections import Counter
import re
from scipy.stats import poisson
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline

connection = pymongo.Connection('localhost',27017)
db = connection.warskifu
col = db.kifu

MongoDBから件のアカウントが指した対局の棋譜を抜き出す.

In [2]:
user = u'junpe_'
userlist = list(col.find({"$or":[{"user0":user},{"user1":user}]}))
len(userlist)
Out[2]:
74

DBには74件登録されていた.件のアカウントの大会での成績は144勝27敗だったので,大会における件のプレーヤーが指した全対局の半分弱しか取得できていない.残りの対局は10秒指し以外のルールで指したか,あるいは大会期間の始めのほう(だいたい10月1〜5日)で指したと考えられる.

件のプレーヤーの対局のURL

In [3]:
for j in userlist:
    print 'http://shogiwars.heroz.jp:3002/games/' + j[u'_id']
http://shogiwars.heroz.jp:3002/games/junpe_-Pona3-20141019_082731
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141019_073208
http://shogiwars.heroz.jp:3002/games/HashiPona-junpe_-20141019_072806
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141018_220432
http://shogiwars.heroz.jp:3002/games/Pona4-junpe_-20141018_220018
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141018_213420
http://shogiwars.heroz.jp:3002/games/junpe_-HashiPona-20141016_061753
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141015_105634
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141015_100034
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141014_193040
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141014_185133
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141014_184117
http://shogiwars.heroz.jp:3002/games/MOBILE_ARMOR-junpe_-20141014_182436
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141014_181656
http://shogiwars.heroz.jp:3002/games/junpe_-Boss_bitou-20141014_180957
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141014_180208
http://shogiwars.heroz.jp:3002/games/junpe_-cosmonaut1-20141014_014210
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141014_012324
http://shogiwars.heroz.jp:3002/games/Pona1Jan-junpe_-20141013_193948
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141012_202033
http://shogiwars.heroz.jp:3002/games/junpe_-Pona3-20141012_200810
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141012_194903
http://shogiwars.heroz.jp:3002/games/Pona4-junpe_-20141012_144205
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141012_142812
http://shogiwars.heroz.jp:3002/games/Pona1Jan-junpe_-20141012_140302
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141012_133054
http://shogiwars.heroz.jp:3002/games/junpe_-erfallen-20141009_205219
http://shogiwars.heroz.jp:3002/games/magewappa-junpe_-20141009_204219
http://shogiwars.heroz.jp:3002/games/junpe_-MOBILE_ARMOR-20141009_203347
http://shogiwars.heroz.jp:3002/games/junpe_-Falkenborg-20141009_202555
http://shogiwars.heroz.jp:3002/games/junpe_-Keiji_Maeda-20141009_201915
http://shogiwars.heroz.jp:3002/games/junpe_-MOBILE_ARMOR-20141009_200806
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141009_195843
http://shogiwars.heroz.jp:3002/games/HashiPona-junpe_-20141009_195424
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141009_194719
http://shogiwars.heroz.jp:3002/games/junpe_-GTR600-20141009_193308
http://shogiwars.heroz.jp:3002/games/junpe_-sakurasayaka-20141009_185757
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141009_185006
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141009_181749
http://shogiwars.heroz.jp:3002/games/junpe_-masatooo32-20141009_093023
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141009_091452
http://shogiwars.heroz.jp:3002/games/Pona3-junpe_-20141007_095111
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141007_094137
http://shogiwars.heroz.jp:3002/games/junpe_-2_tsutsukana-20141007_055053
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141007_053951
http://shogiwars.heroz.jp:3002/games/LION_FX-junpe_-20141007_053836
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141007_053330
http://shogiwars.heroz.jp:3002/games/Pona4-junpe_-20141007_052734
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141007_045759
http://shogiwars.heroz.jp:3002/games/shibaura-junpe_-20141007_045153
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141007_044326
http://shogiwars.heroz.jp:3002/games/miya_with_r-junpe_-20141006_205059
http://shogiwars.heroz.jp:3002/games/junpe_-aoba81-20141006_203132
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141006_075815
http://shogiwars.heroz.jp:3002/games/Pona1Jan-junpe_-20141006_075302
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141006_074604
http://shogiwars.heroz.jp:3002/games/junpe_-CharcoalFilter-20141005_223646
http://shogiwars.heroz.jp:3002/games/junpe_-yuta717-20141005_223132
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141005_221409
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141005_220325
http://shogiwars.heroz.jp:3002/games/junpe_-atsutodo-20141005_215600
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141005_194448
http://shogiwars.heroz.jp:3002/games/kazkiti-junpe_-20141005_125305
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141005_122043
http://shogiwars.heroz.jp:3002/games/tats3256-junpe_-20141005_120137
http://shogiwars.heroz.jp:3002/games/Pona3-junpe_-20141005_102337
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141005_092007
http://shogiwars.heroz.jp:3002/games/Macone-junpe_-20141005_091258
http://shogiwars.heroz.jp:3002/games/anzu17-junpe_-20141005_083908
http://shogiwars.heroz.jp:3002/games/junpe_-1_tsutsukana-20141005_082812
http://shogiwars.heroz.jp:3002/games/ttk234-junpe_-20141005_082430
http://shogiwars.heroz.jp:3002/games/junpe_-takekoma-20141005_082029
http://shogiwars.heroz.jp:3002/games/joutatu2013-junpe_-20141005_031327
http://shogiwars.heroz.jp:3002/games/1_tsutsukana-junpe_-20141005_030104

件のプレーヤーと2局以上対局したプレーヤーを列挙してみる.

In [18]:
user_count = []
user_count.extend([_user[u'user0'] for _user in userlist])
user_count.extend([_user[u'user1'] for _user in userlist])

counter = Counter(user_count)

for u, count in counter.most_common():
    print u, count
junpe_ 74
1_tsutsukana 34
Pona3 4
Pona1Jan 3
HashiPona 3
MOBILE_ARMOR 3
Pona4 3
takekoma 1
ttk234 1
magewappa 1
sakurasayaka 1
miya_with_r 1
masatooo32 1
2_tsutsukana 1
Boss_bitou 1
LION_FX 1
Falkenborg 1
anzu17 1
yuta717 1
cosmonaut1 1
shibaura 1
GTR600 1
CharcoalFilter 1
aoba81 1
atsutodo 1
erfallen 1
kazkiti 1
Macone 1
Keiji_Maeda 1
tats3256 1
joutatu2013 1

やけにツツカナとの対局が多いような気がする.

ツツカナとの対戦成績を見てみる.

In [17]:
winner = []
for i in range(len(userlist)):
    csa = userlist[i][u'csa']
    userdata = userlist[i]
    caption = ""
    
    win = len(re.findall(r'[\+|-]',csa))%2
    if win==1: ## 先手勝ち
        _winner = userdata[u'user0']
    else:
        _winner = userdata[u'user1']
        
    caption =  _winner + '; {0} vs. {1}\n'.format(userdata[u'user0'], userdata[u'user1'])
    if caption.find('tsutsukana') > 0:
        winner.append(_winner)
        print caption,

print 
counter = Counter(winner)

for u, count in counter.most_common():
    print u, count
1_tsutsukana; 1_tsutsukana vs. junpe_
junpe_; 1_tsutsukana vs. junpe_
1_tsutsukana; junpe_ vs. 1_tsutsukana
1_tsutsukana; 1_tsutsukana vs. junpe_
junpe_; junpe_ vs. 1_tsutsukana
junpe_; junpe_ vs. 1_tsutsukana
junpe_; junpe_ vs. 1_tsutsukana
1_tsutsukana; 1_tsutsukana vs. junpe_
junpe_; junpe_ vs. 1_tsutsukana
1_tsutsukana; 1_tsutsukana vs. junpe_
junpe_; junpe_ vs. 1_tsutsukana
junpe_; junpe_ vs. 1_tsutsukana
junpe_; junpe_ vs. 1_tsutsukana
junpe_; junpe_ vs. 1_tsutsukana
junpe_; junpe_ vs. 1_tsutsukana
junpe_; 1_tsutsukana vs. junpe_
1_tsutsukana; junpe_ vs. 1_tsutsukana
junpe_; 1_tsutsukana vs. junpe_
junpe_; 1_tsutsukana vs. junpe_
junpe_; 1_tsutsukana vs. junpe_
1_tsutsukana; junpe_ vs. 1_tsutsukana
2_tsutsukana; junpe_ vs. 2_tsutsukana
junpe_; junpe_ vs. 1_tsutsukana
1_tsutsukana; 1_tsutsukana vs. junpe_
junpe_; 1_tsutsukana vs. junpe_
junpe_; junpe_ vs. 1_tsutsukana
junpe_; 1_tsutsukana vs. junpe_
1_tsutsukana; junpe_ vs. 1_tsutsukana
junpe_; 1_tsutsukana vs. junpe_
1_tsutsukana; 1_tsutsukana vs. junpe_
junpe_; junpe_ vs. 1_tsutsukana
junpe_; junpe_ vs. 1_tsutsukana
junpe_; 1_tsutsukana vs. junpe_
junpe_; junpe_ vs. 1_tsutsukana
1_tsutsukana; 1_tsutsukana vs. junpe_

junpe_ 23
1_tsutsukana 11
2_tsutsukana 1

対ツツカナ(1_tsutsukana or 2_tsutsukana)で23勝12敗であった.

次に件のプレーヤーの持ち時間の使い方を見てみる

In [5]:
u = []
for i in range(len(userlist)):
    csa = userlist[i][u'csa']
    userdata = userlist[i]
    caption = ""
    
    win = len(re.findall(r'[\+|-]',csa))%2
    if win==1: ## 先手勝ち
        caption = userdata[u'user0']
    else:
        caption = userdata[u'user1']
        
    caption +=  ';  {0} vs. {1}\n'.format(userdata[u'user0'], userdata[u'user1'])
    caption += userdata[u'_id']
    
    user0_time = []
    user1_time = []
    
    for j,c in enumerate(csa.split('\n')):
        if (j+1)%4==0:
            user1_time.append(int(c.replace('T', '')))
        elif (j+1)%2==0:
            user0_time.append(int(c.replace('T', '')))
    
    _u = []
    if userdata[u'user0']==user:
        _u = user0_time
    elif userdata[u'user1']==user:
        _u = user1_time
    u.extend(_u)

    plt.plot(_u)
    plt.ylim(0,10)
    plt.title(caption)
    plt.figure()
/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py:423: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_num_figures`).
  max_open_warning, RuntimeWarning)