bioshogi 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (820) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.ruby-version +3 -0
  4. data/.travis.yml +14 -0
  5. data/Brewfile +2 -0
  6. data/Gemfile +2 -0
  7. data/Gemfile.lock +135 -0
  8. data/LICENSE +661 -0
  9. data/NEW_README.md +27 -0
  10. data/README.org +711 -0
  11. data/Rakefile +3 -0
  12. data/bin/bioshogi +3 -0
  13. data/bioshogi.gemspec +44 -0
  14. data/bioshogi.png +0 -0
  15. data/credit.org +6 -0
  16. data/lib/bioshogi/ai/brain.rb +202 -0
  17. data/lib/bioshogi/ai/diver/base.rb +114 -0
  18. data/lib/bioshogi/ai/diver/nega_alpha_diver.rb +122 -0
  19. data/lib/bioshogi/ai/diver/nega_alpha_mate_diver.rb +212 -0
  20. data/lib/bioshogi/ai/diver/nega_max_diver.rb +58 -0
  21. data/lib/bioshogi/ai/diver/nega_scout_diver.rb +120 -0
  22. data/lib/bioshogi/ai/evaluator/attack_weight_table.rb +52 -0
  23. data/lib/bioshogi/ai/evaluator/base.rb +40 -0
  24. data/lib/bioshogi/ai/evaluator/level0.rb +25 -0
  25. data/lib/bioshogi/ai/evaluator/level1.rb +26 -0
  26. data/lib/bioshogi/ai/evaluator/level2.rb +31 -0
  27. data/lib/bioshogi/ai/evaluator/level3.rb +121 -0
  28. data/lib/bioshogi/ai/evaluator/level4.rb +43 -0
  29. data/lib/bioshogi/ai/evaluator/opening_basic_table.rb +108 -0
  30. data/lib/bioshogi/ai/player_brain_mod.rb +142 -0
  31. data/lib/bioshogi/ai.rb +5 -0
  32. data/lib/bioshogi/application_memory_record.rb +28 -0
  33. data/lib/bioshogi/assertion.rb +20 -0
  34. data/lib/bioshogi/assets/audios/any.band/Alternatives/000/DisplayState.plist +0 -0
  35. data/lib/bioshogi/assets/audios/any.band/Alternatives/000/DisplayStateArchive +0 -0
  36. data/lib/bioshogi/assets/audios/any.band/Alternatives/000/MetaData.plist +0 -0
  37. data/lib/bioshogi/assets/audios/any.band/Alternatives/000/ProjectData +0 -0
  38. data/lib/bioshogi/assets/audios/any.band/Alternatives/000/WindowImage.jpg +0 -0
  39. data/lib/bioshogi/assets/audios/any.band/Media/Audio Files/Strategy.caf +0 -0
  40. data/lib/bioshogi/assets/audios/any.band/Resources/ProjectInformation.plist +0 -0
  41. data/lib/bioshogi/assets/audios/any.band/projectData +3183 -0
  42. data/lib/bioshogi/assets/audios/blank.m4a +0 -0
  43. data/lib/bioshogi/assets/audios/blank.wav +0 -0
  44. data/lib/bioshogi/assets/audios/blank1.m4a +0 -0
  45. data/lib/bioshogi/assets/audios/blank2.m4a +0 -0
  46. data/lib/bioshogi/assets/audios/blank3.m4a +0 -0
  47. data/lib/bioshogi/assets/audios/breakbeat_long.band/Alternatives/000/DisplayState.plist +0 -0
  48. data/lib/bioshogi/assets/audios/breakbeat_long.band/Alternatives/000/DisplayStateArchive +0 -0
  49. data/lib/bioshogi/assets/audios/breakbeat_long.band/Alternatives/000/MetaData.plist +0 -0
  50. data/lib/bioshogi/assets/audios/breakbeat_long.band/Alternatives/000/ProjectData +0 -0
  51. data/lib/bioshogi/assets/audios/breakbeat_long.band/Alternatives/000/WindowImage.jpg +0 -0
  52. data/lib/bioshogi/assets/audios/breakbeat_long.band/Resources/ProjectInformation.plist +0 -0
  53. data/lib/bioshogi/assets/audios/breakbeat_long.band/projectData +3183 -0
  54. data/lib/bioshogi/assets/audios/breakbeat_long.m4a +0 -0
  55. data/lib/bioshogi/assets/audios/breakbeat_long_old.m4a +0 -0
  56. data/lib/bioshogi/assets/audios/breakbeat_long_strip.band/Alternatives/000/DisplayState.plist +0 -0
  57. data/lib/bioshogi/assets/audios/breakbeat_long_strip.band/Alternatives/000/DisplayStateArchive +0 -0
  58. data/lib/bioshogi/assets/audios/breakbeat_long_strip.band/Alternatives/000/MetaData.plist +0 -0
  59. data/lib/bioshogi/assets/audios/breakbeat_long_strip.band/Alternatives/000/ProjectData +0 -0
  60. data/lib/bioshogi/assets/audios/breakbeat_long_strip.band/Alternatives/000/WindowImage.jpg +0 -0
  61. data/lib/bioshogi/assets/audios/breakbeat_long_strip.band/Media/Audio Files/Strategy.caf +0 -0
  62. data/lib/bioshogi/assets/audios/breakbeat_long_strip.band/Resources/ProjectInformation.plist +0 -0
  63. data/lib/bioshogi/assets/audios/breakbeat_long_strip.band/projectData +3183 -0
  64. data/lib/bioshogi/assets/audios/breakbeat_long_strip.m4a +0 -0
  65. data/lib/bioshogi/assets/audios/china_like.band/Alternatives/000/DisplayState.plist +0 -0
  66. data/lib/bioshogi/assets/audios/china_like.band/Alternatives/000/DisplayStateArchive +0 -0
  67. data/lib/bioshogi/assets/audios/china_like.band/Alternatives/000/MetaData.plist +0 -0
  68. data/lib/bioshogi/assets/audios/china_like.band/Alternatives/000/ProjectData +0 -0
  69. data/lib/bioshogi/assets/audios/china_like.band/Alternatives/000/WindowImage.jpg +0 -0
  70. data/lib/bioshogi/assets/audios/china_like.band/Resources/ProjectInformation.plist +0 -0
  71. data/lib/bioshogi/assets/audios/china_like.band/projectData +3183 -0
  72. data/lib/bioshogi/assets/audios/china_like_a.m4a +0 -0
  73. data/lib/bioshogi/assets/audios/china_like_b.m4a +0 -0
  74. data/lib/bioshogi/assets/audios/convert.sh +52 -0
  75. data/lib/bioshogi/assets/audios/diamond_shark.m4a +0 -0
  76. data/lib/bioshogi/assets/audios/digit_blast_layers.band/Alternatives/000/DisplayState.plist +0 -0
  77. data/lib/bioshogi/assets/audios/digit_blast_layers.band/Alternatives/000/DisplayStateArchive +0 -0
  78. data/lib/bioshogi/assets/audios/digit_blast_layers.band/Alternatives/000/MetaData.plist +0 -0
  79. data/lib/bioshogi/assets/audios/digit_blast_layers.band/Alternatives/000/ProjectData +0 -0
  80. data/lib/bioshogi/assets/audios/digit_blast_layers.band/Alternatives/000/WindowImage.jpg +0 -0
  81. data/lib/bioshogi/assets/audios/digit_blast_layers.band/Resources/ProjectInformation.plist +0 -0
  82. data/lib/bioshogi/assets/audios/digit_blast_layers.band/projectData +3183 -0
  83. data/lib/bioshogi/assets/audios/ds1022.m4a +0 -0
  84. data/lib/bioshogi/assets/audios/ds1022.mp3 +0 -0
  85. data/lib/bioshogi/assets/audios/ds10827.m4a +0 -0
  86. data/lib/bioshogi/assets/audios/ds10827.mp3 +0 -0
  87. data/lib/bioshogi/assets/audios/ds11184.m4a +0 -0
  88. data/lib/bioshogi/assets/audios/ds11184.mp3 +0 -0
  89. data/lib/bioshogi/assets/audios/ds13037.m4a +0 -0
  90. data/lib/bioshogi/assets/audios/ds13037.mp3 +0 -0
  91. data/lib/bioshogi/assets/audios/ds13513.m4a +0 -0
  92. data/lib/bioshogi/assets/audios/ds13513.mp3 +0 -0
  93. data/lib/bioshogi/assets/audios/ds14640.m4a +0 -0
  94. data/lib/bioshogi/assets/audios/ds14640.mp3 +0 -0
  95. data/lib/bioshogi/assets/audios/ds1982.m4a +0 -0
  96. data/lib/bioshogi/assets/audios/ds1982.mp3 +0 -0
  97. data/lib/bioshogi/assets/audios/ds2142.m4a +0 -0
  98. data/lib/bioshogi/assets/audios/ds2142.mp3 +0 -0
  99. data/lib/bioshogi/assets/audios/ds3479.m4a +0 -0
  100. data/lib/bioshogi/assets/audios/ds3479.mp3 +0 -0
  101. data/lib/bioshogi/assets/audios/ds3480.m4a +0 -0
  102. data/lib/bioshogi/assets/audios/ds3480.mp3 +0 -0
  103. data/lib/bioshogi/assets/audios/ds3812.m4a +0 -0
  104. data/lib/bioshogi/assets/audios/ds3812.mp3 +0 -0
  105. data/lib/bioshogi/assets/audios/ds3895.m4a +0 -0
  106. data/lib/bioshogi/assets/audios/ds3895.mp3 +0 -0
  107. data/lib/bioshogi/assets/audios/ds4520.m4a +0 -0
  108. data/lib/bioshogi/assets/audios/ds4520.mp3 +0 -0
  109. data/lib/bioshogi/assets/audios/ds4616.m4a +0 -0
  110. data/lib/bioshogi/assets/audios/ds4616.mp3 +0 -0
  111. data/lib/bioshogi/assets/audios/ds5615.m4a +0 -0
  112. data/lib/bioshogi/assets/audios/ds5615.mp3 +0 -0
  113. data/lib/bioshogi/assets/audios/ds5616.m4a +0 -0
  114. data/lib/bioshogi/assets/audios/ds5616.mp3 +0 -0
  115. data/lib/bioshogi/assets/audios/ds568.m4a +0 -0
  116. data/lib/bioshogi/assets/audios/ds568.mp3 +0 -0
  117. data/lib/bioshogi/assets/audios/ds7138.m4a +0 -0
  118. data/lib/bioshogi/assets/audios/ds7138.mp3 +0 -0
  119. data/lib/bioshogi/assets/audios/ds8705.m4a +0 -0
  120. data/lib/bioshogi/assets/audios/ds8705.mp3 +0 -0
  121. data/lib/bioshogi/assets/audios/foo.band/Alternatives/000/DisplayState.plist +0 -0
  122. data/lib/bioshogi/assets/audios/foo.band/Alternatives/000/DisplayStateArchive +0 -0
  123. data/lib/bioshogi/assets/audios/foo.band/Alternatives/000/MetaData.plist +0 -0
  124. data/lib/bioshogi/assets/audios/foo.band/Alternatives/000/ProjectData +0 -0
  125. data/lib/bioshogi/assets/audios/foo.band/Alternatives/000/WindowImage.jpg +0 -0
  126. data/lib/bioshogi/assets/audios/foo.band/Media/Audio Files/Strategy.caf +0 -0
  127. data/lib/bioshogi/assets/audios/foo.band/Resources/ProjectInformation.plist +0 -0
  128. data/lib/bioshogi/assets/audios/foo.band/projectData +3183 -0
  129. data/lib/bioshogi/assets/audios/headspin_long.band/Alternatives/000/DisplayState.plist +0 -0
  130. data/lib/bioshogi/assets/audios/headspin_long.band/Alternatives/000/DisplayStateArchive +0 -0
  131. data/lib/bioshogi/assets/audios/headspin_long.band/Alternatives/000/MetaData.plist +0 -0
  132. data/lib/bioshogi/assets/audios/headspin_long.band/Alternatives/000/ProjectData +0 -0
  133. data/lib/bioshogi/assets/audios/headspin_long.band/Alternatives/000/WindowImage.jpg +0 -0
  134. data/lib/bioshogi/assets/audios/headspin_long.band/Resources/ProjectInformation.plist +0 -0
  135. data/lib/bioshogi/assets/audios/headspin_long.band/projectData +3183 -0
  136. data/lib/bioshogi/assets/audios/headspin_long.m4a +0 -0
  137. data/lib/bioshogi/assets/audios/loop_bgm_i.band/Alternatives/000/DisplayState.plist +0 -0
  138. data/lib/bioshogi/assets/audios/loop_bgm_i.band/Alternatives/000/DisplayStateArchive +0 -0
  139. data/lib/bioshogi/assets/audios/loop_bgm_i.band/Alternatives/000/MetaData.plist +0 -0
  140. data/lib/bioshogi/assets/audios/loop_bgm_i.band/Alternatives/000/ProjectData +0 -0
  141. data/lib/bioshogi/assets/audios/loop_bgm_i.band/Alternatives/000/WindowImage.jpg +0 -0
  142. data/lib/bioshogi/assets/audios/loop_bgm_i.band/Resources/ProjectInformation.plist +0 -0
  143. data/lib/bioshogi/assets/audios/loop_bgm_i.band/projectData +3183 -0
  144. data/lib/bioshogi/assets/audios/mastermind.band/Alternatives/000/DisplayState.plist +0 -0
  145. data/lib/bioshogi/assets/audios/mastermind.band/Alternatives/000/DisplayStateArchive +0 -0
  146. data/lib/bioshogi/assets/audios/mastermind.band/Alternatives/000/MetaData.plist +0 -0
  147. data/lib/bioshogi/assets/audios/mastermind.band/Alternatives/000/ProjectData +0 -0
  148. data/lib/bioshogi/assets/audios/mastermind.band/Alternatives/000/WindowImage.jpg +0 -0
  149. data/lib/bioshogi/assets/audios/mastermind.band/Resources/ProjectInformation.plist +0 -0
  150. data/lib/bioshogi/assets/audios/mastermind.band/projectData +3183 -0
  151. data/lib/bioshogi/assets/audios/mastermind.m4a +0 -0
  152. data/lib/bioshogi/assets/audios/nc105702.m4a +0 -0
  153. data/lib/bioshogi/assets/audios/nc105702.mp3 +0 -0
  154. data/lib/bioshogi/assets/audios/nc142538.m4a +0 -0
  155. data/lib/bioshogi/assets/audios/nc142538.mp3 +0 -0
  156. data/lib/bioshogi/assets/audios/nc162705.m4a +0 -0
  157. data/lib/bioshogi/assets/audios/nc162705.mp3 +0 -0
  158. data/lib/bioshogi/assets/audios/nc799.m4a +0 -0
  159. data/lib/bioshogi/assets/audios/nc799.mp3 +0 -0
  160. data/lib/bioshogi/assets/audios/nc97718.m4a +0 -0
  161. data/lib/bioshogi/assets/audios/positive_think.band/Alternatives/000/Autosave/.dummy +0 -0
  162. data/lib/bioshogi/assets/audios/positive_think.band/Alternatives/000/Autosave/2021-08-19 05:25:23Z.displayData +0 -0
  163. data/lib/bioshogi/assets/audios/positive_think.band/Alternatives/000/Autosave/2021-08-19 05:25:23Z.eventData +0 -0
  164. data/lib/bioshogi/assets/audios/positive_think.band/Alternatives/000/Autosave/2021-08-19 05:25:23Z.songData +0 -0
  165. data/lib/bioshogi/assets/audios/positive_think.band/Alternatives/000/DisplayState.plist +0 -0
  166. data/lib/bioshogi/assets/audios/positive_think.band/Alternatives/000/DisplayStateArchive +0 -0
  167. data/lib/bioshogi/assets/audios/positive_think.band/Alternatives/000/MetaData.plist +0 -0
  168. data/lib/bioshogi/assets/audios/positive_think.band/Alternatives/000/ProjectData +0 -0
  169. data/lib/bioshogi/assets/audios/positive_think.band/Alternatives/000/WindowImage.jpg +0 -0
  170. data/lib/bioshogi/assets/audios/positive_think.band/Resources/ProjectInformation.plist +0 -0
  171. data/lib/bioshogi/assets/audios/positive_think.band/projectData +3183 -0
  172. data/lib/bioshogi/assets/audios/positive_think.m4a +0 -0
  173. data/lib/bioshogi/assets/audios/shw_akatsuki_japan.m4a +0 -0
  174. data/lib/bioshogi/assets/audios/shw_akatsuki_japan.mp3 +0 -0
  175. data/lib/bioshogi/assets/audios/stg_like_type1.band/Alternatives/000/DisplayState.plist +0 -0
  176. data/lib/bioshogi/assets/audios/stg_like_type1.band/Alternatives/000/DisplayStateArchive +0 -0
  177. data/lib/bioshogi/assets/audios/stg_like_type1.band/Alternatives/000/MetaData.plist +0 -0
  178. data/lib/bioshogi/assets/audios/stg_like_type1.band/Alternatives/000/ProjectData +0 -0
  179. data/lib/bioshogi/assets/audios/stg_like_type1.band/Alternatives/000/WindowImage.jpg +0 -0
  180. data/lib/bioshogi/assets/audios/stg_like_type1.band/Resources/ProjectInformation.plist +0 -0
  181. data/lib/bioshogi/assets/audios/stg_like_type1.band/projectData +3183 -0
  182. data/lib/bioshogi/assets/audios/stg_like_type1a.m4a +0 -0
  183. data/lib/bioshogi/assets/audios/stg_like_type1b.m4a +0 -0
  184. data/lib/bioshogi/assets/audios/strategy.band/Alternatives/000/DisplayState.plist +0 -0
  185. data/lib/bioshogi/assets/audios/strategy.band/Alternatives/000/DisplayStateArchive +0 -0
  186. data/lib/bioshogi/assets/audios/strategy.band/Alternatives/000/MetaData.plist +0 -0
  187. data/lib/bioshogi/assets/audios/strategy.band/Alternatives/000/ProjectData +0 -0
  188. data/lib/bioshogi/assets/audios/strategy.band/Alternatives/000/WindowImage.jpg +0 -0
  189. data/lib/bioshogi/assets/audios/strategy.band/Media/Audio Files/Strategy.caf +0 -0
  190. data/lib/bioshogi/assets/audios/strategy.band/Resources/ProjectInformation.plist +0 -0
  191. data/lib/bioshogi/assets/audios/strategy.band/projectData +3183 -0
  192. data/lib/bioshogi/assets/audios/strategy.m4a +0 -0
  193. data/lib/bioshogi/assets/audios/test1.band/Alternatives/000/DisplayState.plist +0 -0
  194. data/lib/bioshogi/assets/audios/test1.band/Alternatives/000/DisplayStateArchive +0 -0
  195. data/lib/bioshogi/assets/audios/test1.band/Alternatives/000/MetaData.plist +0 -0
  196. data/lib/bioshogi/assets/audios/test1.band/Alternatives/000/ProjectData +0 -0
  197. data/lib/bioshogi/assets/audios/test1.band/Alternatives/000/WindowImage.jpg +0 -0
  198. data/lib/bioshogi/assets/audios/test1.band/Resources/ProjectInformation.plist +0 -0
  199. data/lib/bioshogi/assets/audios/test1.band/projectData +3183 -0
  200. data/lib/bioshogi/assets/audios/test2.band/Alternatives/000/DisplayState.plist +0 -0
  201. data/lib/bioshogi/assets/audios/test2.band/Alternatives/000/DisplayStateArchive +0 -0
  202. data/lib/bioshogi/assets/audios/test2.band/Alternatives/000/MetaData.plist +0 -0
  203. data/lib/bioshogi/assets/audios/test2.band/Alternatives/000/ProjectData +0 -0
  204. data/lib/bioshogi/assets/audios/test2.band/Alternatives/000/WindowImage.jpg +0 -0
  205. data/lib/bioshogi/assets/audios/test2.band/Resources/ProjectInformation.plist +0 -0
  206. data/lib/bioshogi/assets/audios/test2.band/projectData +3183 -0
  207. data/lib/bioshogi/assets/fonts/MPLUSRounded1c-Black.ttf +0 -0
  208. data/lib/bioshogi/assets/fonts/MPLUSRounded1c-Bold.ttf +0 -0
  209. data/lib/bioshogi/assets/fonts/MPLUSRounded1c-ExtraBold.ttf +0 -0
  210. data/lib/bioshogi/assets/fonts/MPLUSRounded1c-Light.ttf +0 -0
  211. data/lib/bioshogi/assets/fonts/MPLUSRounded1c-Medium.ttf +0 -0
  212. data/lib/bioshogi/assets/fonts/MPLUSRounded1c-Regular.ttf +0 -0
  213. data/lib/bioshogi/assets/fonts/MPLUSRounded1c-Thin.ttf +0 -0
  214. data/lib/bioshogi/assets/fonts/NewTegomin-Regular.ttf +0 -0
  215. data/lib/bioshogi/assets/fonts/NotoSansJP-Black.otf +0 -0
  216. data/lib/bioshogi/assets/fonts/NotoSansJP-Bold.otf +0 -0
  217. data/lib/bioshogi/assets/fonts/NotoSansJP-Light.otf +0 -0
  218. data/lib/bioshogi/assets/fonts/NotoSansJP-Medium.otf +0 -0
  219. data/lib/bioshogi/assets/fonts/NotoSansJP-Regular.otf +0 -0
  220. data/lib/bioshogi/assets/fonts/NotoSansJP-Thin.otf +0 -0
  221. data/lib/bioshogi/assets/fonts/NotoSerifJP-Black.otf +0 -0
  222. data/lib/bioshogi/assets/fonts/NotoSerifJP-Bold.otf +0 -0
  223. data/lib/bioshogi/assets/fonts/NotoSerifJP-ExtraLight.otf +0 -0
  224. data/lib/bioshogi/assets/fonts/NotoSerifJP-Light.otf +0 -0
  225. data/lib/bioshogi/assets/fonts/NotoSerifJP-Medium.otf +0 -0
  226. data/lib/bioshogi/assets/fonts/NotoSerifJP-Regular.otf +0 -0
  227. data/lib/bioshogi/assets/fonts/NotoSerifJP-SemiBold.otf +0 -0
  228. data/lib/bioshogi/assets/fonts/README.org +9 -0
  229. data/lib/bioshogi/assets/fonts/RictyDiminished-Bold.ttf +0 -0
  230. data/lib/bioshogi/assets/fonts/RictyDiminished-Regular.ttf +0 -0
  231. data/lib/bioshogi/assets/fonts/YuseiMagic-Regular.ttf +0 -0
  232. data/lib/bioshogi/assets/images/README.org +0 -0
  233. data/lib/bioshogi/assets/images/background/README.org +9 -0
  234. data/lib/bioshogi/assets/images/background/background_a.png +0 -0
  235. data/lib/bioshogi/assets/images/board/README.org +7 -0
  236. data/lib/bioshogi/assets/images/board/board_a.png +0 -0
  237. data/lib/bioshogi/assets/images/color_theme_preview/is_color_theme_club24.png +0 -0
  238. data/lib/bioshogi/assets/images/color_theme_preview/is_color_theme_paper.png +0 -0
  239. data/lib/bioshogi/assets/images/color_theme_preview/is_color_theme_piyo.png +0 -0
  240. data/lib/bioshogi/assets/images/color_theme_preview/is_color_theme_real.png +0 -0
  241. data/lib/bioshogi/assets/images/color_theme_preview/is_color_theme_shape.png +0 -0
  242. data/lib/bioshogi/assets/images/piece/Portella/BB0.png +0 -0
  243. data/lib/bioshogi/assets/images/piece/Portella/BB1.png +0 -0
  244. data/lib/bioshogi/assets/images/piece/Portella/BG0.png +0 -0
  245. data/lib/bioshogi/assets/images/piece/Portella/BK0.png +0 -0
  246. data/lib/bioshogi/assets/images/piece/Portella/BL0.png +0 -0
  247. data/lib/bioshogi/assets/images/piece/Portella/BL1.png +0 -0
  248. data/lib/bioshogi/assets/images/piece/Portella/BN0.png +0 -0
  249. data/lib/bioshogi/assets/images/piece/Portella/BN1.png +0 -0
  250. data/lib/bioshogi/assets/images/piece/Portella/BP0.png +0 -0
  251. data/lib/bioshogi/assets/images/piece/Portella/BP1.png +0 -0
  252. data/lib/bioshogi/assets/images/piece/Portella/BR0.png +0 -0
  253. data/lib/bioshogi/assets/images/piece/Portella/BR1.png +0 -0
  254. data/lib/bioshogi/assets/images/piece/Portella/BS0.png +0 -0
  255. data/lib/bioshogi/assets/images/piece/Portella/BS1.png +0 -0
  256. data/lib/bioshogi/assets/images/piece/Portella/BX0.png +0 -0
  257. data/lib/bioshogi/assets/images/piece/Portella/README.org +1 -0
  258. data/lib/bioshogi/assets/images/piece/Portella/WB0.png +0 -0
  259. data/lib/bioshogi/assets/images/piece/Portella/WB1.png +0 -0
  260. data/lib/bioshogi/assets/images/piece/Portella/WG0.png +0 -0
  261. data/lib/bioshogi/assets/images/piece/Portella/WK0.png +0 -0
  262. data/lib/bioshogi/assets/images/piece/Portella/WL0.png +0 -0
  263. data/lib/bioshogi/assets/images/piece/Portella/WL1.png +0 -0
  264. data/lib/bioshogi/assets/images/piece/Portella/WN0.png +0 -0
  265. data/lib/bioshogi/assets/images/piece/Portella/WN1.png +0 -0
  266. data/lib/bioshogi/assets/images/piece/Portella/WP0.png +0 -0
  267. data/lib/bioshogi/assets/images/piece/Portella/WP1.png +0 -0
  268. data/lib/bioshogi/assets/images/piece/Portella/WR0.png +0 -0
  269. data/lib/bioshogi/assets/images/piece/Portella/WR1.png +0 -0
  270. data/lib/bioshogi/assets/images/piece/Portella/WS0.png +0 -0
  271. data/lib/bioshogi/assets/images/piece/Portella/WS1.png +0 -0
  272. data/lib/bioshogi/assets/images/piece/Portella/WX0.png +0 -0
  273. data/lib/bioshogi/assets/images/piece/Portella/convert.sh +32 -0
  274. data/lib/bioshogi/assets/images/piece/Portella/original/0FU.png +0 -0
  275. data/lib/bioshogi/assets/images/piece/Portella/original/0GI.png +0 -0
  276. data/lib/bioshogi/assets/images/piece/Portella/original/0GY.png +0 -0
  277. data/lib/bioshogi/assets/images/piece/Portella/original/0HI.png +0 -0
  278. data/lib/bioshogi/assets/images/piece/Portella/original/0KA.png +0 -0
  279. data/lib/bioshogi/assets/images/piece/Portella/original/0KE.png +0 -0
  280. data/lib/bioshogi/assets/images/piece/Portella/original/0KI.png +0 -0
  281. data/lib/bioshogi/assets/images/piece/Portella/original/0KI.svg +1 -0
  282. data/lib/bioshogi/assets/images/piece/Portella/original/0KY.png +0 -0
  283. data/lib/bioshogi/assets/images/piece/Portella/original/0NG.png +0 -0
  284. data/lib/bioshogi/assets/images/piece/Portella/original/0NK.png +0 -0
  285. data/lib/bioshogi/assets/images/piece/Portella/original/0NY.png +0 -0
  286. data/lib/bioshogi/assets/images/piece/Portella/original/0OU.png +0 -0
  287. data/lib/bioshogi/assets/images/piece/Portella/original/0RY.png +0 -0
  288. data/lib/bioshogi/assets/images/piece/Portella/original/0TO.png +0 -0
  289. data/lib/bioshogi/assets/images/piece/Portella/original/0UM.png +0 -0
  290. data/lib/bioshogi/assets/images/piece/Portella/original/1FU.png +0 -0
  291. data/lib/bioshogi/assets/images/piece/Portella/original/1GI.png +0 -0
  292. data/lib/bioshogi/assets/images/piece/Portella/original/1GY.png +0 -0
  293. data/lib/bioshogi/assets/images/piece/Portella/original/1HI.png +0 -0
  294. data/lib/bioshogi/assets/images/piece/Portella/original/1KA.png +0 -0
  295. data/lib/bioshogi/assets/images/piece/Portella/original/1KE.png +0 -0
  296. data/lib/bioshogi/assets/images/piece/Portella/original/1KI.png +0 -0
  297. data/lib/bioshogi/assets/images/piece/Portella/original/1KY.png +0 -0
  298. data/lib/bioshogi/assets/images/piece/Portella/original/1NG.png +0 -0
  299. data/lib/bioshogi/assets/images/piece/Portella/original/1NK.png +0 -0
  300. data/lib/bioshogi/assets/images/piece/Portella/original/1NY.png +0 -0
  301. data/lib/bioshogi/assets/images/piece/Portella/original/1OU.png +0 -0
  302. data/lib/bioshogi/assets/images/piece/Portella/original/1RY.png +0 -0
  303. data/lib/bioshogi/assets/images/piece/Portella/original/1TO.png +0 -0
  304. data/lib/bioshogi/assets/images/piece/Portella/original/1UM.png +0 -0
  305. data/lib/bioshogi/board/basic.rb +24 -0
  306. data/lib/bioshogi/board/csa_formatter.rb +40 -0
  307. data/lib/bioshogi/board/kakinoki_formatter.rb +57 -0
  308. data/lib/bioshogi/board/piece_counts_methods.rb +43 -0
  309. data/lib/bioshogi/board/reader_methods.rb +91 -0
  310. data/lib/bioshogi/board/technique_matcher_methods.rb +23 -0
  311. data/lib/bioshogi/board/update_methods.rb +79 -0
  312. data/lib/bioshogi/board.rb +28 -0
  313. data/lib/bioshogi/board_parser/base.rb +43 -0
  314. data/lib/bioshogi/board_parser/compare_board_parser.rb +95 -0
  315. data/lib/bioshogi/board_parser/csa_board_parser.rb +45 -0
  316. data/lib/bioshogi/board_parser/kakinoki_board_parser.rb +95 -0
  317. data/lib/bioshogi/board_parser/sfen_board_parser.rb +29 -0
  318. data/lib/bioshogi/board_parser.rb +33 -0
  319. data/lib/bioshogi/builder.rb +9 -0
  320. data/lib/bioshogi/cli/.gitignore +1 -0
  321. data/lib/bioshogi/cli/convert.rb +34 -0
  322. data/lib/bioshogi/cli/input_parser.rb +23 -0
  323. data/lib/bioshogi/cli/piece.rb +19 -0
  324. data/lib/bioshogi/cli/versus.rb +160 -0
  325. data/lib/bioshogi/cli.rb +106 -0
  326. data/lib/bioshogi/container/basic.rb +13 -0
  327. data/lib/bioshogi/container/checkmate_yomiage.rb +87 -0
  328. data/lib/bioshogi/container/core_methods.rb +99 -0
  329. data/lib/bioshogi/container/execute_methods.rb +40 -0
  330. data/lib/bioshogi/container/fast.rb +16 -0
  331. data/lib/bioshogi/container/players_methods.rb +106 -0
  332. data/lib/bioshogi/container/serialize_methods.rb +180 -0
  333. data/lib/bioshogi/container/simple.rb +17 -0
  334. data/lib/bioshogi/container/test_methods.rb +65 -0
  335. data/lib/bioshogi/container.rb +9 -0
  336. data/lib/bioshogi/cover_image/bottom_text_methods.rb +34 -0
  337. data/lib/bioshogi/cover_image/core_methods.rb +60 -0
  338. data/lib/bioshogi/cover_image/main_text_methods.rb +36 -0
  339. data/lib/bioshogi/cover_image/renderer.rb +10 -0
  340. data/lib/bioshogi/cover_image.rb +7 -0
  341. data/lib/bioshogi/csa_header_info.rb +90 -0
  342. data/lib/bioshogi/dimension/base.rb +92 -0
  343. data/lib/bioshogi/dimension/char_info.rb +24 -0
  344. data/lib/bioshogi/dimension/dimension_info.rb +25 -0
  345. data/lib/bioshogi/dimension/module_methods.rb +42 -0
  346. data/lib/bioshogi/dimension/place_x.rb +27 -0
  347. data/lib/bioshogi/dimension/place_y.rb +57 -0
  348. data/lib/bioshogi/dimension.rb +7 -0
  349. data/lib/bioshogi/errors.rb +145 -0
  350. data/lib/bioshogi/explain/attack_info.rb +195 -0
  351. data/lib/bioshogi/explain/board_piller_methods.rb +53 -0
  352. data/lib/bioshogi/explain/chaos_info.rb +17 -0
  353. data/lib/bioshogi/explain/defense_info.rb +130 -0
  354. data/lib/bioshogi/explain/distribution_ratio.rb +1840 -0
  355. data/lib/bioshogi/explain/distribution_ratio_generator.rb +48 -0
  356. data/lib/bioshogi/explain/file_normalizer.rb +20 -0
  357. data/lib/bioshogi/explain/group_info.rb +16 -0
  358. data/lib/bioshogi/explain/monitor_mod.rb +78 -0
  359. data/lib/bioshogi/explain/note_info.rb +63 -0
  360. data/lib/bioshogi/explain/sect_info.rb +13 -0
  361. data/lib/bioshogi/explain/shape_info.rb +4582 -0
  362. data/lib/bioshogi/explain/shape_info_relation.rb +37 -0
  363. data/lib/bioshogi/explain/skill_monitor.rb +352 -0
  364. data/lib/bioshogi/explain/skill_set.rb +100 -0
  365. data/lib/bioshogi/explain/tactic_hit_turn_table.rb +316 -0
  366. data/lib/bioshogi/explain/tactic_hit_turn_table_generator.rb +61 -0
  367. data/lib/bioshogi/explain/tactic_info.rb +124 -0
  368. data/lib/bioshogi/explain/tactic_validator.rb +40 -0
  369. data/lib/bioshogi/explain/tech_accessor.rb +147 -0
  370. data/lib/bioshogi/explain/technique_info.rb +28 -0
  371. data/lib/bioshogi/explain/technique_matcher_info.rb +298 -0
  372. data/lib/bioshogi/explain//345/202/231/350/200/203//345/205/245/347/216/211.kif +24 -0
  373. data/lib/bioshogi/explain//345/202/231/350/200/203//345/244/247/351/247/222/343/202/263/343/203/263/343/203/227/343/203/252/343/203/274/343/203/210.kif +19 -0
  374. data/lib/bioshogi/explain//345/202/231/350/200/203//345/244/247/351/247/222/345/205/250/346/266/210/345/244/261.kif +19 -0
  375. data/lib/bioshogi/explain//345/202/231/350/200/203//345/257/276/346/212/227/345/236/213.kif +12 -0
  376. data/lib/bioshogi/explain//345/202/231/350/200/203//345/257/276/346/214/257/343/202/212.kif +12 -0
  377. data/lib/bioshogi/explain//345/202/231/350/200/203//345/261/205/351/243/233/350/273/212.kif +10 -0
  378. data/lib/bioshogi/explain//345/202/231/350/200/203//346/214/257/343/202/212/351/243/233/350/273/212.kif +12 -0
  379. data/lib/bioshogi/explain//345/202/231/350/200/203//347/233/270/345/205/245/347/216/211.kif +24 -0
  380. data/lib/bioshogi/explain//345/202/231/350/200/203//347/233/270/345/261/205/347/216/211.kif +26 -0
  381. data/lib/bioshogi/explain//345/202/231/350/200/203//347/233/270/345/261/205/351/243/233/350/273/212.kif +8 -0
  382. data/lib/bioshogi/explain//345/202/231/350/200/203//347/233/270/346/214/257/343/202/212.kif +16 -0
  383. data/lib/bioshogi/explain//345/202/231/350/200/203//350/203/214/346/260/264/343/201/256/351/231/243.kif +34 -0
  384. data/lib/bioshogi/explain//345/202/231/350/200/203//350/247/222/344/270/215/346/210/220.kif +16 -0
  385. data/lib/bioshogi/explain//345/202/231/350/200/203//351/243/233/350/273/212/344/270/215/346/210/220.kif +17 -0
  386. data/lib/bioshogi/explain//345/202/231/350/200/203//351/247/222/346/237/261.kif +48 -0
  387. data/lib/bioshogi/explain//345/233/262/343/201/204//343/201/202/343/201/232/343/201/276/343/202/204/345/233/262/343/201/204.kif +30 -0
  388. data/lib/bioshogi/explain//345/233/262/343/201/204//343/201/204/343/201/241/343/201/224/345/233/262/343/201/204.kif +82 -0
  389. data/lib/bioshogi/explain//345/233/262/343/201/204//343/201/213/343/202/223/343/201/264/343/202/207/343/201/206/345/233/262/343/201/204.kif +122 -0
  390. data/lib/bioshogi/explain//345/233/262/343/201/204//343/201/232/343/202/214/347/276/216/346/277/203.kif +25 -0
  391. data/lib/bioshogi/explain//345/233/262/343/201/204//343/201/241/343/202/207/343/202/223/343/201/276/343/201/222/347/276/216/346/277/203.kif +25 -0
  392. data/lib/bioshogi/explain//345/233/262/343/201/204//343/201/270/343/201/223/343/201/277/347/237/242/345/200/211.kif +41 -0
  393. data/lib/bioshogi/explain//345/233/262/343/201/204//343/202/242/343/203/222/343/203/253/345/233/262/343/201/204.kif +148 -0
  394. data/lib/bioshogi/explain//345/233/262/343/201/204//343/202/250/343/203/253/343/203/242/345/233/262/343/201/204.kif +23 -0
  395. data/lib/bioshogi/explain//345/233/262/343/201/204//343/202/252/343/203/252/343/202/270/343/203/212/343/203/253/351/233/201/346/234/250.kif +40 -0
  396. data/lib/bioshogi/explain//345/233/262/343/201/204//343/202/252/343/203/274/343/203/253/343/203/211/351/233/201/346/234/250.kif +92 -0
  397. data/lib/bioshogi/explain//345/233/262/343/201/204//343/202/253/343/202/256/345/233/262/343/201/204.kif +40 -0
  398. data/lib/bioshogi/explain//345/233/262/343/201/204//343/202/253/343/202/277/345/233/262/343/201/204.kif +144 -0
  399. data/lib/bioshogi/explain//345/233/262/343/201/204//343/202/253/343/203/213/345/233/262/343/201/204.kif +69 -0
  400. data/lib/bioshogi/explain//345/233/262/343/201/204//343/202/253/343/203/213/347/274/266/345/233/262/343/201/204.kif +23 -0
  401. data/lib/bioshogi/explain//345/233/262/343/201/204//343/202/253/343/203/226/343/203/210/345/233/262/343/201/204.kif +29 -0
  402. data/lib/bioshogi/explain//345/233/262/343/201/204//343/202/253/343/203/226/343/203/210/347/276/216/346/277/203.kif +49 -0
  403. data/lib/bioshogi/explain//345/233/262/343/201/204//343/202/273/343/203/241/343/203/263/343/203/210/345/233/262/343/201/204.kif +124 -0
  404. data/lib/bioshogi/explain//345/233/262/343/201/204//343/203/200/343/202/244/343/203/244/343/203/242/343/203/263/343/203/211/347/276/216/346/277/203.kif +89 -0
  405. data/lib/bioshogi/explain//345/233/262/343/201/204//343/203/201/343/203/247/343/202/263/343/203/254/343/203/274/343/203/210/345/233/262/343/201/204.kif +59 -0
  406. data/lib/bioshogi/explain//345/233/262/343/201/204//343/203/204/343/203/216/351/212/200/345/236/213/345/217/263/347/216/211.kif +45 -0
  407. data/lib/bioshogi/explain//345/233/262/343/201/204//343/203/204/343/203/216/351/212/200/351/233/201/346/234/250.kif +113 -0
  408. data/lib/bioshogi/explain//345/233/262/343/201/204//343/203/223/343/203/203/343/202/2604.kif +104 -0
  409. data/lib/bioshogi/explain//345/233/262/343/201/204//343/203/234/343/203/212/343/203/263/343/202/266/345/233/262/343/201/204.kif +89 -0
  410. data/lib/bioshogi/explain//345/233/262/343/201/204//343/203/237/343/203/254/343/203/213/343/202/242/343/203/240/345/233/262/343/201/204.kif +96 -0
  411. data/lib/bioshogi/explain//345/233/262/343/201/204//343/203/242/343/203/216/343/203/254/343/203/274/343/203/253/345/233/262/343/201/204.kif +47 -0
  412. data/lib/bioshogi/explain//345/233/262/343/201/204//344/270/200/346/226/207/345/255/227/347/237/242/345/200/211.kif +48 -0
  413. data/lib/bioshogi/explain//345/233/262/343/201/204//344/270/211/346/211/213/345/233/262/343/201/204.kif +23 -0
  414. data/lib/bioshogi/explain//345/233/262/343/201/204//344/270/211/346/256/265/345/217/263/347/216/211.kif +50 -0
  415. data/lib/bioshogi/explain//345/233/262/343/201/204//344/270/255/344/275/217/343/201/276/343/201/204.kif +71 -0
  416. data/lib/bioshogi/explain//345/233/262/343/201/204//344/270/255/345/216/237/345/233/262/343/201/204.kif +69 -0
  417. data/lib/bioshogi/explain//345/233/262/343/201/204//344/270/262/343/202/253/343/203/204/345/233/262/343/201/204.kif +75 -0
  418. data/lib/bioshogi/explain//345/233/262/343/201/204//345/215/207/347/224/260/347/276/216/346/277/203.kif +43 -0
  419. data/lib/bioshogi/explain//345/233/262/343/201/204//345/217/263/347/216/211.kif +82 -0
  420. data/lib/bioshogi/explain//345/233/262/343/201/204//345/217/263/347/237/242/345/200/211.kif +92 -0
  421. data/lib/bioshogi/explain//345/233/262/343/201/204//345/233/233/346/236/232/347/276/216/346/277/203.kif +82 -0
  422. data/lib/bioshogi/explain//345/233/262/343/201/204//345/233/233/346/236/232/351/212/200/345/206/240.kif +150 -0
  423. data/lib/bioshogi/explain//345/233/262/343/201/204//345/233/233/346/256/265/347/253/257/347/216/211.kif +213 -0
  424. data/lib/bioshogi/explain//345/233/262/343/201/204//345/233/233/346/256/265/347/253/257/347/216/2112.kif +91 -0
  425. data/lib/bioshogi/explain//345/233/262/343/201/204//345/233/233/350/247/222/347/237/242/345/200/211.kif +57 -0
  426. data/lib/bioshogi/explain//345/233/262/343/201/204//345/234/237/345/261/205/347/237/242/345/200/211.kif +39 -0
  427. data/lib/bioshogi/explain//345/233/262/343/201/204//345/235/212/344/270/273/347/276/216/346/277/203.kif +79 -0
  428. data/lib/bioshogi/explain//345/233/262/343/201/204//345/244/247/345/261/261/347/276/216/346/277/203.kif +44 -0
  429. data/lib/bioshogi/explain//345/233/262/343/201/204//345/244/247/347/233/276/345/233/262/343/201/204.kif +33 -0
  430. data/lib/bioshogi/explain//345/233/262/343/201/204//345/244/251/345/256/210/351/226/243/345/233/262/343/201/204.kif +29 -0
  431. data/lib/bioshogi/explain//345/233/262/343/201/204//345/244/251/345/256/210/351/226/243/347/276/216/346/277/203.kif +75 -0
  432. data/lib/bioshogi/explain//345/233/262/343/201/204//345/244/251/351/207/216/347/237/242/345/200/211.kif +76 -0
  433. data/lib/bioshogi/explain//345/233/262/343/201/204//345/257/214/345/243/253/350/246/213/347/237/242/345/200/211.kif +45 -0
  434. data/lib/bioshogi/explain//345/233/262/343/201/204//345/261/205/347/216/211.kif +57 -0
  435. data/lib/bioshogi/explain//345/233/262/343/201/204//345/261/205/351/243/233/347/251/264/351/237/263/347/204/241/343/201/227/343/201/256/346/247/213/343/201/210.kif +60 -0
  436. data/lib/bioshogi/explain//345/233/262/343/201/204//345/261/205/351/243/233/350/273/212/347/251/264/347/206/212.kif +76 -0
  437. data/lib/bioshogi/explain//345/233/262/343/201/204//345/261/205/351/243/233/350/273/212/351/207/221/347/276/216/346/277/203.kif +42 -0
  438. data/lib/bioshogi/explain//345/233/262/343/201/204//345/267/246/345/261/261/345/233/262/343/201/204.kif +26 -0
  439. data/lib/bioshogi/explain//345/233/262/343/201/204//345/267/246/347/276/216/346/277/203.kif +72 -0
  440. data/lib/bioshogi/explain//345/233/262/343/201/204//346/202/252/345/275/242/347/237/242/345/200/211.kif +31 -0
  441. data/lib/bioshogi/explain//345/233/262/343/201/204//346/214/257/343/202/212/351/243/233/350/273/212/343/202/250/343/203/253/343/203/242.kif +31 -0
  442. data/lib/bioshogi/explain//345/233/262/343/201/204//346/214/257/343/202/212/351/243/233/350/273/212/343/203/223/343/203/203/343/202/2604.kif +151 -0
  443. data/lib/bioshogi/explain//345/233/262/343/201/204//346/214/257/343/202/212/351/243/233/350/273/212/343/203/237/343/203/254/343/203/213/343/202/242/343/203/240.kif +130 -0
  444. data/lib/bioshogi/explain//345/233/262/343/201/204//346/214/257/343/202/212/351/243/233/350/273/212/344/270/262/343/202/253/343/203/204/345/233/262/343/201/204.kif +39 -0
  445. data/lib/bioshogi/explain//345/233/262/343/201/204//346/214/257/343/202/212/351/243/233/350/273/212/345/233/233/346/236/232/347/276/216/346/277/203.kif +57 -0
  446. data/lib/bioshogi/explain//345/233/262/343/201/204//346/214/257/343/202/212/351/243/233/350/273/212/345/244/251/345/256/210/351/226/243/347/276/216/346/277/203.kif +50 -0
  447. data/lib/bioshogi/explain//345/233/262/343/201/204//346/214/257/343/202/212/351/243/233/350/273/212/347/251/264/347/206/212.kif +40 -0
  448. data/lib/bioshogi/explain//345/233/262/343/201/204//346/214/257/343/202/212/351/243/233/350/273/212/347/253/257/347/216/211/351/212/200/345/206/240.kif +39 -0
  449. data/lib/bioshogi/explain//345/233/262/343/201/204//346/214/257/343/202/212/351/243/233/350/273/212/351/212/200/345/206/240/347/251/264/347/206/212.kif +57 -0
  450. data/lib/bioshogi/explain//345/233/262/343/201/204//346/226/207/351/216/256/345/233/262/343/201/204.kif +40 -0
  451. data/lib/bioshogi/explain//345/233/262/343/201/204//346/226/260/345/236/213/351/233/201/346/234/250.kif +53 -0
  452. data/lib/bioshogi/explain//345/233/262/343/201/204//346/227/251/345/233/262/343/201/204.kif +22 -0
  453. data/lib/bioshogi/explain//345/233/262/343/201/204//346/234/250/346/235/221/347/276/216/346/277/203.kif +88 -0
  454. data/lib/bioshogi/explain//345/233/262/343/201/204//346/235/276/345/260/276/346/265/201/347/251/264/347/206/212.kif +84 -0
  455. data/lib/bioshogi/explain//345/233/262/343/201/204//346/241/220/345/261/261/346/265/201/344/270/255/345/216/237/345/233/262/343/201/204.kif +37 -0
  456. data/lib/bioshogi/explain//345/233/262/343/201/204//346/265/201/343/202/214/347/237/242/345/200/211.kif +43 -0
  457. data/lib/bioshogi/explain//345/233/262/343/201/204//347/204/241/346/225/265/345/233/262/343/201/204.kif +136 -0
  458. data/lib/bioshogi/explain//345/233/262/343/201/204//347/204/241/350/262/254/344/273/273/347/237/242/345/200/211.kif +44 -0
  459. data/lib/bioshogi/explain//345/233/262/343/201/204//347/211/207/347/276/216/346/277/203/345/233/262/343/201/204.kif +68 -0
  460. data/lib/bioshogi/explain//345/233/262/343/201/204//347/211/207/351/212/200/345/206/240.kif +50 -0
  461. data/lib/bioshogi/explain//345/233/262/343/201/204//347/237/242/345/200/211/345/217/263/347/216/211.kif +40 -0
  462. data/lib/bioshogi/explain//345/233/262/343/201/204//347/237/242/345/200/211/346/227/251/345/233/262/343/201/204.kif +31 -0
  463. data/lib/bioshogi/explain//345/233/262/343/201/204//347/237/242/345/200/211/347/251/264/347/206/212.kif +86 -0
  464. data/lib/bioshogi/explain//345/233/262/343/201/204//347/245/236/345/220/211/346/265/201/347/251/264/347/206/212.kif +50 -0
  465. data/lib/bioshogi/explain//345/233/262/343/201/204//347/251/272/344/270/255/346/245/274/351/226/243.kif +126 -0
  466. data/lib/bioshogi/explain//345/233/262/343/201/204//347/253/257/347/216/211/351/212/200/345/206/240.kif +88 -0
  467. data/lib/bioshogi/explain//345/233/262/343/201/204//347/256/261/345/205/245/343/202/212/345/250/230.kif +72 -0
  468. data/lib/bioshogi/explain//345/233/262/343/201/204//347/263/270/350/260/267/346/265/201/345/217/263/347/216/211.kif +151 -0
  469. data/lib/bioshogi/explain//345/233/262/343/201/204//347/264/231/347/251/264/347/206/212.kif +194 -0
  470. data/lib/bioshogi/explain//345/233/262/343/201/204//347/267/217/347/237/242/345/200/211.kif +78 -0
  471. data/lib/bioshogi/explain//345/233/262/343/201/204//347/276/216/346/277/203/345/233/262/343/201/204.kif +52 -0
  472. data/lib/bioshogi/explain//345/233/262/343/201/204//347/276/216/346/277/203/347/206/212/345/233/262/343/201/204.kif +50 -0
  473. data/lib/bioshogi/explain//345/233/262/343/201/204//347/276/275/347/224/237/346/265/201/345/217/263/347/216/211.kif +43 -0
  474. data/lib/bioshogi/explain//345/233/262/343/201/204//350/210/237/345/233/262/343/201/204.kif +67 -0
  475. data/lib/bioshogi/explain//345/233/262/343/201/204//350/210/237/345/233/262/343/201/204DX.kif +32 -0
  476. data/lib/bioshogi/explain//345/233/262/343/201/204//350/217/212/346/260/264/347/237/242/345/200/211.kif +93 -0
  477. data/lib/bioshogi/explain//345/233/262/343/201/204//350/217/261/347/237/242/345/200/211.kif +89 -0
  478. data/lib/bioshogi/explain//345/233/262/343/201/204//350/243/217/343/202/242/343/203/222/343/203/253/345/233/262/343/201/204.kif +29 -0
  479. data/lib/bioshogi/explain//345/233/262/343/201/204//350/243/276/345/233/272/343/202/201.kif +36 -0
  480. data/lib/bioshogi/explain//345/233/262/343/201/204//350/247/222/346/217/233/343/202/217/343/202/212/345/217/263/347/216/211.kif +45 -0
  481. data/lib/bioshogi/explain//345/233/262/343/201/204//350/247/222/347/237/242/345/200/211.kif +43 -0
  482. data/lib/bioshogi/explain//345/233/262/343/201/204//350/247/222/351/201/223/344/270/215/347/252/201/343/201/215/345/267/246/347/276/216/346/277/203.kif +25 -0
  483. data/lib/bioshogi/explain//345/233/262/343/201/204//350/261/206/350/205/220/347/237/242/345/200/211.kif +38 -0
  484. data/lib/bioshogi/explain//345/233/262/343/201/204//351/200/243/347/233/237/347/276/216/346/277/203.kif +31 -0
  485. data/lib/bioshogi/explain//345/233/262/343/201/204//351/207/221/345/244/232/344/274/235.kif +41 -0
  486. data/lib/bioshogi/explain//345/233/262/343/201/204//351/207/221/347/204/241/345/217/214.kif +88 -0
  487. data/lib/bioshogi/explain//345/233/262/343/201/204//351/207/221/347/233/276/345/233/262/343/201/204.kif +43 -0
  488. data/lib/bioshogi/explain//345/233/262/343/201/204//351/207/221/347/237/242/345/200/211.kif +78 -0
  489. data/lib/bioshogi/explain//345/233/262/343/201/204//351/207/221/347/276/216/346/277/203.kif +74 -0
  490. data/lib/bioshogi/explain//345/233/262/343/201/204//351/207/221/351/226/200/347/237/242/345/200/211.kif +54 -0
  491. data/lib/bioshogi/explain//345/233/262/343/201/204//351/212/200/345/206/240.kif +76 -0
  492. data/lib/bioshogi/explain//345/233/262/343/201/204//351/212/200/345/206/240/347/251/264/347/206/212.kif +89 -0
  493. data/lib/bioshogi/explain//345/233/262/343/201/204//351/212/200/345/244/232/344/274/235.kif +141 -0
  494. data/lib/bioshogi/explain//345/233/262/343/201/204//351/212/200/347/237/242/345/200/211.kif +72 -0
  495. data/lib/bioshogi/explain//345/233/262/343/201/204//351/212/200/347/253/213/343/201/241/347/237/242/345/200/211.kif +90 -0
  496. data/lib/bioshogi/explain//345/233/262/343/201/204//351/212/200/347/276/216/346/277/203.kif +77 -0
  497. data/lib/bioshogi/explain//345/233/262/343/201/204//351/232/205/347/237/242/345/200/211.kif +61 -0
  498. data/lib/bioshogi/explain//345/233/262/343/201/204//351/233/201/346/234/250/345/217/263/347/216/211.kif +154 -0
  499. data/lib/bioshogi/explain//345/233/262/343/201/204//351/233/242/343/202/214/351/207/221/347/204/241/345/217/214.kif +56 -0
  500. data/lib/bioshogi/explain//345/233/262/343/201/204//351/253/230/347/237/242/345/200/211.kif +56 -0
  501. data/lib/bioshogi/explain//345/233/262/343/201/204//351/253/230/347/276/216/346/277/203/345/233/262/343/201/204.kif +74 -0
  502. data/lib/bioshogi/explain//346/210/246/345/236/213/2/346/211/213/347/233/256/342/226/26374/346/255/251/346/210/246/346/263/225.kif +10 -0
  503. data/lib/bioshogi/explain//346/210/246/345/236/213/2/346/211/213/347/233/256/342/226/263/357/274/223/343/203/213/351/243/233/346/210/246/346/263/225.kif +127 -0
  504. data/lib/bioshogi/explain//346/210/246/345/236/213/33/351/207/221/345/236/213/346/227/251/347/271/260/343/202/212/351/212/200.kif +34 -0
  505. data/lib/bioshogi/explain//346/210/246/345/236/213/4/346/211/213/347/233/256/342/226/263/357/274/223/344/270/211/350/247/222/346/210/246/346/263/225.kif +13 -0
  506. data/lib/bioshogi/explain//346/210/246/345/236/213/5/347/255/213/344/275/215/345/217/226/343/202/212/344/270/255/351/243/233/350/273/212.kif +16 -0
  507. data/lib/bioshogi/explain//346/210/246/345/236/213/GAVA/350/247/222.kif +33 -0
  508. data/lib/bioshogi/explain//346/210/246/345/236/213/UFO/351/212/200.kif +38 -0
  509. data/lib/bioshogi/explain//346/210/246/345/236/213/xaby/350/247/222/346/210/246/346/263/225.kif +18 -0
  510. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/262/357/274/223/344/270/203/351/212/200/346/210/246/346/263/225.kif +74 -0
  511. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/262/357/274/224/344/272/224/346/255/251/346/227/251/344/273/225/346/216/233/343/201/221.kif +64 -0
  512. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/262/357/274/224/345/205/255/351/212/200/345/217/263/346/200/245/346/210/246.kif +41 -0
  513. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/262/357/274/224/345/205/255/351/212/200/345/267/246/346/200/245/346/210/246.kif +44 -0
  514. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/262/357/274/225/344/270/203/351/207/221/346/210/246/346/263/225.kif +133 -0
  515. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/262/357/274/225/344/272/224/351/276/215/344/270/255/351/243/233/350/273/212.kif +31 -0
  516. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/262/357/274/227/344/272/214/351/243/233/344/272/234/346/200/245/346/210/246.kif +100 -0
  517. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/262/357/274/227/345/205/253/351/243/233/346/210/246/346/263/225.kif +12 -0
  518. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/262/357/274/230/344/272/224/351/243/233/350/273/212/346/210/246/346/263/225.kif +77 -0
  519. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/263/357/274/222/344/270/211/346/255/251/346/210/246/346/263/225.kif +63 -0
  520. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/263/357/274/223/344/270/211/346/241/202/346/210/246/346/263/225.kif +50 -0
  521. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/263/357/274/223/344/270/211/350/247/222/345/236/213/347/251/272/344/270/255/346/210/246/346/263/225.kif +60 -0
  522. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/263/357/274/223/344/270/211/351/243/233/346/210/246/346/263/225.kif +148 -0
  523. data/lib/bioshogi/explain//346/210/246/345/236/213//342/226/263/357/274/224/344/272/224/350/247/222/346/210/246/346/263/225.kif +61 -0
  524. data/lib/bioshogi/explain//346/210/246/345/236/213//343/201/206/343/201/243/343/201/213/343/202/212/344/270/211/351/226/223/351/243/233/350/273/212.kif +18 -0
  525. data/lib/bioshogi/explain//346/210/246/345/236/213//343/201/213/343/201/276/343/201/204/343/201/237/343/201/241/346/210/246/346/263/225.kif +190 -0
  526. data/lib/bioshogi/explain//346/210/246/345/236/213//343/201/215/343/202/223/343/201/250/343/201/206/343/202/223/346/210/246/346/263/225.kif +38 -0
  527. data/lib/bioshogi/explain//346/210/246/345/236/213//343/201/215/357/275/215/343/201/215/357/275/215/351/207/221.kif +21 -0
  528. data/lib/bioshogi/explain//346/210/246/345/236/213//343/201/244/343/201/217/343/201/244/343/201/217/343/201/274/343/201/206/343/201/227/346/210/246/346/263/225.kif +32 -0
  529. data/lib/bioshogi/explain//346/210/246/345/236/213//343/201/257/343/201/217/345/274/217/345/233/233/351/226/223/351/243/233/350/273/212.kif +34 -0
  530. data/lib/bioshogi/explain//346/210/246/345/236/213//343/201/262/343/201/255/343/202/212/351/243/233/350/273/212.kif +51 -0
  531. data/lib/bioshogi/explain//346/210/246/345/236/213//343/202/242/343/203/222/343/203/253/346/210/246/346/263/225.kif +65 -0
  532. data/lib/bioshogi/explain//346/210/246/345/236/213//343/202/246/343/202/275/347/237/242/345/200/211.kif +17 -0
  533. data/lib/bioshogi/explain//346/210/246/345/236/213//343/202/250/343/203/253/343/203/242/346/200/245/346/210/246.kif +44 -0
  534. data/lib/bioshogi/explain//346/210/246/345/236/213//343/202/252/343/202/266/343/203/257/343/202/267/343/202/271/343/203/206/343/203/240.kif +194 -0
  535. data/lib/bioshogi/explain//346/210/246/345/236/213//343/202/253/343/203/213/343/202/253/343/203/213/351/207/221.kif +43 -0
  536. data/lib/bioshogi/explain//346/210/246/345/236/213//343/202/253/343/203/213/343/202/253/343/203/213/351/212/200.kif +83 -0
  537. data/lib/bioshogi/explain//346/210/246/345/236/213//343/202/253/343/203/241/343/203/254/343/202/252/343/203/263/346/210/246/346/263/225.kif +29 -0
  538. data/lib/bioshogi/explain//346/210/246/345/236/213//343/202/264/343/202/255/343/202/262/343/203/263/344/270/255/351/243/233/350/273/212.kif +16 -0
  539. data/lib/bioshogi/explain//346/210/246/345/236/213//343/202/267/343/203/247/343/203/274/343/203/200/343/203/263/343/202/252/343/203/252/343/202/270/343/203/212/343/203/253.kif +123 -0
  540. data/lib/bioshogi/explain//346/210/246/345/236/213//343/202/267/343/203/247/343/203/274/343/203/200/343/203/263/343/202/267/343/202/271/343/203/206/343/203/240.kif +151 -0
  541. data/lib/bioshogi/explain//346/210/246/345/236/213//343/202/277/343/203/251/343/203/263/343/203/201/343/203/245/343/203/251/346/210/246/346/263/225.kif +29 -0
  542. data/lib/bioshogi/explain//346/210/246/345/236/213//343/203/200/343/202/244/343/203/254/343/202/257/343/203/210/345/220/221/343/201/213/343/201/204/351/243/233/350/273/212.kif +28 -0
  543. data/lib/bioshogi/explain//346/210/246/345/236/213//343/203/204/343/203/216/351/212/200/344/270/255/351/243/233/350/273/212.kif +102 -0
  544. data/lib/bioshogi/explain//346/210/246/345/236/213//343/203/210/343/203/236/343/203/233/343/203/274/343/202/257.kif +128 -0
  545. data/lib/bioshogi/explain//346/210/246/345/236/213//343/203/216/343/203/274/343/202/254/343/203/274/343/203/211/346/210/246/346/263/225.kif +34 -0
  546. data/lib/bioshogi/explain//346/210/246/345/236/213//343/203/221/343/203/203/343/202/257/343/203/236/343/203/263/346/210/246/346/263/225.kif +23 -0
  547. data/lib/bioshogi/explain//346/210/246/345/236/213//343/203/235/343/203/263/343/203/235/343/203/263/346/241/202.kif +115 -0
  548. data/lib/bioshogi/explain//346/210/246/345/236/213//343/203/240/343/203/252/343/203/244/343/203/252/346/227/251/347/237/263/347/224/260.kif +16 -0
  549. data/lib/bioshogi/explain//346/210/246/345/236/213//343/203/241/343/202/244/343/203/211/343/202/267/343/202/271/343/203/206/343/203/240.kif +14 -0
  550. data/lib/bioshogi/explain//346/210/246/345/236/213//343/203/241/343/203/252/343/202/261/343/203/263/345/220/221/343/201/213/343/201/204/351/243/233/350/273/212.kif +29 -0
  551. data/lib/bioshogi/explain//346/210/246/345/236/213//343/203/254/343/202/260/343/202/271/343/203/232.kif +46 -0
  552. data/lib/bioshogi/explain//346/210/246/345/236/213//344/270/200/346/211/213/346/220/215/350/247/222/346/217/233/343/202/217/343/202/212.kif +14 -0
  553. data/lib/bioshogi/explain//346/210/246/345/236/213//344/270/200/347/233/264/347/267/232/347/251/264/347/206/212.kif +128 -0
  554. data/lib/bioshogi/explain//346/210/246/345/236/213//344/270/200/351/226/223/351/243/233/350/273/212.kif +63 -0
  555. data/lib/bioshogi/explain//346/210/246/345/236/213//344/270/200/351/226/223/351/243/233/350/273/212/347/251/264/347/206/212.kif +30 -0
  556. data/lib/bioshogi/explain//346/210/246/345/236/213//344/270/211/351/226/223/351/243/233/350/273/212.kif +52 -0
  557. data/lib/bioshogi/explain//346/210/246/345/236/213//344/270/211/351/226/223/351/243/233/350/273/212/343/203/237/343/203/254/343/203/213/343/202/242/343/203/240.kif +30 -0
  558. data/lib/bioshogi/explain//346/210/246/345/236/213//344/270/255/345/216/237/346/265/201/346/200/245/346/210/246/347/237/242/345/200/211.kif +99 -0
  559. data/lib/bioshogi/explain//346/210/246/345/236/213//344/270/255/345/216/237/346/265/201/347/233/270/346/216/233/343/201/213/343/202/212.kif +89 -0
  560. data/lib/bioshogi/explain//346/210/246/345/236/213//344/270/255/345/216/237/351/243/233/350/273/212.kif +89 -0
  561. data/lib/bioshogi/explain//346/210/246/345/236/213//344/270/255/347/224/260/345/212/237XP.kif +133 -0
  562. data/lib/bioshogi/explain//346/210/246/345/236/213//344/270/255/351/243/233/350/273/212/343/203/237/343/203/254/343/203/213/343/202/242/343/203/240.kif +33 -0
  563. data/lib/bioshogi/explain//346/210/246/345/236/213//344/270/255/351/243/233/350/273/212/345/267/246/347/251/264/347/206/212.kif +95 -0
  564. data/lib/bioshogi/explain//346/210/246/345/236/213//344/270/270/345/261/261/343/203/257/343/202/257/343/203/201/343/203/263.kif +23 -0
  565. data/lib/bioshogi/explain//346/210/246/345/236/213//344/271/205/345/244/242/346/265/201.kif +61 -0
  566. data/lib/bioshogi/explain//346/210/246/345/236/213//345/205/210/346/211/213/344/270/255/351/243/233/350/273/212.kif +17 -0
  567. data/lib/bioshogi/explain//346/210/246/345/236/213//345/210/235/346/211/213/357/274/223/345/205/255/346/255/251/346/210/246/346/263/225.kif +11 -0
  568. data/lib/bioshogi/explain//346/210/246/345/236/213//345/210/235/346/211/213/357/274/227/345/205/253/351/212/200/346/210/246/346/263/225.kif +29 -0
  569. data/lib/bioshogi/explain//346/210/246/345/236/213//345/212/233/346/210/246.kif +26 -0
  570. data/lib/bioshogi/explain//346/210/246/345/236/213//345/212/240/350/227/244/346/265/201/350/242/226/351/243/233/350/273/212.kif +85 -0
  571. data/lib/bioshogi/explain//346/210/246/345/236/213//345/213/207/346/260/227/346/265/201.kif +31 -0
  572. data/lib/bioshogi/explain//346/210/246/345/236/213//345/215/207/347/224/260/345/274/217/347/237/263/347/224/260/346/265/201.kif +89 -0
  573. data/lib/bioshogi/explain//346/210/246/345/236/213//345/216/237/345/247/213/344/270/255/351/243/233/350/273/212.kif +12 -0
  574. data/lib/bioshogi/explain//346/210/246/345/236/213//345/216/237/345/247/213/346/243/222/351/212/200.kif +47 -0
  575. data/lib/bioshogi/explain//346/210/246/345/236/213//345/217/263/345/233/233/351/226/223/351/243/233/350/273/212.kif +82 -0
  576. data/lib/bioshogi/explain//346/210/246/345/236/213//345/217/263/345/233/233/351/226/223/351/243/233/350/273/212/345/267/246/347/276/216/346/277/203.kif +87 -0
  577. data/lib/bioshogi/explain//346/210/246/345/236/213//345/217/263/345/233/233/351/226/223/351/243/233/350/273/212/346/200/245/346/210/246.kif +79 -0
  578. data/lib/bioshogi/explain//346/210/246/345/236/213//345/220/221/343/201/213/343/201/204/351/243/233/350/273/212.kif +55 -0
  579. data/lib/bioshogi/explain//346/210/246/345/236/213//345/233/233/346/211/213/350/247/222.kif +78 -0
  580. data/lib/bioshogi/explain//346/210/246/345/236/213//345/233/233/351/226/223/351/243/233/350/273/212.kif +60 -0
  581. data/lib/bioshogi/explain//346/210/246/345/236/213//345/233/233/351/226/223/351/243/233/350/273/212/343/203/237/343/203/254/343/203/213/343/202/242/343/203/240.kif +32 -0
  582. data/lib/bioshogi/explain//346/210/246/345/236/213//345/234/260/344/270/213/351/211/204/351/243/233/350/273/212.kif +102 -0
  583. data/lib/bioshogi/explain//346/210/246/345/236/213//345/241/232/347/224/260/343/202/271/343/203/232/343/202/267/343/203/243/343/203/253.kif +95 -0
  584. data/lib/bioshogi/explain//346/210/246/345/236/213//345/254/211/351/207/216/346/265/201.kif +9 -0
  585. data/lib/bioshogi/explain//346/210/246/345/236/213//345/257/276/346/214/257/343/202/212/346/214/201/344/271/205/346/210/246.kif +72 -0
  586. data/lib/bioshogi/explain//346/210/246/345/236/213//345/261/213/346/225/267/346/265/201/344/272/214/346/236/232/351/212/200.kif +77 -0
  587. data/lib/bioshogi/explain//346/210/246/345/236/213//345/261/213/346/225/267/346/265/201/344/272/214/346/236/232/351/212/200/346/243/222/351/212/200/345/236/213.kif +60 -0
  588. data/lib/bioshogi/explain//346/210/246/345/236/213//345/261/261/345/264/216/346/265/201/343/203/221/343/203/203/343/202/257/343/203/236/343/203/263.kif +13 -0
  589. data/lib/bioshogi/explain//346/210/246/345/236/213//345/267/246/347/276/216/346/277/203/346/200/245/346/210/246.kif +76 -0
  590. data/lib/bioshogi/explain//346/210/246/345/236/213//345/271/263/347/233/256.kif +110 -0
  591. data/lib/bioshogi/explain//346/210/246/345/236/213//345/271/273/346/203/263/345/233/233/351/226/223/351/243/233/350/273/212.kif +49 -0
  592. data/lib/bioshogi/explain//346/210/246/345/236/213//346/211/213/345/276/227/350/247/222/344/272/244/346/217/233/345/236/213.kif +14 -0
  593. data/lib/bioshogi/explain//346/210/246/345/236/213//346/211/213/346/220/215/350/247/222/344/272/244/346/217/233/345/236/213.kif +12 -0
  594. data/lib/bioshogi/explain//346/210/246/345/236/213//346/226/260/344/270/270/345/261/261/343/203/257/343/202/257/343/203/201/343/203/263.kif +24 -0
  595. data/lib/bioshogi/explain//346/210/246/345/236/213//346/226/260/345/254/211/351/207/216/346/265/201.kif +15 -0
  596. data/lib/bioshogi/explain//346/210/246/345/236/213//346/226/260/346/235/221/347/224/260/343/202/267/343/202/271/343/203/206/343/203/240.kif +117 -0
  597. data/lib/bioshogi/explain//346/210/246/345/236/213//346/226/260/347/237/263/347/224/260/346/265/201.kif +90 -0
  598. data/lib/bioshogi/explain//346/210/246/345/236/213//346/226/260/347/261/263/351/225/267/347/216/211.kif +10 -0
  599. data/lib/bioshogi/explain//346/210/246/345/236/213//346/226/260/351/242/250/350/273/212.kif +44 -0
  600. data/lib/bioshogi/explain//346/210/246/345/236/213//346/226/260/351/254/274/346/256/272/343/201/227.kif +113 -0
  601. data/lib/bioshogi/explain//346/210/246/345/236/213//346/227/251/347/237/263/347/224/260.kif +68 -0
  602. data/lib/bioshogi/explain//346/210/246/345/236/213//346/232/264/351/212/200.kif +37 -0
  603. data/lib/bioshogi/explain//346/210/246/345/236/213//346/234/250/346/235/221/345/256/232/350/267/241.kif +138 -0
  604. data/lib/bioshogi/explain//346/210/246/345/236/213//346/235/221/347/224/260/343/202/267/343/202/271/343/203/206/343/203/240.kif +19 -0
  605. data/lib/bioshogi/explain//346/210/246/345/236/213//346/243/222/347/216/211.kif +80 -0
  606. data/lib/bioshogi/explain//346/210/246/345/236/213//346/243/222/351/207/221.kif +52 -0
  607. data/lib/bioshogi/explain//346/210/246/345/236/213//346/243/222/351/212/200.kif +65 -0
  608. data/lib/bioshogi/explain//346/210/246/345/236/213//346/243/256/344/270/213/343/202/267/343/202/271/343/203/206/343/203/240.kif +118 -0
  609. data/lib/bioshogi/explain//346/210/246/345/236/213//346/245/240/346/234/254/345/274/217/347/237/263/347/224/260/346/265/201.kif +122 -0
  610. data/lib/bioshogi/explain//346/210/246/345/236/213//346/245/265/351/231/220/346/227/251/347/271/260/343/202/212/351/212/200.kif +51 -0
  611. data/lib/bioshogi/explain//346/210/246/345/236/213//346/250/252/346/255/251/345/217/226/343/202/212.kif +50 -0
  612. data/lib/bioshogi/explain//346/210/246/345/236/213//346/270/205/351/207/216/346/265/201/345/262/220/351/230/234/346/210/246/346/263/225.kif +61 -0
  613. data/lib/bioshogi/explain//346/210/246/345/236/213//347/216/211/351/240/255/344/275/215/345/217/226/343/202/212.kif +35 -0
  614. data/lib/bioshogi/explain//346/210/246/345/236/213//347/216/211/351/240/255/351/212/200.kif +68 -0
  615. data/lib/bioshogi/explain//346/210/246/345/236/213//347/233/256/343/201/217/343/202/211/343/201/276/343/201/227/346/210/246/346/263/225.kif +18 -0
  616. data/lib/bioshogi/explain//346/210/246/345/236/213//347/233/270/346/214/257/343/202/212/351/243/233/350/273/212.kif +14 -0
  617. data/lib/bioshogi/explain//346/210/246/345/236/213//347/233/270/346/216/233/343/201/213/343/202/212.kif +45 -0
  618. data/lib/bioshogi/explain//346/210/246/345/236/213//347/233/270/346/216/233/343/201/213/343/202/212/346/243/222/351/212/200.kif +33 -0
  619. data/lib/bioshogi/explain//346/210/246/345/236/213//347/233/270/346/250/252/346/255/251/345/217/226/343/202/212.kif +72 -0
  620. data/lib/bioshogi/explain//346/210/246/345/236/213//347/233/270/347/255/213/351/201/225/343/201/204/350/247/222.kif +45 -0
  621. data/lib/bioshogi/explain//346/210/246/345/236/213//347/234/237/351/203/250/346/265/201.kif +117 -0
  622. data/lib/bioshogi/explain//346/210/246/345/236/213//347/237/242/345/200/211/344/270/255/351/243/233/350/273/212.kif +71 -0
  623. data/lib/bioshogi/explain//346/210/246/345/236/213//347/237/242/345/200/211/345/267/246/347/276/216/346/277/203/346/200/245/346/210/246.kif +122 -0
  624. data/lib/bioshogi/explain//346/210/246/345/236/213//347/237/242/345/200/211/346/243/222/351/212/200.kif +88 -0
  625. data/lib/bioshogi/explain//346/210/246/345/236/213//347/237/263/347/224/260/346/265/201.kif +58 -0
  626. data/lib/bioshogi/explain//346/210/246/345/236/213//347/250/262/345/272/255/346/210/246/346/263/225.kif +31 -0
  627. data/lib/bioshogi/explain//346/210/246/345/236/213//347/251/264/350/247/222/345/220/221/343/201/213/343/201/204/351/243/233/350/273/212.kif +18 -0
  628. data/lib/bioshogi/explain//346/210/246/345/236/213//347/251/264/350/247/222/346/210/246/346/263/225.kif +133 -0
  629. data/lib/bioshogi/explain//346/210/246/345/236/213//347/253/213/347/237/263/346/265/201/345/233/233/351/226/223/351/243/233/350/273/212.kif +43 -0
  630. data/lib/bioshogi/explain//346/210/246/345/236/213//347/253/257/346/243/222/351/212/200.kif +66 -0
  631. data/lib/bioshogi/explain//346/210/246/345/236/213//347/255/213/351/201/225/343/201/204/350/247/222.kif +78 -0
  632. data/lib/bioshogi/explain//346/210/246/345/236/213//347/261/263/351/225/267/346/265/201/346/200/245/346/210/246/347/237/242/345/200/211.kif +172 -0
  633. data/lib/bioshogi/explain//346/210/246/345/236/213//347/276/275/347/224/237/345/274/217/350/242/226/351/243/233/350/273/212.kif +172 -0
  634. data/lib/bioshogi/explain//346/210/246/345/236/213//350/200/200/351/276/215/343/201/262/343/201/255/343/202/212/351/243/233/350/273/212.kif +24 -0
  635. data/lib/bioshogi/explain//346/210/246/345/236/213//350/200/200/351/276/215/345/233/233/351/226/223/351/243/233/350/273/212.kif +50 -0
  636. data/lib/bioshogi/explain//346/210/246/345/236/213//350/204/207/343/202/267/343/202/271/343/203/206/343/203/240.kif +100 -0
  637. data/lib/bioshogi/explain//346/210/246/345/236/213//350/205/260/346/216/233/343/201/221/351/212/200.kif +73 -0
  638. data/lib/bioshogi/explain//346/210/246/345/236/213//350/212/261/346/235/221/346/265/201/345/220/215/345/217/244/345/261/213/346/210/246/346/263/225.kif +72 -0
  639. data/lib/bioshogi/explain//346/210/246/345/236/213//350/213/261/343/201/241/343/202/203/343/202/223/346/265/201/344/270/255/351/243/233/350/273/212.kif +64 -0
  640. data/lib/bioshogi/explain//346/210/246/345/236/213//350/213/261/346/230/245/346/265/201/343/202/253/343/203/241/343/203/254/343/202/252/343/203/263.kif +135 -0
  641. data/lib/bioshogi/explain//346/210/246/345/236/213//350/217/205/344/272/225/346/265/201/344/270/211/351/226/223/351/243/233/350/273/212.kif +23 -0
  642. data/lib/bioshogi/explain//346/210/246/345/236/213//350/217/234/343/200/205/346/262/263/346/265/201/342/226/263/357/274/224/345/233/233/350/247/222.kif +14 -0
  643. data/lib/bioshogi/explain//346/210/246/345/236/213//350/217/234/343/200/205/346/262/263/346/265/201/345/220/221/343/201/213/343/201/204/351/243/233/350/273/212.kif +24 -0
  644. data/lib/bioshogi/explain//346/210/246/345/236/213//350/227/244/344/272/225/343/202/267/343/202/271/343/203/206/343/203/240.kif +73 -0
  645. data/lib/bioshogi/explain//346/210/246/345/236/213//350/227/244/346/243/256/346/265/201/346/200/245/346/210/246/347/237/242/345/200/211.kif +63 -0
  646. data/lib/bioshogi/explain//346/210/246/345/236/213//350/242/226/351/243/233/350/273/212.kif +60 -0
  647. data/lib/bioshogi/explain//346/210/246/345/236/213//350/243/217/343/202/242/343/203/222/343/203/253/346/210/246/346/263/225.kif +29 -0
  648. data/lib/bioshogi/explain//346/210/246/345/236/213//350/247/222/344/272/244/346/217/233/345/236/213.kif +19 -0
  649. data/lib/bioshogi/explain//346/210/246/345/236/213//350/247/222/344/272/244/346/217/233/346/214/257/343/202/212/351/243/233/350/273/212.kif +64 -0
  650. data/lib/bioshogi/explain//346/210/246/345/236/213//350/247/222/346/217/233/343/202/217/343/202/212.kif +20 -0
  651. data/lib/bioshogi/explain//346/210/246/345/236/213//350/247/222/346/217/233/343/202/217/343/202/212/346/226/260/345/236/213.kif +49 -0
  652. data/lib/bioshogi/explain//346/210/246/345/236/213//350/247/222/346/217/233/343/202/217/343/202/212/346/227/251/347/271/260/343/202/212/351/212/200.kif +76 -0
  653. data/lib/bioshogi/explain//346/210/246/345/236/213//350/247/222/346/217/233/343/202/217/343/202/212/346/243/222/351/212/200.kif +65 -0
  654. data/lib/bioshogi/explain//346/210/246/345/236/213//350/247/222/346/217/233/343/202/217/343/202/212/350/205/260/346/216/233/343/201/221/351/212/200.kif +76 -0
  655. data/lib/bioshogi/explain//346/210/246/345/236/213//350/247/222/351/201/223/343/202/252/343/203/274/343/203/227/343/203/263/345/233/233/351/226/223/351/243/233/350/273/212.kif +12 -0
  656. data/lib/bioshogi/explain//346/210/246/345/236/213//350/247/222/351/240/255/346/255/251/346/210/246/346/263/225.kif +15 -0
  657. data/lib/bioshogi/explain//346/210/246/345/236/213//350/266/205/346/200/245/346/210/246.kif +28 -0
  658. data/lib/bioshogi/explain//346/210/246/345/236/213//350/266/205/351/200/237/342/226/262/357/274/223/344/270/203/351/212/200.kif +116 -0
  659. data/lib/bioshogi/explain//346/210/246/345/236/213//351/201/240/345/261/261/346/265/201.kif +98 -0
  660. data/lib/bioshogi/explain//346/210/246/345/236/213//351/203/275/346/210/220/346/265/201/342/226/263/357/274/223/344/270/200/351/207/221.kif +28 -0
  661. data/lib/bioshogi/explain//346/210/246/345/236/213//351/207/221/351/212/200/346/251/213.kif +50 -0
  662. data/lib/bioshogi/explain//346/210/246/345/236/213//351/212/200/351/233/262/351/233/200.kif +38 -0
  663. data/lib/bioshogi/explain//346/210/246/345/236/213//351/216/226/351/216/214/351/212/200.kif +77 -0
  664. data/lib/bioshogi/explain//346/210/246/345/236/213//351/230/252/347/224/260/346/265/201/345/220/221/351/243/233/350/273/212.kif +87 -0
  665. data/lib/bioshogi/explain//346/210/246/345/236/213//351/230/277/344/271/205/346/264/245/346/265/201/346/200/245/346/210/246/347/237/242/345/200/211.kif +74 -0
  666. data/lib/bioshogi/explain//346/210/246/345/236/213//351/231/275/345/213/225/346/214/257/343/202/212/351/243/233/350/273/212.kif +62 -0
  667. data/lib/bioshogi/explain//346/210/246/345/236/213//351/233/200/345/210/272/343/201/227.kif +140 -0
  668. data/lib/bioshogi/explain//346/210/246/345/236/213//351/235/222/351/207/216/346/265/201.kif +31 -0
  669. data/lib/bioshogi/explain//346/210/246/345/236/213//351/242/250/350/273/212.kif +134 -0
  670. data/lib/bioshogi/explain//346/210/246/345/236/213//351/243/257/345/263/266/346/265/201/345/274/225/343/201/215/350/247/222/346/210/246/346/263/225.kif +42 -0
  671. data/lib/bioshogi/explain//346/210/246/345/236/213//351/243/257/345/263/266/346/265/201/347/233/270/346/216/233/343/201/213/343/202/212/345/274/225/343/201/215/350/247/222/346/210/246/346/263/225.kif +49 -0
  672. data/lib/bioshogi/explain//346/210/246/345/236/213//351/253/230/347/224/260/346/265/201/345/267/246/347/216/211.kif +60 -0
  673. data/lib/bioshogi/explain//346/210/246/345/236/213//351/254/274/346/256/272/343/201/227.kif +173 -0
  674. data/lib/bioshogi/explain//346/210/246/345/236/213//351/254/274/346/256/272/343/201/227/345/220/221/343/201/213/343/201/204/351/243/233/350/273/212.kif +73 -0
  675. data/lib/bioshogi/explain//346/210/246/345/236/213//351/255/224/347/225/214/345/233/233/351/226/223/351/243/233/350/273/212.kif +25 -0
  676. data/lib/bioshogi/explain//346/210/246/345/236/213//351/263/245/345/210/272/343/201/227.kif +32 -0
  677. data/lib/bioshogi/explain//346/210/246/345/236/213//351/267/272/345/256/256/345/256/232/350/267/241.kif +72 -0
  678. data/lib/bioshogi/explain//346/210/246/345/236/213//357/274/224/342/206/222/357/274/223/346/210/246/346/263/225.kif +72 -0
  679. data/lib/bioshogi/explain//346/210/246/345/236/213//357/274/226/347/255/213/344/275/215/345/217/226/343/202/212.kif +42 -0
  680. data/lib/bioshogi/explain//346/211/213/347/255/213//343/201/265/343/202/223/343/201/251/343/201/227/343/201/256/346/241/202.kif +25 -0
  681. data/lib/bioshogi/explain//346/211/213/347/255/213//343/203/221/343/203/263/343/203/204/343/202/222/350/204/261/343/201/220.kif +28 -0
  682. data/lib/bioshogi/explain//346/211/213/347/255/213//343/203/255/343/202/261/343/203/203/343/203/210.kif +25 -0
  683. data/lib/bioshogi/explain//346/211/213/347/255/213//345/211/262/343/202/212/346/211/223/343/201/241/343/201/256/351/212/200.kif +28 -0
  684. data/lib/bioshogi/explain//346/211/213/347/255/213//345/236/202/343/202/214/346/255/251.kif +25 -0
  685. data/lib/bioshogi/explain//346/211/213/347/255/213//345/271/275/351/234/212/350/247/222.kif +36 -0
  686. data/lib/bioshogi/explain//346/211/213/347/255/213//346/241/202/351/240/255/343/201/256/351/212/200.kif +25 -0
  687. data/lib/bioshogi/explain//346/211/213/347/255/213//347/266/231/343/201/216/346/241/202.kif +25 -0
  688. data/lib/bioshogi/explain//346/211/213/347/255/213//350/205/271/351/212/200.kif +25 -0
  689. data/lib/bioshogi/explain//346/211/213/347/255/213//351/201/240/350/246/213/343/201/256/350/247/222.kif +25 -0
  690. data/lib/bioshogi/explain//346/211/213/347/255/213//351/207/221/345/272/225/343/201/256/346/255/251.kif +30 -0
  691. data/lib/bioshogi/explain//346/211/213/347/255/213//351/212/200/345/206/240/343/201/256/345/260/217/351/203/250/345/261/213.kif +86 -0
  692. data/lib/bioshogi/extreme_validator.rb +145 -0
  693. data/lib/bioshogi/formatter/akf_builder.rb +79 -0
  694. data/lib/bioshogi/formatter/animation/animation_apng_builder.rb +18 -0
  695. data/lib/bioshogi/formatter/animation/animation_builder_timeout.rb +28 -0
  696. data/lib/bioshogi/formatter/animation/animation_gif_builder.rb +166 -0
  697. data/lib/bioshogi/formatter/animation/animation_mp4_builder.rb +370 -0
  698. data/lib/bioshogi/formatter/animation/animation_webp_builder.rb +14 -0
  699. data/lib/bioshogi/formatter/animation/animation_zip_builder.rb +72 -0
  700. data/lib/bioshogi/formatter/animation/audio_theme_info.rb +97 -0
  701. data/lib/bioshogi/formatter/animation/demo_builder.rb +58 -0
  702. data/lib/bioshogi/formatter/animation/ffmpeg_support.rb +110 -0
  703. data/lib/bioshogi/formatter/animation/progress_cop.rb +114 -0
  704. data/lib/bioshogi/formatter/animation/serial_filename_generator.rb +55 -0
  705. data/lib/bioshogi/formatter/animation/system_support.rb +60 -0
  706. data/lib/bioshogi/formatter/core.rb +239 -0
  707. data/lib/bioshogi/formatter/csa_builder.rb +150 -0
  708. data/lib/bioshogi/formatter/ki2_builder.rb +58 -0
  709. data/lib/bioshogi/formatter/kif_builder.rb +83 -0
  710. data/lib/bioshogi/formatter/kif_ki2_shared.rb +144 -0
  711. data/lib/bioshogi/formatter/last_action_info.rb +77 -0
  712. data/lib/bioshogi/formatter/parser_methods.rb +37 -0
  713. data/lib/bioshogi/formatter/runner.rb +44 -0
  714. data/lib/bioshogi/formatter/skill_embed.rb +174 -0
  715. data/lib/bioshogi/hand/drop.rb +78 -0
  716. data/lib/bioshogi/hand/move.rb +114 -0
  717. data/lib/bioshogi/hand/shared.rb +102 -0
  718. data/lib/bioshogi/hand_log.rb +72 -0
  719. data/lib/bioshogi/hand_logs.rb +21 -0
  720. data/lib/bioshogi/hand_logs_mod.rb +29 -0
  721. data/lib/bioshogi/input_adapter/abstract_adapter.rb +126 -0
  722. data/lib/bioshogi/input_adapter/csa_adapter.rb +56 -0
  723. data/lib/bioshogi/input_adapter/ki2_adapter.rb +155 -0
  724. data/lib/bioshogi/input_adapter/ki2_motion_wrapper.rb +42 -0
  725. data/lib/bioshogi/input_adapter/ki2_place_methods.rb +50 -0
  726. data/lib/bioshogi/input_adapter/kif_adapter.rb +64 -0
  727. data/lib/bioshogi/input_adapter/location_validation.rb +23 -0
  728. data/lib/bioshogi/input_adapter/origin_soldier_methods.rb +24 -0
  729. data/lib/bioshogi/input_adapter/sfen_adapter.rb +60 -0
  730. data/lib/bioshogi/input_adapter/shared_validation.rb +110 -0
  731. data/lib/bioshogi/input_parser.rb +74 -0
  732. data/lib/bioshogi/kanji_number.rb +128 -0
  733. data/lib/bioshogi/kifu_format_info.rb +15 -0
  734. data/lib/bioshogi/location.rb +131 -0
  735. data/lib/bioshogi/logger.rb +5 -0
  736. data/lib/bioshogi/main_clock.rb +21 -0
  737. data/lib/bioshogi/media.rb +85 -0
  738. data/lib/bioshogi/official_formatter.rb +433 -0
  739. data/lib/bioshogi/order_info.rb +12 -0
  740. data/lib/bioshogi/parser/base.rb +61 -0
  741. data/lib/bioshogi/parser/bod_parser.rb +8 -0
  742. data/lib/bioshogi/parser/csa_parser.rb +198 -0
  743. data/lib/bioshogi/parser/header.rb +82 -0
  744. data/lib/bioshogi/parser/inspector.rb +47 -0
  745. data/lib/bioshogi/parser/kakinoki_methods.rb +125 -0
  746. data/lib/bioshogi/parser/ki2_parser.rb +39 -0
  747. data/lib/bioshogi/parser/kif_parser.rb +60 -0
  748. data/lib/bioshogi/parser/pi.rb +45 -0
  749. data/lib/bioshogi/parser/sfen_parser.rb +26 -0
  750. data/lib/bioshogi/parser/time_parser.rb +24 -0
  751. data/lib/bioshogi/parser.rb +40 -0
  752. data/lib/bioshogi/piece/ek_score_info.rb +22 -0
  753. data/lib/bioshogi/piece/piece_csa.rb +31 -0
  754. data/lib/bioshogi/piece/piece_pressure.rb +23 -0
  755. data/lib/bioshogi/piece/piece_scale.rb +19 -0
  756. data/lib/bioshogi/piece/piece_score.rb +31 -0
  757. data/lib/bioshogi/piece/piece_vector.rb +156 -0
  758. data/lib/bioshogi/piece/yomiage_piece_info.rb +31 -0
  759. data/lib/bioshogi/piece.rb +276 -0
  760. data/lib/bioshogi/piece_box.rb +152 -0
  761. data/lib/bioshogi/place.rb +171 -0
  762. data/lib/bioshogi/player/other_methods.rb +60 -0
  763. data/lib/bioshogi/player/piece_box_methods.rb +33 -0
  764. data/lib/bioshogi/player/pressure_methods.rb +37 -0
  765. data/lib/bioshogi/player/soldier_methods.rb +45 -0
  766. data/lib/bioshogi/player.rb +101 -0
  767. data/lib/bioshogi/player_executor/base.rb +120 -0
  768. data/lib/bioshogi/player_executor/brain.rb +7 -0
  769. data/lib/bioshogi/player_executor/error_handler.rb +49 -0
  770. data/lib/bioshogi/player_executor/human.rb +8 -0
  771. data/lib/bioshogi/player_executor/without_monitor.rb +7 -0
  772. data/lib/bioshogi/preset_info.rb +130 -0
  773. data/lib/bioshogi/rect.rb +6 -0
  774. data/lib/bioshogi/screen_image/README.org +14 -0
  775. data/lib/bioshogi/screen_image/board_methods.rb +148 -0
  776. data/lib/bioshogi/screen_image/color_theme_info.rb +137 -0
  777. data/lib/bioshogi/screen_image/core_methods.rb +337 -0
  778. data/lib/bioshogi/screen_image/font_theme_info.rb +35 -0
  779. data/lib/bioshogi/screen_image/helper.rb +73 -0
  780. data/lib/bioshogi/screen_image/layer_methods.rb +87 -0
  781. data/lib/bioshogi/screen_image/palette_info.rb +15 -0
  782. data/lib/bioshogi/screen_image/pentagon.rb +167 -0
  783. data/lib/bioshogi/screen_image/piece_font_weight_info.rb +12 -0
  784. data/lib/bioshogi/screen_image/renderer.rb +15 -0
  785. data/lib/bioshogi/screen_image/soldier_methods.rb +136 -0
  786. data/lib/bioshogi/screen_image/stand.rb +132 -0
  787. data/lib/bioshogi/screen_image/turn_methods.rb +45 -0
  788. data/lib/bioshogi/screen_image.rb +11 -0
  789. data/lib/bioshogi/sfen.rb +120 -0
  790. data/lib/bioshogi/sfen_importer.rb +29 -0
  791. data/lib/bioshogi/simple_model.rb +13 -0
  792. data/lib/bioshogi/simulator.rb +44 -0
  793. data/lib/bioshogi/single_clock.rb +36 -0
  794. data/lib/bioshogi/soldier.rb +293 -0
  795. data/lib/bioshogi/soldier_box.rb +38 -0
  796. data/lib/bioshogi/soldier_walker.rb +122 -0
  797. data/lib/bioshogi/source.rb +30 -0
  798. data/lib/bioshogi/tasks/about.rake +5 -0
  799. data/lib/bioshogi/tasks/chore.rake +8 -0
  800. data/lib/bioshogi/tasks/clean.rake +4 -0
  801. data/lib/bioshogi/tasks/color_theme.rake +9 -0
  802. data/lib/bioshogi/tasks/demo.rake +11 -0
  803. data/lib/bioshogi/tasks/doc.rake +11 -0
  804. data/lib/bioshogi/tasks/extreme_validator.rake +8 -0
  805. data/lib/bioshogi/tasks/generate.rake +9 -0
  806. data/lib/bioshogi/tasks/loader.rake +9 -0
  807. data/lib/bioshogi/tasks/normalize.rake +8 -0
  808. data/lib/bioshogi/tasks/tactic_validator.rake +8 -0
  809. data/lib/bioshogi/tasks/test.rake +41 -0
  810. data/lib/bioshogi/turn_info.rb +67 -0
  811. data/lib/bioshogi/v/once_vector.rb +10 -0
  812. data/lib/bioshogi/v/repeat_vector.rb +10 -0
  813. data/lib/bioshogi/v.rb +77 -0
  814. data/lib/bioshogi/vector_constants.rb +4 -0
  815. data/lib/bioshogi/version.rb +3 -0
  816. data/lib/bioshogi/yomiage/formatter.rb +31 -0
  817. data/lib/bioshogi/yomiage/kanji_info.rb +19 -0
  818. data/lib/bioshogi/yomiage/number_info.rb +18 -0
  819. data/lib/bioshogi.rb +62 -0
  820. metadata +1149 -0
@@ -0,0 +1,79 @@
1
+ # frozen-string-literal: true
2
+
3
+ module Bioshogi
4
+ module Formatter
5
+ class AkfBuilder
6
+ include Builder
7
+
8
+ def self.default_params
9
+ super.merge({})
10
+ end
11
+
12
+ def initialize(formatter, params = {})
13
+ @formatter = formatter
14
+ @params = self.class.default_params.merge(params)
15
+ end
16
+
17
+ def to_h
18
+ @formatter.container_run_once
19
+
20
+ @container2 = Container::Basic.new
21
+ @formatter.container_init(@container2)
22
+
23
+ @hv = {}
24
+ @hv[:header] = @formatter.pi.header.to_h.clone
25
+ @hv[:header]["手数"] = @formatter.pi.move_infos.size
26
+
27
+ @main_clock = MainClock.new
28
+
29
+ @hv[:moves] = []
30
+ @hv[:moves] << {
31
+ :index => 0,
32
+ :human_index => @container2.initial_state_turn_info.display_turn,
33
+ :place_same => nil,
34
+ **@main_clock.last_clock.to_h,
35
+ :total_seconds => 0,
36
+ :used_seconds => nil,
37
+ :skill => nil,
38
+ :history_sfen => @container2.to_history_sfen,
39
+ :short_sfen => @container2.to_short_sfen,
40
+ }
41
+ @hv[:moves] += @formatter.pi.move_infos.collect.with_index do |info, i|
42
+ @container2.execute(info[:input], used_seconds: @formatter.used_seconds_at(i))
43
+ @main_clock.add(@formatter.used_seconds_at(i))
44
+ hand_log = @container2.hand_logs.last
45
+ {
46
+ :index => i.next,
47
+ :human_index => @container2.initial_state_turn_info.display_turn + i.next,
48
+ :place_same => hand_log.place_same,
49
+ **hand_log.to_akf,
50
+ **@main_clock.last_clock.to_h,
51
+ :skill => hand_log.skill_set.to_h,
52
+ :history_sfen => @container2.to_history_sfen,
53
+ :short_sfen => @container2.to_short_sfen,
54
+ }
55
+ end
56
+
57
+ # if @formatter.pi.last_action_params
58
+ # if used_seconds = @formatter.pi.last_action_params[:used_seconds]
59
+ # if @main_clock
60
+ # @main_clock.add(used_seconds)
61
+ # right_part = @main_clock.to_s
62
+ # end
63
+ # end
64
+ # end
65
+
66
+ # @hv[:header] = @hv[:header]
67
+
68
+ if @formatter.last_action_info
69
+ @hv[:last_action_kakinoki_word] = @formatter.last_action_info.kakinoki_word
70
+ end
71
+
72
+ @hv[:judgment_message] = @formatter.judgment_message
73
+ @hv[:error_text] = @formatter.error_message_part
74
+
75
+ @hv
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,18 @@
1
+ module Bioshogi
2
+ module Formatter
3
+ module Animation
4
+ class AnimationApngBuilder < AnimationGifBuilder
5
+ def ext_name
6
+ "apng"
7
+ end
8
+
9
+ # apng も普通に変換すると1枚目のパレットで全体が決まってしまう
10
+ # だけど PNG24 で保存するようにしたのでこれは必要ない
11
+ # けど一応いれとこう
12
+ def ffmpeg_option_fine_tune_for_each_file_type
13
+ "-pix_fmt rgb24"
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,28 @@
1
+ module Bioshogi
2
+ module Formatter
3
+ module Animation
4
+ concern :AnimationBuilderTimeout do
5
+ private
6
+
7
+ def tob(name, expires_in = 30, &block)
8
+ begin
9
+ t = Time.now
10
+ logger.info { "[#{name}][begin]" }
11
+ begin
12
+ Timeout::timeout(expires_in, &block)
13
+ rescue Timeout::Error => error
14
+ raise Timeout::Error, "[#{name}] #{error.message}"
15
+ end
16
+ ensure
17
+ t = (Time.now - t).round
18
+ logger.info { "[#{name}][end][#{t}s]" }
19
+ end
20
+ end
21
+
22
+ def heavy_tob(name, &block)
23
+ tob(name, 60, &block)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,166 @@
1
+ module Bioshogi
2
+ module Formatter
3
+ module Animation
4
+ class AnimationGifBuilder
5
+ include Builder
6
+ include AnimationBuilderTimeout
7
+ include FfmpegSupport
8
+
9
+ def self.default_params
10
+ super.merge({
11
+ :loop_key => "is_loop_infinite", # ループモード
12
+ })
13
+ end
14
+
15
+ # attr_accessor :formatter
16
+ # attr_accessor :params
17
+
18
+ def initialize(formatter, params = {})
19
+ @formatter = formatter
20
+ @params = self.class.default_params.merge(params)
21
+ end
22
+
23
+ def to_binary
24
+ logger.tagged(self.class.name.demodulize) do
25
+ in_work_directory do
26
+ logger.info { "生成に使うもの: #{factory_method_key}" }
27
+ logger.info { "最後に追加するフレーム数(end_pages): #{end_pages}" }
28
+ logger.info { "1手当たりの秒数(page_duration): #{page_duration}" }
29
+
30
+ @container = @formatter.container_for_image
31
+ @screen_image_renderer = ScreenImage.renderer(@container, params)
32
+
33
+ if factory_method_key == "is_factory_method_rmagick"
34
+ @progress_cop = ProgressCop.new(1 + 1 + @formatter.pi.move_infos.size + end_pages + 1 + 1, &params[:progress_callback])
35
+
36
+ begin
37
+ list = Magick::ImageList.new
38
+
39
+ if v = params[:cover_text].presence
40
+ @progress_cop.next_step("表紙描画")
41
+ tob("表紙描画") { list << CoverImage.renderer(text: v, **params.slice(:bottom_text, :width, :height)).render }
42
+ end
43
+
44
+ @progress_cop.next_step("初期配置")
45
+ tob("初期配置") { list << @screen_image_renderer.next_build }
46
+
47
+ @formatter.pi.move_infos.each.with_index do |e, i|
48
+ @progress_cop.next_step("(#{i}/#{@formatter.pi.move_infos.size}) #{e[:input]}")
49
+ @container.execute(e[:input])
50
+ tob("#{i}/#{@formatter.pi.move_infos.size}") { list << @screen_image_renderer.next_build }
51
+ logger.info { "move: #{i} / #{@formatter.pi.move_infos.size}" } if i.modulo(10).zero?
52
+ end
53
+
54
+ end_pages.times do |i|
55
+ @progress_cop.next_step("終了図 #{i}/#{end_pages}")
56
+ tob("終了図 #{i}/#{end_pages}") { list << @screen_image_renderer.last_rendered_image.copy }
57
+ end
58
+
59
+ list.delay = list.ticks_per_second * page_duration
60
+
61
+ logger.info { "ticks_per_second: #{list.ticks_per_second}" }
62
+ logger.info { "delay: #{list.delay}" }
63
+
64
+ # 46s 5.5M optimize_layers なし
65
+ # 43s 544K optimize_layers あり
66
+ @progress_cop.next_step("最適化")
67
+ heavy_tob(:optimize_layers) do
68
+ list = list.optimize_layers(Magick::OptimizeLayer) # 各ページを最小枠にする (重要) ステージングではここで落ちる
69
+ end
70
+
71
+ list.iterations = iterations_number # 繰り返し回数
72
+
73
+ @progress_cop.next_step("#{ext_name} 生成")
74
+ heavy_tob(:write) do
75
+ list.write("_output1.#{ext_name}")
76
+ end
77
+ ensure
78
+ list.each(&:destroy!)
79
+ end
80
+ end
81
+
82
+ if factory_method_key == "is_factory_method_ffmpeg"
83
+ command_required! :ffmpeg
84
+
85
+ @progress_cop = ProgressCop.new(1 + 1 + @formatter.pi.move_infos.size + end_pages + 1, &params[:progress_callback])
86
+
87
+ if v = params[:cover_text].presence
88
+ @progress_cop.next_step("表紙描画")
89
+ tob("表紙描画") { CoverImage.renderer(text: v, **params.slice(:bottom_text, :width, :height)).render.write(sfg.next) }
90
+ end
91
+
92
+ @progress_cop.next_step("初期配置")
93
+ tob("初期配置") { @screen_image_renderer.next_build.write(sfg.next) }
94
+
95
+ @formatter.pi.move_infos.each.with_index do |e, i|
96
+ @progress_cop.next_step("(#{i}/#{@formatter.pi.move_infos.size}) #{e[:input]}")
97
+ @container.execute(e[:input])
98
+ tob("#{i}/#{@formatter.pi.move_infos.size}") { @screen_image_renderer.next_build.write(sfg.next) }
99
+ logger.info { "move: #{i} / #{@formatter.pi.move_infos.size}" } if i.modulo(10).zero?
100
+ end
101
+
102
+ end_pages.times do |i|
103
+ @progress_cop.next_step("終了図 #{i}/#{end_pages}")
104
+ tob("終了図 #{i}/#{end_pages}") { @screen_image_renderer.last_rendered_image.write(sfg.next) }
105
+ end
106
+
107
+ @progress_cop.next_step("#{ext_name} 生成 #{sfg.index}p")
108
+ logger.info { sfg.inspect }
109
+ logger.info { "ソース画像確認\n#{sfg.shell_inspect}" }
110
+ strict_system %(ffmpeg -v warning -hide_banner -framerate #{fps_value} -i #{sfg.name} #{ffmpeg_option_fine_tune_for_each_file_type} #{ffmpeg_after_embed_options} -y _output1.#{ext_name})
111
+ logger.info { `ls -alh _output1.#{ext_name}`.strip }
112
+ end
113
+
114
+ @screen_image_renderer.clear_all
115
+
116
+ File.binread("_output1.#{ext_name}")
117
+ end
118
+ end
119
+ end
120
+
121
+ private
122
+
123
+ def ext_name
124
+ "gif"
125
+ end
126
+
127
+ # 繰り返し回数
128
+ #
129
+ # 0: 無限ループ
130
+ # 1: 1回
131
+ # 2: 2回
132
+ #
133
+ # exiftool では "Animation Iterations" の項目でこの値がわかるが1ずれている
134
+ # exiftool では「繰り返す回数」つまり「戻る回数」なので1なら戻らないので0で、なぜか0は表示されない
135
+ # 0なら無限と表示され、2なら1回(戻る)と表示される
136
+ #
137
+ def iterations_number
138
+ if params[:loop_key] == "is_loop_infinite"
139
+ 0
140
+ else
141
+ 1
142
+ end
143
+ end
144
+
145
+ # 「1枚目に白黒のタイトル画像があり、次に盤の画像が並ぶ場合、盤が白黒になってしまうのを防ぐ」ために
146
+ # 追加したオプションだったが、元凶は1枚目がグレースケールだったのでそれを PNG24: で保存すればグレー化問題は解決した
147
+ # だからこのオプションを外したら GIF が超汚ない
148
+ # グレー化問題にかかわらずこのオプションは付けておいた方がよさそうだ
149
+ #
150
+ # 具体的に何がなんだかわかってない
151
+ # とりあえず下のサイトから拝借してサイズやフレーム数を取った
152
+ # また stats_mode を single 以外にすると1枚目の画像がスキップされてしまうので注意
153
+ # これは ffmpeg のバグだろうか。これもよくわからない
154
+ #
155
+ # ffmpegでとにかく綺麗なGIFを作りたい
156
+ # https://qiita.com/yusuga/items/ba7b5c2cac3f2928f040
157
+ #
158
+ # FFMPEG で 256色を最適化する PALETTEGEN, PALETTEUSE
159
+ # https://nico-lab.net/optimized_256_colors_with_ffmpeg/
160
+ def ffmpeg_option_fine_tune_for_each_file_type
161
+ %(-filter_complex "[0:v] split [a][b];[a] palettegen=stats_mode=single:reserve_transparent=0 [p];[b][p] paletteuse=new=1")
162
+ end
163
+ end
164
+ end
165
+ end
166
+ end
@@ -0,0 +1,370 @@
1
+ # frozen-string-literal: true
2
+ #
3
+ # フレームレートを指定値に変換する。指定しない場合は入力ファイルの値を継承
4
+ # http://mobilehackerz.jp/archive/wiki/index.php?%BA%C7%BF%B7ffmpeg%A4%CE%A5%AA%A5%D7%A5%B7%A5%E7%A5%F3%A4%DE%A4%C8%A4%E1
5
+ # 小数で指定してはいけない
6
+ #
7
+ # FFMPEG でのフレームレート設定の違い
8
+ # https://nico-lab.net/setting_fps_with_ffmpeg/
9
+ # 入力オプションとしての -r
10
+ # 入力ファイルの前に指定する。総フレーム数はそのままに1秒あたりのフレームレートを指定するので、オリジナルよりフレームレートが少なければ動画時間が長く、多ければ動画時間が短くなる。
11
+ #
12
+ # ruby 0102_speed_compare.rb
13
+ # 7819.15000002482
14
+ # 9034.157999994932
15
+ # -rw------- 1 ikeda staff 60K 8 16 19:16 _output0.mp4
16
+ # -rw-r--r-- 1 ikeda staff 119K 8 16 19:16 _output1_1.mp4
17
+ # -rw-r--r-- 1 ikeda staff 135K 8 16 19:17 _output1_2.mp4
18
+ #
19
+ # ▼ビデオビットレート関連オプション
20
+ #
21
+ # https://tech.ckme.co.jp/ffmpeg_h264.shtml
22
+ # |-------------+--------+--------------------------------------------------------------------------------------------------------|
23
+ # | オプション | 初期値 | 意味 |
24
+ # |-------------+--------+--------------------------------------------------------------------------------------------------------|
25
+ # | -crf 23 | 23 | 品質固定モード。18..23 推奨。保存用なら18未満、モバイルなら24以上もあり。6減るとビットレートが倍になる |
26
+ # | -b:v XXXk | なし | ビットレート一定モード。FullHDで25M。4kで100Mは欲しい |
27
+ # | -preset xxx | medium | crf のとき使える。placebo になるほど遅いがファイルサイズが減る |
28
+ # | -tune | なし | preset のとき使える。stillimage はスライドショー用 |
29
+ # |-------------+--------+--------------------------------------------------------------------------------------------------------|
30
+ #
31
+ # ▼確認
32
+ #
33
+ # info = Bioshogi::Parser.parse("position startpos moves 7g7f 8c8d 7i6h 3c3d 6h7g")
34
+ # bin = info.to_animation_mp4(end_duration: 1, cover_text: "x", progress_callback: -> e { puts e.log })
35
+ # Pathname("_output.mp4").write(bin)
36
+ #
37
+ module Bioshogi
38
+ module Formatter
39
+ module Animation
40
+ class AnimationMp4Builder
41
+ include Builder
42
+ include AnimationBuilderTimeout
43
+ include FfmpegSupport
44
+
45
+ def self.default_params
46
+ super.merge({
47
+ # Audio関連
48
+ :audio_enable => true, # 音を結合するか?
49
+ :fadeout_duration => nil, # ファイドアウト秒数。空なら end_pages * page_duration
50
+ :main_volume => 0.8, # 音量
51
+
52
+ # テーマ関連
53
+ :audio_theme_key => nil, # テーマみたいなものでパラメータを一括設定するキー。audio_theme_none なら明示的にオーディオなしにするけど、nilなら何もしない
54
+ :audio_part_a => ASSETS_DIR.join("audios/headspin_long.m4a"), # 序盤
55
+ :audio_part_b => ASSETS_DIR.join("audios/breakbeat_long_strip.m4a"), # 中盤移行
56
+ :audio_part_a_volume => 1.0, # DEPRECATION: 1.0 固定とする
57
+ :audio_part_b_volume => 1.0, # DEPRECATION: 1.0 固定とする
58
+ :acrossfade_duration => 2.0, # 0なら単純な連結
59
+
60
+ # 埋め込み
61
+ :metadata_title => nil,
62
+ :metadata_comment => nil,
63
+
64
+ :video_crf => 23, # video 品質固定モード(基本こちらを指定する。初期値23で18..23推奨。24以上でモバイル向け)
65
+ :video_bit_rate => nil, # video ビットレート一定モード(基本指定しない)
66
+ :video_tune => "stillimage", # video 最適化の種類 stillimage:動きの少ない動画用
67
+ :audio_bit_rate => nil, # audio ビットレート。ffmpegの初期値 128k
68
+ })
69
+ end
70
+
71
+ # attr_accessor :formatter
72
+ # attr_accessor :params
73
+
74
+ def initialize(formatter, params = {})
75
+ @formatter = formatter
76
+ @params = self.class.default_params.merge(params)
77
+ if audio_theme_info
78
+ @params.update(audio_theme_info.to_params)
79
+ end
80
+ # theme を上書きする用
81
+ if v = params[:audio_theme_override_params]
82
+ @params.update(v)
83
+ end
84
+ end
85
+
86
+ # リファクタリングしたくなる気持ちを抑えよう(重要)
87
+ def to_binary
88
+ logger.tagged(self.class.name.demodulize) do
89
+ in_work_directory do
90
+ logger.tagged("video") do
91
+ logger.info { "1. 動画準備" }
92
+
93
+ logger.info { "生成に使うもの: #{factory_method_key}" }
94
+ logger.info { "最後に追加するページ数(end_pages): #{end_pages}" }
95
+ logger.info { "1手当たりの秒数(page_duration): #{page_duration}" }
96
+
97
+ command_required! :ffmpeg
98
+ ffmpeg_version_required!
99
+
100
+ @container = @formatter.container_for_image
101
+ @screen_image_renderer = ScreenImage.renderer(@container, params)
102
+
103
+ if factory_method_key == "is_factory_method_rmagick"
104
+ @progress_cop = ProgressCop.new(1 + 1 + @formatter.pi.move_infos.size + 3 + 7, &params[:progress_callback])
105
+
106
+ begin
107
+ list = Magick::ImageList.new
108
+
109
+ if v = params[:cover_text].presence
110
+ @progress_cop.next_step("表紙描画")
111
+ tob("表紙描画") { list << CoverImage.renderer(text: v, **params.slice(:bottom_text, :width, :height)).render }
112
+ end
113
+
114
+ @progress_cop.next_step("初期配置")
115
+ list << @screen_image_renderer.next_build
116
+ @formatter.pi.move_infos.each.with_index do |e, i|
117
+ @progress_cop.next_step("(#{i}/#{@formatter.pi.move_infos.size}) #{e[:input]}")
118
+ @container.execute(e[:input])
119
+ list << @screen_image_renderer.next_build
120
+ logger.info { "move: #{i} / #{@formatter.pi.move_infos.size}" } if i.modulo(10).zero?
121
+ end
122
+ end_pages.times do |i|
123
+ @progress_cop.next_step("終了図 #{i}/#{end_pages}")
124
+ tob("終了図 #{i}/#{end_pages}") { list << @screen_image_renderer.last_rendered_image.copy }
125
+ end
126
+ @progress_cop.next_step("mp4 生成")
127
+ heavy_tob(:write) do
128
+ list.write("_output0.mp4") # staging ではここで例外も出さずに落ちることがある
129
+ end
130
+ logger.info { "write[end]: _output0.mp4" }
131
+ logger.info { `ls -alh _output0.mp4`.strip }
132
+ logger.info { "_output0.mp4: #{Media.duration('_output0.mp4')}" } if false
133
+ @page_count = list.count
134
+ ensure
135
+ list.each(&:destroy!) # 恐いので明示的に解放しとこう
136
+ end
137
+
138
+ logger.info { "合計ページ数: #{@page_count}" }
139
+
140
+ @progress_cop.next_step("YUV420変換")
141
+ logger.info { "1. YUV420化" }
142
+ strict_system %(ffmpeg -v warning -hide_banner -r #{fps_value} -i _output0.mp4 -c:v libx264 -pix_fmt yuv420p -movflags +faststart #{video_crf_o} #{video_tune_o} #{video_bit_rate_o} #{ffmpeg_after_embed_options} -y _output1.mp4)
143
+ end
144
+
145
+ if factory_method_key == "is_factory_method_ffmpeg"
146
+ logger.info { "[TRACE] #{__FILE__}:#{__LINE__}" }
147
+ @progress_cop = ProgressCop.new(1 + 1 + @formatter.pi.move_infos.size + end_pages + 1 + 6, &params[:progress_callback])
148
+
149
+ logger.info { "[TRACE] #{__FILE__}:#{__LINE__}" }
150
+ if v = params[:cover_text].presence
151
+ logger.info { "[TRACE] #{__FILE__}:#{__LINE__}" }
152
+ @progress_cop.next_step("表紙描画")
153
+ logger.info { "[TRACE] #{__FILE__}:#{__LINE__}" }
154
+ tob("表紙描画") { CoverImage.renderer(text: v, **params.slice(:bottom_text, :width, :height)).render.write(sfg.next) }
155
+ logger.info { "[TRACE] #{__FILE__}:#{__LINE__}" }
156
+ end
157
+
158
+ logger.info { "[TRACE] #{__FILE__}:#{__LINE__}" }
159
+ @progress_cop.next_step("初期配置")
160
+ logger.info { "[TRACE] #{__FILE__}:#{__LINE__}" }
161
+ tob("初期配置") { @screen_image_renderer.next_build.write(sfg.next) }
162
+ logger.info { "[TRACE] #{__FILE__}:#{__LINE__}" }
163
+
164
+ @formatter.pi.move_infos.each.with_index do |e, i|
165
+ @progress_cop.next_step("(#{i}/#{@formatter.pi.move_infos.size}) #{e[:input]}")
166
+ @container.execute(e[:input])
167
+ logger.info("@container.execute OK")
168
+ tob("#{i}/#{@formatter.pi.move_infos.size}") { @screen_image_renderer.next_build.write(sfg.next) }
169
+ logger.info("@screen_image_renderer.next_build.write OK")
170
+ logger.info { "move: #{i} / #{@formatter.pi.move_infos.size}" } if i.modulo(10).zero?
171
+ end
172
+ end_pages.times do |i|
173
+ @progress_cop.next_step("終了図 #{i}/#{end_pages}")
174
+ tob("終了図 #{i}/#{end_pages}") { @screen_image_renderer.last_rendered_image.write(sfg.next) }
175
+ end
176
+
177
+ logger.info { sfg.inspect }
178
+ logger.info { "ソース画像確認\n#{sfg.shell_inspect}" }
179
+ @progress_cop.next_step("mp4 生成 #{sfg.index}p")
180
+ strict_system %(ffmpeg -v warning -hide_banner -framerate #{fps_value} -i #{sfg.name} -c:v libx264 -pix_fmt yuv420p -movflags +faststart #{video_crf_o} #{video_tune_o} #{video_bit_rate_o} #{ffmpeg_after_embed_options} -y _output1.mp4)
181
+ logger.info { `ls -alh _output1.mp4`.strip }
182
+ @page_count = sfg.index
183
+ end
184
+
185
+ @screen_image_renderer.clear_all
186
+ end
187
+
188
+ if true
189
+ @progress_cop.next_step("メタデータ埋め込み")
190
+ title = params[:metadata_title].presence || "総手数#{@container.turn_info.display_turn}手"
191
+ comment = params[:metadata_comment].presence || @container.to_history_sfen
192
+ before_duration = Media.duration("_output1.mp4")
193
+ strict_system %(ffmpeg -v warning -hide_banner -i _output1.mp4 -metadata title="#{title}" -metadata comment="#{comment}" -codec copy -y _output2.mp4)
194
+ after_duration = Media.duration("_output2.mp4")
195
+ if before_duration != after_duration
196
+ # ffmpeg 3.4.8 では1ページ目が消える不具合あり
197
+ # metadata に関係なく ffmpeg -i _output1.mp4 -codec copy -y _output2.mp4 で1ページが飛ぶ
198
+ # 長さも1秒減る
199
+ raise FfmpegError, "-codec copy しただけで長さが変わっている: #{before_duration} --> #{after_duration}"
200
+ end
201
+ end
202
+
203
+ unless primary_audio_file
204
+ return Pathname("_output2.mp4").read
205
+ end
206
+
207
+ logger.tagged("audio") do
208
+ logger.info { "2. BGM準備" }
209
+
210
+ if @container.outbreak_turn
211
+ @switch_turn = @container.outbreak_turn + 1 # 取った手の位置が欲しいので「取る直前」+ 1
212
+ logger.info { "BGMが切り替わるページ(switch_turn): #{@switch_turn}" }
213
+ end
214
+
215
+ logger.info { "予測した全体の秒数(total_duration): #{total_duration}" }
216
+
217
+ if @switch_turn && audio_part_a && audio_part_b
218
+ logger.info { "開戦前後で分ける" }
219
+ part1_t = @switch_turn * page_duration + acrossfade_duration # audio1 側を伸ばす
220
+ part2_t = (@page_count - @switch_turn) * page_duration # audio2 側の長さは同じ
221
+
222
+ @progress_cop.next_step("序盤 BGM時間・音量調整")
223
+ # strict_system %(ffmpeg -v warning -stream_loop -1 -i #{audio_part_a} -t #{part1} -af volume=#{params[:audio_part_a_volume]} -y _part1.m4a)
224
+ strict_system %(ffmpeg -v warning -stream_loop -1 -i #{audio_part_a} -vn -t #{part1_t} -af volume=#{params[:audio_part_a_volume]} -y _part1.m4a)
225
+ logger.info { "_part1.m4a: #{Media.duration('_part1.m4a')}" }
226
+
227
+ @progress_cop.next_step("終盤 BGM時間・音量調整")
228
+ strict_system %(ffmpeg -v warning -stream_loop -1 -i #{audio_part_b} -vn -t #{part2_t} -af volume=#{params[:audio_part_b_volume]} -y _part2.m4a)
229
+ logger.info { "_part2.m4a: #{Media.duration('_part2.m4a')}" }
230
+
231
+ @progress_cop.next_step("クロスフェイド連結")
232
+ strict_system %(ffmpeg -v warning -i _part1.m4a -i _part2.m4a -filter_complex #{cross_fade_option} _concat.m4a)
233
+
234
+ @progress_cop.next_step("フェイドアウト処理")
235
+ strict_system %(ffmpeg -v warning -i _concat.m4a #{audio_filters(fadeout_value)} #{audio_bit_rate_o} _same_length1.m4a)
236
+ else
237
+ # 開戦しない場合は A, B パートの存在する方の曲を先頭から入れる
238
+ [
239
+ [audio_part_a, params[:audio_part_a_volume]],
240
+ [audio_part_b, params[:audio_part_b_volume]],
241
+ ].each do |audio_part_x, volume|
242
+ if audio_part_x
243
+ logger.info { "開戦前のみ" }
244
+ logger.info { "audio_part_x: #{audio_part_x}" }
245
+ @progress_cop.next_step("フェイドアウトと音量調整")
246
+ af = audio_filters("volume=#{volume}", fadeout_value)
247
+ strict_system %(ffmpeg -v warning -stream_loop -1 -i #{audio_part_x} -vn -t #{total_duration} #{af} #{audio_bit_rate_o} -y _same_length1.m4a)
248
+ logger.info { "#{audio_part_x.basename}: #{Media.duration(audio_part_x)}" }
249
+ break
250
+ end
251
+ end
252
+ end
253
+
254
+ logger.info { "fadeout_duration: #{fadeout_duration}" }
255
+
256
+ @progress_cop.next_step("全体の音量調整")
257
+ strict_system %(ffmpeg -v warning -i _same_length1.m4a -af volume=#{main_volume} -y _same_length2.m4a)
258
+ logger.info { "_same_length2.m4a: #{Media.duration('_same_length2.m4a')}" }
259
+ end
260
+
261
+ logger.info { "3. 結合" }
262
+ @progress_cop.next_step("BGM結合")
263
+ strict_system %(ffmpeg -v warning -i _output2.mp4 -i _same_length2.m4a -c copy -y _output3.mp4)
264
+ Pathname("_output3.mp4").read
265
+ end
266
+ end
267
+ end
268
+
269
+ private
270
+
271
+ ################################################################################ Video
272
+
273
+ def video_crf_o
274
+ if v = params[:video_crf].presence
275
+ ["-crf", v].shelljoin
276
+ end
277
+ end
278
+
279
+ def video_bit_rate_o
280
+ if v = params[:video_bit_rate].presence
281
+ ["-b:v", v].shelljoin
282
+ end
283
+ end
284
+
285
+ def video_tune_o
286
+ if v = params[:video_tune].presence
287
+ ["-tune", v].shelljoin
288
+ end
289
+ end
290
+
291
+ ################################################################################ Audio
292
+
293
+ def fadeout_duration
294
+ (params[:fadeout_duration].presence || (page_duration * end_pages)).to_f
295
+ end
296
+
297
+ def audio_part_a
298
+ if v = params[:audio_part_a]
299
+ Pathname(v).expand_path
300
+ end
301
+ end
302
+
303
+ def audio_part_b
304
+ if v = params[:audio_part_b]
305
+ Pathname(v).expand_path
306
+ end
307
+ end
308
+
309
+ def primary_audio_file
310
+ audio_part_a || audio_part_b
311
+ end
312
+
313
+ def acrossfade_duration
314
+ params[:acrossfade_duration].to_f
315
+ end
316
+
317
+ def main_volume
318
+ params[:main_volume].to_f
319
+ end
320
+
321
+ def total_duration
322
+ @page_count * page_duration
323
+ end
324
+
325
+ def fadeout_value
326
+ if fadeout_duration > 0
327
+ start_time = total_duration - fadeout_duration
328
+ "afade=t=out:start_time=#{start_time}:duration=#{fadeout_duration}"
329
+ end
330
+ end
331
+
332
+ def audio_filters(*args)
333
+ args = args.compact
334
+ if args.present?
335
+ "-af " + args.join(",")
336
+ end
337
+ end
338
+
339
+ # 長さ d=0 にしてもクロスフェイド効果があるっぽいので 0 なら単に結合する
340
+ def cross_fade_option
341
+ if acrossfade_duration > 0
342
+ %("acrossfade=duration=#{acrossfade_duration}")
343
+ else
344
+ %("concat=n=2:v=0:a=1")
345
+ end
346
+ end
347
+
348
+ def audio_bit_rate_o
349
+ if v = params[:audio_bit_rate].presence
350
+ ["-b:a", v].shelljoin
351
+ end
352
+ end
353
+
354
+ def audio_theme_info
355
+ AudioThemeInfo.fetch_if(params[:audio_theme_key])
356
+ end
357
+
358
+ # def to_h
359
+ # {
360
+ # "最後に追加したページ数(end_pages)" => end_pages,
361
+ # "合計ページ数(page_count)" => @page_count,
362
+ # "1ページ当たりの秒数(page_duration)" => page_duration,
363
+ # "予測した全体の秒数(total_duration)" => total_duration,
364
+ # "BGMが切り替わるページ(switch_turn)" => @switch_turn,
365
+ # }
366
+ # end
367
+ end
368
+ end
369
+ end
370
+ end
@@ -0,0 +1,14 @@
1
+ module Bioshogi
2
+ module Formatter
3
+ module Animation
4
+ class AnimationWebpBuilder < AnimationGifBuilder
5
+ def ext_name
6
+ "webp"
7
+ end
8
+
9
+ def ffmpeg_option_fine_tune_for_each_file_type
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end