bioshogi 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dumbjump +4 -0
- data/A/342/206/222B/342/206/222C/346/210/246/346/263/225.txt +2 -2
- data/Gemfile.lock +1 -1
- data/README.org +3 -3
- data/lib/bioshogi/ai/brain.rb +6 -6
- data/lib/bioshogi/analysis/analyzer.rb +66 -8
- data/lib/bioshogi/analysis/analyzer_mod.rb +2 -9
- data/lib/bioshogi/analysis/attack_info.rb +231 -227
- data/lib/bioshogi/analysis/{tech_accessor.rb → basic_accessor.rb} +4 -4
- data/lib/bioshogi/analysis/board_piller_methods.rb +9 -9
- data/lib/bioshogi/analysis/defense_info.rb +132 -132
- data/lib/bioshogi/analysis/file_normalizer.rb +1 -1
- data/lib/bioshogi/analysis/frequency.rb +368 -311
- data/lib/bioshogi/analysis/note_info.rb +6 -6
- data/lib/bioshogi/analysis/rocket_analyzer.rb +45 -58
- data/lib/bioshogi/analysis/shape_info.rb +73 -19
- data/lib/bioshogi/analysis/style_accessor.rb +22 -19
- data/lib/bioshogi/analysis/tactic_hit_turn_table.rb +8 -3
- data/lib/bioshogi/analysis/tactic_hit_turn_table_generator.rb +15 -14
- data/lib/bioshogi/analysis/tactic_info.rb +2 -2
- data/lib/bioshogi/analysis/technique_info.rb +3 -4
- data/lib/bioshogi/analysis/technique_verify_info.rb +627 -0
- data/lib/bioshogi/analysis//345/202/231/350/200/203//345/220/215/344/272/272/343/201/253/345/256/232/350/267/241/343/201/252/343/201/227.kif +4 -2
- data/lib/bioshogi/analysis//345/202/231/350/200/203//345/244/247/351/247/222/345/205/250/343/203/226/343/203/203/343/203/201.kif +4 -0
- data/lib/bioshogi/analysis//345/202/231/350/200/203//345/257/276/347/251/264/347/206/212.kif +3 -2
- data/lib/bioshogi/analysis//345/202/231/350/200/203//346/214/201/344/271/205/346/210/246.kif +2 -2
- data/lib/bioshogi/analysis//345/202/231/350/200/203//347/251/264/347/206/212.kif +3 -2
- data/lib/bioshogi/analysis//345/202/231/350/200/203//347/251/264/347/206/212/343/201/256/345/247/277/347/204/274/343/201/215.kif +3 -2
- data/lib/bioshogi/analysis//345/202/231/350/200/203//350/203/214/346/260/264/343/201/256/351/231/243.kif +7 -3
- data/lib/bioshogi/analysis//345/202/231/350/200/203//351/225/267/346/211/213/346/225/260.kif +1 -2
- data/lib/bioshogi/analysis//345/202/231/350/200/203//351/247/222/346/237/261.kif +4 -2
- data/lib/bioshogi/analysis//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 +1 -1
- data/lib/bioshogi/analysis//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 +4 -2
- data/lib/bioshogi/analysis//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 +1 -1
- data/lib/bioshogi/analysis//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 +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//343/202/253/343/202/277/345/233/262/343/201/204.kif +3 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//343/203/204/343/203/216/351/212/200/345/233/262/343/201/204.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//343/203/204/343/203/216/351/212/200/351/233/201/346/234/250.kif +1 -1
- data/lib/bioshogi/analysis//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 +1 -1
- data/lib/bioshogi/analysis//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 +6 -3
- data/lib/bioshogi/analysis//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 +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//344/270/255/344/275/217/343/201/276/343/201/204.kif +2 -0
- data/lib/bioshogi/analysis//345/233/262/343/201/204//344/270/262/343/202/253/343/203/204/345/233/262/343/201/204.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/217/263/347/237/242/345/200/211.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/233/233/346/236/232/347/251/264/347/206/212.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/233/233/346/236/232/347/276/216/346/277/203.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/233/233/346/236/232/351/212/200/345/206/240.kif +2 -2
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/233/233/346/256/265/347/253/257/347/216/211.kif +3 -3
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/233/233/350/247/222/347/237/242/345/200/211.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/234/237/345/261/205/347/237/242/345/200/211.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/235/212/344/270/273/347/276/216/346/277/203.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/244/247/345/261/261/347/276/216/346/277/203.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/244/247/351/232/205/345/233/262/343/201/204.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/244/251/351/207/216/347/237/242/345/200/211.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/257/214/345/243/253/350/246/213/347/237/242/345/200/211.kif +2 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/261/205/351/243/233/350/273/212/347/251/264/347/206/212.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/261/205/351/243/233/350/273/212/351/207/221/345/206/240.kif +4 -2
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/261/205/351/243/233/350/273/212/351/207/221/347/204/241/345/217/214.kif +1 -1
- data/lib/bioshogi/analysis//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 +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//345/261/205/351/243/233/350/273/212/351/212/200/345/206/240.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//346/202/252/345/275/242/347/237/242/345/200/211.kif +1 -1
- data/lib/bioshogi/analysis//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 +4 -1
- data/lib/bioshogi/analysis//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 +5 -2
- data/lib/bioshogi/analysis//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 +1 -1
- data/lib/bioshogi/analysis//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 +2 -2
- data/lib/bioshogi/analysis//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 +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//346/226/207/351/216/256/345/233/262/343/201/204.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//346/234/250/346/235/221/347/276/216/346/277/203.kif +1 -1
- data/lib/bioshogi/analysis//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 +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//346/265/201/343/202/214/347/237/242/345/200/211.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//347/204/241/350/262/254/344/273/273/347/237/242/345/200/211.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//347/211/207/343/203/204/343/203/216/351/212/200/345/233/262/343/201/204.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//347/211/207/347/251/264/347/206/212.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//347/237/242/345/200/211/347/251/264/347/206/212.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//347/256/261/345/205/245/343/202/212/345/250/230.kif +2 -2
- data/lib/bioshogi/analysis//345/233/262/343/201/204//347/267/217/347/237/242/345/200/211.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//347/276/216/346/277/203/347/206/212/345/233/262/343/201/204.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//350/217/212/346/260/264/347/237/242/345/200/211.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//350/217/261/347/237/242/345/200/211.kif +1 -1
- data/lib/bioshogi/analysis//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 +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//350/243/276/345/233/272/343/202/201.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//350/247/222/347/237/242/345/200/211.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//350/261/206/350/205/220/347/237/242/345/200/211.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//351/200/243/347/233/237/347/276/216/346/277/203.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//351/207/221/345/244/232/344/274/235.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//351/207/221/347/204/241/345/217/214.kif +3 -2
- data/lib/bioshogi/analysis//345/233/262/343/201/204//351/207/221/347/233/276/345/233/262/343/201/204.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//351/207/221/347/276/216/346/277/203.kif +2 -0
- data/lib/bioshogi/analysis//345/233/262/343/201/204//351/212/200/345/206/240/347/251/264/347/206/212.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//351/212/200/347/253/213/343/201/241/347/237/242/345/200/211.kif +2 -2
- data/lib/bioshogi/analysis//345/233/262/343/201/204//351/212/200/347/276/216/346/277/203.kif +2 -2
- data/lib/bioshogi/analysis//345/233/262/343/201/204//351/233/242/343/202/214/351/207/221/347/204/241/345/217/214.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//351/253/230/347/237/242/345/200/211.kif +1 -1
- data/lib/bioshogi/analysis//345/233/262/343/201/204//351/253/230/347/276/216/346/277/203/345/233/262/343/201/204.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225/2/346/211/213/347/233/256/342/226/2633/343/203/213/351/243/233/346/210/246/346/263/225.kif +2 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225/2/346/211/213/347/233/256/342/226/2633/344/272/214/351/212/200/343/202/267/343/202/271/343/203/206/343/203/240.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225/2/346/211/213/347/233/256/342/226/2636/344/272/214/351/212/200/346/210/246/346/263/225.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225/5/346/211/213/347/210/206/345/274/276.kif +5 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225/5/347/255/213/344/275/215/345/217/226/343/202/212.kif +2 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225/6/347/255/213/344/275/215/345/217/226/343/202/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225/U/343/202/277/343/203/274/343/203/263/351/243/233/350/273/212.kif +5 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//342/226/2625/344/270/203/351/207/221/346/210/246/346/263/225.kif +5 -3
- data/lib/bioshogi/analysis//346/210/246/346/263/225//342/226/2625/344/272/224/351/276/215/344/270/255/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//342/226/2633/344/270/211/346/241/202/346/210/246/346/263/225.kif +2 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//342/226/2633/344/270/211/350/247/222/345/236/213/347/251/272/344/270/255/346/210/246/346/263/225.kif +3 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//342/226/2633/344/270/211/351/207/221/345/236/213/346/227/251/347/271/260/343/202/212/351/212/200.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//342/226/2633/344/270/211/351/243/233/346/210/246/346/263/225.kif +3 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//342/226/2634/344/272/224/350/247/222/346/210/246/346/263/225.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//342/226/2637/344/272/214/351/243/233/344/272/234/346/200/245/346/210/246.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//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 +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/201/215/357/275/215/343/201/215/357/275/215/351/207/221.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/201/257/343/201/217/345/274/217/345/233/233/351/226/223/351/243/233/350/273/212.kif +4 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/201/270/343/201/252/343/201/241/343/202/207/343/201/223/346/200/245/346/210/246.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/202/204/343/201/260/343/203/234/343/203/274/343/202/272/346/265/201.kif +3 -0
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/202/250/343/203/253/343/203/242/346/200/245/346/210/246.kif +6 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/202/253/343/203/213/343/202/253/343/203/213/351/207/221.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/202/253/343/203/213/343/202/253/343/203/213/351/212/200.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/202/263/343/203/274/343/203/244/343/203/263/346/265/201/344/270/211/351/226/223/351/243/233/350/273/212.kif +6 -3
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/202/264/343/202/255/343/202/262/343/203/263/344/270/255/351/243/233/350/273/212.kif +3 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/202/264/343/203/252/343/202/264/343/203/252/351/207/221.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/202/264/343/203/252/343/203/251/343/201/256/345/217/263/346/211/213.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/202/264/343/203/252/351/201/225/343/201/204/350/247/222.kif +27 -0
- data/lib/bioshogi/analysis//346/210/246/346/263/225//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 +3 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//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 +3 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/203/204/343/203/216/351/212/200/344/270/255/351/243/233/350/273/212.kif +4 -3
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/203/204/343/203/216/351/212/200/345/236/213/345/217/263/347/216/211.kif +6 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/203/210/343/203/236/343/203/233/343/203/274/343/202/257.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/203/215/343/202/263/345/274/217/343/202/277/343/203/206/346/255/251/345/217/226/343/202/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/203/216/343/203/274/343/203/236/343/203/253/344/270/211/351/226/223/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/203/216/343/203/274/343/203/236/343/203/253/345/233/233/351/226/223/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/203/222/343/203/251/343/203/241/346/210/246/346/263/225.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/203/235/343/203/263/343/203/235/343/203/263/346/241/202.kif +2 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/203/241/343/202/244/343/203/211/343/202/267/343/202/271/343/203/206/343/203/240.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//343/203/242/343/203/216/343/203/254/343/203/274/343/203/253/345/220/221/343/201/213/343/201/204/351/243/233/350/273/212.kif +5 -3
- data/lib/bioshogi/analysis//346/210/246/346/263/225//344/270/200/346/211/213/346/220/215/350/247/222/346/217/233/343/202/217/343/202/212.kif +2 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//344/270/200/347/233/264/347/267/232/347/251/264/347/206/212.kif +6 -3
- data/lib/bioshogi/analysis//346/210/246/346/263/225//344/270/200/351/226/223/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//344/270/211/346/256/265/345/217/263/347/216/211.kif +3 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//344/270/211/351/226/223/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//344/270/213/347/224/272/346/265/201/344/270/211/351/226/223/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//344/270/255/345/216/237/346/265/201/346/200/245/346/210/246/347/237/242/345/200/211.kif +2 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//344/270/255/345/216/237/346/265/201/347/233/270/346/216/233/343/201/213/343/202/212.kif +2 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//344/270/255/345/216/237/351/243/233/350/273/212.kif +2 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//344/270/255/345/272/247/351/243/233/350/273/212.kif +2 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//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 +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//344/270/255/351/243/233/350/273/212/345/267/246/347/251/264/347/206/212.kif +3 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//344/270/270/345/261/261/343/203/257/343/202/257/343/203/201/343/203/263.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//344/271/235/351/226/223/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/210/235/346/211/213/342/226/2627/345/205/253/351/212/200/346/210/246/346/263/225.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/212/240/350/227/244/346/265/201/350/242/226/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/213/207/346/260/227/346/265/201.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/215/207/347/224/260/345/274/217/347/237/263/347/224/260/346/265/201.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//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 +4 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/217/263/345/233/233/351/226/223/351/243/233/350/273/212/346/200/245/346/210/246.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/217/263/347/216/211.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/220/214/345/236/213/347/237/242/345/200/211.kif +2 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/233/233/346/211/213/350/247/222.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/234/260/344/270/213/351/211/204/351/243/233/350/273/212.kif +3 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/241/232/347/224/260/343/202/271/343/203/232/343/202/267/343/203/243/343/203/253.kif +2 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/244/251/345/275/246/346/265/201/342/226/2626/345/205/255/350/247/222.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/244/251/345/275/246/346/265/201/345/220/221/343/201/213/343/201/204/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/254/211/351/207/216/346/265/201.kif +4 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/256/244/345/262/241/343/202/267/343/202/271/343/203/206/343/203/240.kif +1 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/257/276/347/237/242/345/200/211/346/200/245/346/210/246/346/243/222/351/212/200.kif +6 -3
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/261/213/346/225/267/346/265/201/344/272/214/346/236/232/351/212/200.kif +2 -3
- data/lib/bioshogi/analysis//346/210/246/346/263/225//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 +2 -0
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/261/261/347/224/260/345/256/232/350/267/241.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/267/246/347/276/216/346/277/203/346/200/245/346/210/246.kif +3 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//345/271/273/346/203/263/345/233/233/351/226/223/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/210/270/{351/203/250 → 350/276/272}/346/265/2014/342/206/2223/346/210/246/346/263/225.kif +3 -3
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/226/260/345/254/211/351/207/216/346/265/201.kif +2 -0
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/226/260/346/235/221/347/224/260/343/202/267/343/202/271/343/203/206/343/203/240.kif +3 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/226/260/347/261/263/351/225/267/347/216/211.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/226/260/351/254/274/346/256/272/343/201/227.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/234/250/346/235/221/345/256/232/350/267/241.kif +5 -3
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/235/221/347/224/260/343/202/267/343/202/271/343/203/206/343/203/240.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/241/220/345/261/261/346/265/201/343/202/277/343/203/206/346/255/251/346/243/222/351/212/200.kif +2 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/243/222/347/216/211.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/243/222/351/207/221.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/243/256/344/270/213/343/202/267/343/202/271/343/203/206/343/203/240.kif +2 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/245/240/346/234/254/345/274/217/347/237/263/347/224/260/346/265/201.kif +2 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/250/252/346/255/251/345/217/226/343/202/212.kif +2 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//346/270/205/351/207/216/346/265/201/345/262/220/351/230/234/346/210/246/346/263/225.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/216/211/351/240/255/344/275/215/345/217/226/343/202/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/216/211/351/240/255/351/212/200.kif +3 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/233/270/346/250/252/346/255/251/345/217/226/343/202/212.kif +2 -6
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/233/270/347/255/213/351/201/225/343/201/204/350/247/222.kif +2 -0
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/234/237/351/203/250/346/265/201.kif +5 -3
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/237/242/345/200/211/342/226/2623/344/270/203/351/212/200/346/210/246/346/263/225.kif +3 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/237/242/345/200/211/344/270/255/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/250/262/345/272/255/346/210/246/346/263/225.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/251/264/350/247/222/345/220/221/343/201/213/343/201/204/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/251/264/350/247/222/346/210/246/346/263/225.kif +4 -3
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/253/213/347/237/263/346/265/201/345/233/233/351/226/223/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/253/271/351/203/250/343/202/271/343/203/232/343/202/267/343/203/243/343/203/253.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/255/213/351/201/225/343/201/204/350/247/222.kif +3 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/261/263/351/225/267/346/265/201/346/200/245/346/210/246/347/237/242/345/200/211.kif +8 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/263/270/350/260/267/346/265/201/345/217/263/347/216/211.kif +2 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//347/276/275/347/224/237/345/274/217/350/242/226/351/243/233/350/273/212.kif +3 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/200/200/351/276/215/343/201/262/343/201/255/343/202/212/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/200/200/351/276/215/345/233/233/351/226/223/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/204/207/343/202/267/343/202/271/343/203/206/343/203/240.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/205/260/346/216/233/343/201/221/351/212/200.kif +1 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//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 +5 -4
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/213/261/346/230/245/346/265/201/343/201/213/343/201/276/343/201/204/343/201/237/343/201/241/346/210/246/346/263/225.kif +5 -3
- data/lib/bioshogi/analysis//346/210/246/346/263/225//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 +4 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/217/205/344/272/225/346/265/201/344/270/211/351/226/223/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/217/234/343/200/205/346/262/263/346/265/201/342/226/2634/345/233/233/350/247/222.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//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 +2 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/242/226/351/243/233/350/273/212.kif +7 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/243/217/343/202/242/343/203/222/343/203/253/346/210/246/346/263/225.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/247/222/346/217/233/343/202/217/343/202/212/345/217/263/347/216/211.kif +5 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//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 +4 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/247/222/346/217/233/343/202/217/343/202/212/346/243/222/351/212/200.kif +2 -0
- data/lib/bioshogi/analysis//346/210/246/346/263/225//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 +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/247/222/346/217/233/343/202/217/343/202/212/350/205/260/346/216/233/343/201/221/351/212/200/346/227/247/345/236/213.kif +2 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/247/222/351/240/255/346/255/251/346/210/246/346/263/225.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//350/266/205/346/200/245/346/210/246.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/200/206/346/243/222/351/212/200.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/201/240/345/261/261/346/265/201.kif +3 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/203/275/346/210/220/346/265/201/342/226/2633/344/270/200/351/207/221.kif +24 -11
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/207/221/346/262/242/346/265/201.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/207/221/347/204/241/345/217/214/346/200/245/346/210/246.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/207/221/351/212/200/346/251/213.kif +2 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/212/200/351/233/262/351/233/200.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/214/206/345/210/200/346/210/246/346/263/225.kif +54 -0
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/230/252/347/224/260/346/265/2012/346/211/213/347/233/256/342/226/2639/345/233/233/346/255/251.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/230/252/347/224/260/346/265/201/345/220/221/343/201/213/343/201/204/351/243/233/350/273/212.kif +3 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//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 +5 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/233/200/345/210/272/343/201/227.kif +2 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/233/201/346/234/250/345/217/263/347/216/211.kif +3 -2
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/242/250/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/253/230/347/224/260/346/265/201/345/267/246/347/216/211.kif +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/254/274/345/205/255/346/265/201/343/201/251/343/201/243/343/201/213/343/202/223/351/243/233/350/273/212.kif +54 -0
- data/lib/bioshogi/analysis//346/210/246/346/263/225//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 +1 -1
- data/lib/bioshogi/analysis//346/210/246/346/263/225//351/255/224/347/225/214/345/233/233/351/226/223/351/243/233/350/273/212.kif +1 -1
- data/lib/bioshogi/analysis//346/211/213/347/255/213/2/346/256/265/343/203/255/343/202/261/343/203/203/343/203/210.kif +1 -1
- data/lib/bioshogi/analysis//346/211/213/347/255/213//343/201/237/343/201/237/343/201/215/343/201/256/346/255/251.kif +27 -9
- data/lib/bioshogi/analysis//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 +11 -11
- data/lib/bioshogi/analysis//346/211/213/347/255/213//347/253/257/347/216/211/343/201/253/343/201/257/347/253/257/346/255/251.kif +12 -14
- data/lib/bioshogi/analysis//346/211/213/347/255/213//351/200/243/346/211/223/343/201/256/346/255/251.kif +2 -1
- data/lib/bioshogi/analysis//346/211/213/347/255/213//351/201/240/350/246/213/343/201/256/350/247/222.kif +16 -6
- data/lib/bioshogi/analysis.rb +4 -0
- data/lib/bioshogi/board/csa_formatter.rb +2 -2
- data/lib/bioshogi/board/kakinoki_formatter.rb +5 -5
- data/lib/bioshogi/board/reader_methods.rb +8 -4
- data/lib/bioshogi/board_parser/kakinoki_board_parser.rb +2 -2
- data/lib/bioshogi/container/checkmate_yomiage.rb +1 -1
- data/lib/bioshogi/dimension/base.rb +49 -10
- data/lib/bioshogi/dimension/column.rb +131 -0
- data/lib/bioshogi/dimension/module_methods.rb +19 -20
- data/lib/bioshogi/dimension/row.rb +128 -0
- data/lib/bioshogi/formatter/sugatayaki_validator.rb +1 -1
- data/lib/bioshogi/hand/drop.rb +1 -1
- data/lib/bioshogi/hand/move.rb +6 -6
- data/lib/bioshogi/input_adapter/ki2_adapter.rb +10 -10
- data/lib/bioshogi/input_adapter/shared_validation.rb +1 -1
- data/lib/bioshogi/location.rb +22 -2
- data/lib/bioshogi/official_formatter.rb +37 -37
- data/lib/bioshogi/order_info.rb +5 -3
- data/lib/bioshogi/piece/piece_vector.rb +16 -10
- data/lib/bioshogi/piece.rb +2 -2
- data/lib/bioshogi/place.rb +155 -62
- data/lib/bioshogi/player/soldier_methods.rb +2 -2
- data/lib/bioshogi/screen_image/core_methods.rb +2 -2
- data/lib/bioshogi/screen_image/pentagon.rb +2 -2
- data/lib/bioshogi/screen_image/soldier_methods.rb +1 -1
- data/lib/bioshogi/screen_image/stand.rb +5 -5
- data/lib/bioshogi/soldier/technique_matcher_methods.rb +51 -0
- data/lib/bioshogi/soldier.rb +14 -79
- data/lib/bioshogi/soldier_walker.rb +1 -1
- data/lib/bioshogi/turn_info.rb +2 -2
- data/lib/bioshogi/v/preset_vectors.rb +129 -0
- data/lib/bioshogi/v.rb +4 -2
- data/lib/bioshogi/version.rb +1 -1
- data/lib/bioshogi.rb +2 -0
- data//347/275/256/343/201/215/346/217/233/343/201/210/346/216/250/345/245/250.txt +1 -1
- metadata +14 -7
- data/lib/bioshogi/analysis/technique_matcher_info.rb +0 -810
- data/lib/bioshogi/dimension/place_x.rb +0 -27
- data/lib/bioshogi/dimension/place_y.rb +0 -57
@@ -40,7 +40,7 @@ module Bioshogi
|
|
40
40
|
s << @options[:separator]
|
41
41
|
end
|
42
42
|
|
43
|
-
if type ==
|
43
|
+
if type == :t_drop
|
44
44
|
s << piece_name
|
45
45
|
# 日本将棋連盟 棋譜の表記方法
|
46
46
|
# https://www.shogi.or.jp/faq/kihuhyouki.html
|
@@ -53,15 +53,15 @@ module Bioshogi
|
|
53
53
|
if @options[:force_drop] || !candidate_soldiers.empty?
|
54
54
|
s << kw("打")
|
55
55
|
end
|
56
|
-
elsif type ==
|
56
|
+
elsif type == :t_promote_on
|
57
57
|
s << piece_name
|
58
58
|
s << motion
|
59
59
|
s << kw("成")
|
60
|
-
elsif type ==
|
60
|
+
elsif type == :t_promote_throw
|
61
61
|
s << piece_name
|
62
62
|
s << motion
|
63
63
|
s << kw("不成") # or "生"
|
64
|
-
elsif type ==
|
64
|
+
elsif type == :t_move
|
65
65
|
s << soldier_name
|
66
66
|
s << motion
|
67
67
|
else
|
@@ -80,26 +80,26 @@ module Bioshogi
|
|
80
80
|
|
81
81
|
def to_debug_hash
|
82
82
|
{
|
83
|
-
:place_from
|
84
|
-
:place_to
|
85
|
-
:candidate_soldiers
|
86
|
-
:koreru_c
|
87
|
-
:_migi_idou
|
88
|
-
:_hidari_idou
|
89
|
-
:_ue_idou
|
90
|
-
:_shita_idou
|
91
|
-
:_hidari_kara_c
|
92
|
-
:_migi_kara_c
|
93
|
-
:yoreru_c
|
94
|
-
:agareru_c
|
95
|
-
:sagareru_c
|
96
|
-
:shita_y
|
97
|
-
:_tx
|
98
|
-
:_ty
|
99
|
-
:_ox
|
100
|
-
:_oy
|
101
|
-
:_xr
|
102
|
-
:_yr
|
83
|
+
:place_from => place_from,
|
84
|
+
:place_to => place_to,
|
85
|
+
:candidate_soldiers => candidate_soldiers.collect(&:name),
|
86
|
+
:koreru_c => koreru_c,
|
87
|
+
:_migi_idou => _migi_idou?,
|
88
|
+
:_hidari_idou => _hidari_idou?,
|
89
|
+
:_ue_idou => _ue_idou?,
|
90
|
+
:_shita_idou => _shita_idou?,
|
91
|
+
:_hidari_kara_c => _hidari_kara_c,
|
92
|
+
:_migi_kara_c => _migi_kara_c,
|
93
|
+
:yoreru_c => yoreru_c,
|
94
|
+
:agareru_c => agareru_c,
|
95
|
+
:sagareru_c => sagareru_c,
|
96
|
+
:shita_y => shita_y,
|
97
|
+
:_tx => _tx,
|
98
|
+
:_ty => _ty,
|
99
|
+
:_ox => _ox,
|
100
|
+
:_oy => _oy,
|
101
|
+
:_xr => _xr,
|
102
|
+
:_yr => _yr,
|
103
103
|
}
|
104
104
|
end
|
105
105
|
|
@@ -281,37 +281,37 @@ module Bioshogi
|
|
281
281
|
|
282
282
|
# 左からこれる駒の数
|
283
283
|
def _hidari_kara_c
|
284
|
-
candidate_soldiers.count { |s| s.place.
|
284
|
+
candidate_soldiers.count { |s| s.place.column.value < _tx }
|
285
285
|
end
|
286
286
|
|
287
287
|
# 右からこれる駒の数
|
288
288
|
def _migi_kara_c
|
289
|
-
candidate_soldiers.count { |s| s.place.
|
289
|
+
candidate_soldiers.count { |s| s.place.column.value > _tx }
|
290
290
|
end
|
291
291
|
|
292
292
|
# 水平に寄れる駒の数
|
293
293
|
def yoreru_c
|
294
|
-
candidate_soldiers.count { |s| s.place.
|
294
|
+
candidate_soldiers.count { |s| s.place.row.value == _ty }
|
295
295
|
end
|
296
296
|
|
297
297
|
# 上がれる駒の数(移動先より下にある数)
|
298
298
|
def agareru_c
|
299
|
-
candidate_soldiers.count { |s| s.place.
|
299
|
+
candidate_soldiers.count { |s| s.place.row.value.send(_i(:>), _ty) }
|
300
300
|
end
|
301
301
|
|
302
302
|
# 下がれる駒の数(移動先より上にある数)
|
303
303
|
def sagareru_c
|
304
|
-
candidate_soldiers.count { |s| s.place.
|
304
|
+
candidate_soldiers.count { |s| s.place.row.value.send(_i(:<), _ty) }
|
305
305
|
end
|
306
306
|
|
307
307
|
# 移動先X
|
308
308
|
def _tx
|
309
|
-
@_tx ||= place_to.
|
309
|
+
@_tx ||= place_to.column.value
|
310
310
|
end
|
311
311
|
|
312
312
|
# 移動元Y
|
313
313
|
def _ty
|
314
|
-
@_ty ||= place_to.
|
314
|
+
@_ty ||= place_to.row.value
|
315
315
|
end
|
316
316
|
|
317
317
|
# プレイヤー視点から見た移動先の一つ下
|
@@ -326,31 +326,31 @@ module Bioshogi
|
|
326
326
|
|
327
327
|
# 移動元X
|
328
328
|
def _ox
|
329
|
-
@_ox ||= place_from.
|
329
|
+
@_ox ||= place_from.column.value
|
330
330
|
end
|
331
331
|
|
332
332
|
# 移動先Y
|
333
333
|
def _oy
|
334
|
-
@_oy ||= place_from.
|
334
|
+
@_oy ||= place_from.row.value
|
335
335
|
end
|
336
336
|
|
337
337
|
# 候補手の座標範囲
|
338
338
|
def _xr
|
339
|
-
@_xr ||= Range.new(*candidate_soldiers.collect { |e| e.place.
|
339
|
+
@_xr ||= Range.new(*candidate_soldiers.collect { |e| e.place.column.value }.minmax)
|
340
340
|
end
|
341
341
|
|
342
342
|
def _yr
|
343
|
-
@_yr ||= Range.new(*candidate_soldiers.collect { |e| e.place.
|
343
|
+
@_yr ||= Range.new(*candidate_soldiers.collect { |e| e.place.row.value }.minmax)
|
344
344
|
end
|
345
345
|
|
346
346
|
# 移動元で二つの龍が水平線上にいる?
|
347
347
|
def idou_moto_no_ryu_ga_suihei_ni_iru?
|
348
|
-
candidate_soldiers.collect { |e| e.place.
|
348
|
+
candidate_soldiers.collect { |e| e.place.row.value }.uniq.size == 1
|
349
349
|
end
|
350
350
|
|
351
351
|
# 移動先の水平線上よりすべて上 or すべて下
|
352
352
|
# つまり、移動先のYが候補のYの範囲に含まれている
|
353
|
-
# だから candidate_soldiers.all?{|s|s.place.
|
353
|
+
# だから candidate_soldiers.all?{|s|s.place.row.value < _ty} || candidate_soldiers.all?{|s|s.place.row.value > _ty} から !_yr.cover?(_ty) に変更できる
|
354
354
|
def idousakino_suiheisenjou_yori_subete_ue_mataha_shita?
|
355
355
|
!_yr.cover?(_ty)
|
356
356
|
end
|
data/lib/bioshogi/order_info.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
# frozen-string-literal: true
|
2
2
|
|
3
|
-
#
|
3
|
+
# ▲△と混同しがちだが▲△は場所のことであって順番とは関係がない。
|
4
|
+
# たとえば駒落ちの場合は△から指すため「△=後手」と解釈しているとおかしくなる。
|
5
|
+
|
4
6
|
module Bioshogi
|
5
7
|
class OrderInfo
|
6
8
|
include ApplicationMemoryRecord
|
7
9
|
memory_record [
|
8
|
-
{ key: :
|
9
|
-
{ key: :
|
10
|
+
{ key: :order_first, name: "先手"}, # 奇数回に指す側
|
11
|
+
{ key: :order_second, name: "後手"}, # 偶数回に指す側
|
10
12
|
]
|
11
13
|
end
|
12
14
|
end
|
@@ -10,21 +10,27 @@ module Bioshogi
|
|
10
10
|
class PieceVector
|
11
11
|
include ApplicationMemoryRecord
|
12
12
|
memory_record [
|
13
|
-
{ key: :king, basic_once_vectors: :pattern_king,
|
14
|
-
{ key: :rook, basic_once_vectors: nil,
|
15
|
-
{ key: :bishop, basic_once_vectors: nil,
|
16
|
-
{ key: :gold, basic_once_vectors: :pattern_gold,
|
17
|
-
{ key: :silver, basic_once_vectors: :pattern_silver,
|
18
|
-
{ key: :knight, basic_once_vectors: :pattern_knight,
|
19
|
-
{ key: :lance, basic_once_vectors: nil,
|
20
|
-
{ key: :pawn, basic_once_vectors: :pattern_pawn,
|
13
|
+
{ key: :king, basic_once_vectors: :pattern_king, basic_repeat_vectors: nil, promoted_once_vectors: nil, promoted_repeat_vectors: nil, },
|
14
|
+
{ key: :rook, basic_once_vectors: nil, basic_repeat_vectors: :pattern_plus, promoted_once_vectors: :pattern_x, promoted_repeat_vectors: :pattern_plus, },
|
15
|
+
{ key: :bishop, basic_once_vectors: nil, basic_repeat_vectors: :pattern_x, promoted_once_vectors: :pattern_plus, promoted_repeat_vectors: :pattern_x, },
|
16
|
+
{ key: :gold, basic_once_vectors: :pattern_gold, basic_repeat_vectors: nil, promoted_once_vectors: nil, promoted_repeat_vectors: nil, },
|
17
|
+
{ key: :silver, basic_once_vectors: :pattern_silver, basic_repeat_vectors: nil, promoted_once_vectors: :pattern_gold, promoted_repeat_vectors: nil, },
|
18
|
+
{ key: :knight, basic_once_vectors: :pattern_knight, basic_repeat_vectors: nil, promoted_once_vectors: :pattern_gold, promoted_repeat_vectors: nil, },
|
19
|
+
{ key: :lance, basic_once_vectors: nil, basic_repeat_vectors: :pattern_pawn, promoted_once_vectors: :pattern_gold, promoted_repeat_vectors: nil, },
|
20
|
+
{ key: :pawn, basic_once_vectors: :pattern_pawn, basic_repeat_vectors: nil, promoted_once_vectors: :pattern_gold, promoted_repeat_vectors: nil, },
|
21
|
+
]
|
22
|
+
|
23
|
+
DELEGATE_METHODS = [
|
24
|
+
:brave?,
|
25
|
+
:all_vectors,
|
21
26
|
]
|
22
27
|
|
23
28
|
def brave?
|
24
29
|
attributes[:promoted_repeat_vectors]
|
25
30
|
end
|
26
31
|
|
27
|
-
|
32
|
+
# すべてはこれで足りるので他のメソッドを public にするべからず
|
33
|
+
def all_vectors(location:, promoted: false)
|
28
34
|
@all_vectors ||= {}
|
29
35
|
@all_vectors[[promoted, location.key]] ||= yield_self do
|
30
36
|
vectors = select_vectors(promoted)
|
@@ -49,7 +55,7 @@ module Bioshogi
|
|
49
55
|
end
|
50
56
|
|
51
57
|
def normalized_vectors(location, vectors)
|
52
|
-
vectors.collect { |e| e * location.
|
58
|
+
vectors.collect { |e| e * location.sign_dir }
|
53
59
|
end
|
54
60
|
|
55
61
|
def basic_vectors
|
data/lib/bioshogi/piece.rb
CHANGED
@@ -103,7 +103,7 @@ module Bioshogi
|
|
103
103
|
{ key: :gold, name: "金", basic_alias: nil, promoted_name: nil, promoted_formal_sheet_name: nil, other_matched_promoted_names: nil, sfen_char: "G", promotable: false, always_alive: true, stronger: false, dengaku_target: false, tatakare_target: true, maesusumeru: true, },
|
104
104
|
{ key: :silver, name: "銀", basic_alias: nil, promoted_name: "全", promoted_formal_sheet_name: "成銀", other_matched_promoted_names: nil, sfen_char: "S", promotable: true, always_alive: true, stronger: false, dengaku_target: false, tatakare_target: true, maesusumeru: true, },
|
105
105
|
{ key: :knight, name: "桂", basic_alias: nil, promoted_name: "圭", promoted_formal_sheet_name: "成桂", other_matched_promoted_names: "今", sfen_char: "N", promotable: true, always_alive: false, stronger: false, dengaku_target: false, tatakare_target: false, maesusumeru: false, },
|
106
|
-
{ key: :lance, name: "香", basic_alias: nil, promoted_name: "杏", promoted_formal_sheet_name: "成香", other_matched_promoted_names: "仝", sfen_char: "L", promotable: true, always_alive: false, stronger: false, dengaku_target: false, tatakare_target:
|
106
|
+
{ key: :lance, name: "香", basic_alias: nil, promoted_name: "杏", promoted_formal_sheet_name: "成香", other_matched_promoted_names: "仝", sfen_char: "L", promotable: true, always_alive: false, stronger: false, dengaku_target: false, tatakare_target: false, maesusumeru: true, },
|
107
107
|
{ key: :pawn, name: "歩", basic_alias: nil, promoted_name: "と", promoted_formal_sheet_name: nil, other_matched_promoted_names: nil, sfen_char: "P", promotable: true, always_alive: false, stronger: false, dengaku_target: false, tatakare_target: false, maesusumeru: true, },
|
108
108
|
]
|
109
109
|
|
@@ -218,7 +218,7 @@ module Bioshogi
|
|
218
218
|
def piece_vector
|
219
219
|
@piece_vector ||= PieceVector.fetch(key)
|
220
220
|
end
|
221
|
-
delegate
|
221
|
+
delegate *PieceVector::DELEGATE_METHODS, to: :piece_vector
|
222
222
|
|
223
223
|
def piece_scale
|
224
224
|
@piece_scale ||= PieceScale.fetch(key)
|
data/lib/bioshogi/place.rb
CHANGED
@@ -9,19 +9,19 @@
|
|
9
9
|
|
10
10
|
module Bioshogi
|
11
11
|
class Place
|
12
|
-
attr_accessor :x, :y
|
13
|
-
|
14
12
|
class << self
|
15
13
|
private :new
|
16
14
|
|
17
|
-
|
15
|
+
begin
|
16
|
+
include Enumerable
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
def each(&block)
|
19
|
+
Dimension::Row.dimension_size.times.flat_map { |row|
|
20
|
+
Dimension::Column.dimension_size.times.collect { |column|
|
21
|
+
self[[column, row]]
|
22
|
+
}
|
23
|
+
}.each(&block)
|
24
|
+
end
|
25
25
|
end
|
26
26
|
|
27
27
|
def fetch(value)
|
@@ -33,28 +33,30 @@ module Bioshogi
|
|
33
33
|
return value
|
34
34
|
end
|
35
35
|
|
36
|
-
|
37
|
-
|
36
|
+
column = nil
|
37
|
+
row = nil
|
38
38
|
|
39
39
|
case value
|
40
40
|
when Array
|
41
41
|
a, b = value
|
42
|
-
|
43
|
-
|
42
|
+
column = Dimension::Column.lookup(a)
|
43
|
+
row = Dimension::Row.lookup(b)
|
44
44
|
when String
|
45
45
|
a, b = value.chars
|
46
|
-
|
47
|
-
|
46
|
+
column = Dimension::Column.lookup(a)
|
47
|
+
row = Dimension::Row.lookup(b)
|
48
48
|
else
|
49
49
|
if respond_to?(:to_a)
|
50
50
|
return lookup(value.to_a)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
@
|
54
|
+
# 座標は最大で99なのでインスタンスを使いまわす
|
55
|
+
# ただしグローバルな寸法が変わると不整合な状態になるため cache_clear を適切に呼ばないといけない
|
56
|
+
if column && row
|
57
|
+
@cache ||= {}
|
58
|
+
@cache[column] ||= {}
|
59
|
+
@cache[column][row] ||= new(column, row)
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
@@ -62,91 +64,121 @@ module Bioshogi
|
|
62
64
|
lookup(value)
|
63
65
|
end
|
64
66
|
|
67
|
+
def cache_clear
|
68
|
+
if @cache
|
69
|
+
@cache.each_value do |hv|
|
70
|
+
hv.each_value(&:cache_clear)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
65
75
|
def regexp
|
66
76
|
/[一二三四五六七八九1-91-9]{2}/
|
67
77
|
end
|
68
78
|
end
|
69
79
|
|
70
|
-
|
71
|
-
@x = x
|
72
|
-
@y = y
|
73
|
-
end
|
80
|
+
attr_accessor :column, :row
|
74
81
|
|
75
|
-
|
76
|
-
|
82
|
+
# for Soldier
|
83
|
+
DELEGATE_METHODS = [
|
84
|
+
*Dimension::Column::DELEGATE_METHODS,
|
85
|
+
*Dimension::Row::DELEGATE_METHODS,
|
86
|
+
|
87
|
+
:relative_move_to,
|
88
|
+
:move_to_xy,
|
89
|
+
:king_default_place?,
|
90
|
+
|
91
|
+
:move_to_bottom_edge,
|
92
|
+
:move_to_top_edge,
|
93
|
+
:move_to_left_edge,
|
94
|
+
:move_to_right_edge,
|
95
|
+
]
|
96
|
+
|
97
|
+
def initialize(column, row)
|
98
|
+
@column = column
|
99
|
+
@row = row
|
100
|
+
@cache = {}
|
101
|
+
freeze
|
77
102
|
end
|
78
103
|
|
79
|
-
|
80
|
-
|
81
|
-
|
104
|
+
def cache_clear
|
105
|
+
to_a.each(&:cache_clear)
|
106
|
+
@cache.clear
|
82
107
|
end
|
83
108
|
|
84
|
-
|
85
|
-
|
86
|
-
self.class.fetch([@x.flip, @y])
|
109
|
+
def inspect
|
110
|
+
"#<#{self.class.name} #{name}>"
|
87
111
|
end
|
88
112
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
self
|
94
|
-
end
|
113
|
+
################################################################################
|
114
|
+
|
115
|
+
def to_s
|
116
|
+
name
|
95
117
|
end
|
96
118
|
|
97
119
|
def name
|
98
|
-
to_a.collect
|
120
|
+
@cache[:name] ||= to_a.collect(&:name).join
|
99
121
|
end
|
100
122
|
|
101
123
|
def zenkaku_number
|
102
|
-
to_a.collect(&:zenkaku_number).join
|
124
|
+
@cache[:zenkaku_number] ||= to_a.collect(&:zenkaku_number).join
|
103
125
|
end
|
104
126
|
|
105
127
|
def hankaku_number
|
106
|
-
to_a.collect(&:hankaku_number).join
|
128
|
+
@cache[:hankaku_number] ||= to_a.collect(&:hankaku_number).join
|
107
129
|
end
|
108
130
|
|
109
131
|
def yomiage
|
110
|
-
to_a.collect(&:yomiage).join
|
111
|
-
end
|
112
|
-
|
113
|
-
def to_s
|
114
|
-
name
|
132
|
+
@cache[:yomiage] ||= to_a.collect(&:yomiage).join
|
115
133
|
end
|
116
134
|
|
117
135
|
def to_sfen
|
118
|
-
to_a.collect(&:to_sfen).join
|
136
|
+
@cache[:to_sfen] ||= to_a.collect(&:to_sfen).join
|
119
137
|
end
|
120
138
|
|
121
139
|
def to_xy
|
122
|
-
[
|
140
|
+
@cache[:to_xy] ||= to_a.collect(&:value)
|
123
141
|
end
|
124
142
|
|
125
143
|
# "6八銀" なら [6, 8]
|
144
|
+
# キャッシュすると3倍速くなる
|
126
145
|
def to_human_int
|
127
|
-
to_a.collect(&:to_human_int)
|
146
|
+
@cache[:to_human_int] ||= to_a.collect(&:to_human_int)
|
128
147
|
end
|
129
148
|
|
130
|
-
# "6八銀" なら {
|
149
|
+
# "6八銀" なら {column:6, row:8}
|
150
|
+
# キャッシュすると2倍速くなる
|
131
151
|
def to_human_h
|
132
|
-
|
152
|
+
@cache[:to_human_h] ||= Hash[[:column, :row].zip(to_human_int)]
|
133
153
|
end
|
134
154
|
|
155
|
+
# ほぼキャッシュ効果なし。それどころか少し遅くなる。ただ配列を再生成しないのでこれでいいことにする。
|
135
156
|
def to_a
|
136
|
-
[@
|
157
|
+
@cache[:to_a] ||= [@column, @row]
|
137
158
|
end
|
138
159
|
|
139
|
-
|
140
|
-
|
160
|
+
################################################################################
|
161
|
+
|
162
|
+
# 180度回転
|
163
|
+
def flip
|
164
|
+
@cache[:flip] ||= self.class.fetch(to_a.collect(&:flip))
|
141
165
|
end
|
142
166
|
|
143
|
-
#
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
#
|
149
|
-
|
167
|
+
# column座標のみ反転
|
168
|
+
def flop
|
169
|
+
@cache[:flop] ||= self.class.fetch([@column.flip, @row])
|
170
|
+
end
|
171
|
+
|
172
|
+
# Soldier では独自に定義しているためここに Soldier からここに委譲してはいけない
|
173
|
+
def white_then_flip(location)
|
174
|
+
if Location[location].key == :white
|
175
|
+
flip
|
176
|
+
else
|
177
|
+
self
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
################################################################################
|
150
182
|
|
151
183
|
def ==(other)
|
152
184
|
eql?(other)
|
@@ -164,8 +196,69 @@ module Bioshogi
|
|
164
196
|
self.class == other.class && to_xy == other.to_xy
|
165
197
|
end
|
166
198
|
|
167
|
-
|
168
|
-
|
199
|
+
################################################################################ 移動
|
200
|
+
|
201
|
+
# より抽象的な方法で移動した位置を返す
|
202
|
+
def relative_move_to(location, vector, magnification: 1)
|
203
|
+
if vector.kind_of?(Symbol)
|
204
|
+
vector = V.public_send(vector)
|
205
|
+
end
|
206
|
+
xy_add(*(vector * location.sign_dir * magnification))
|
207
|
+
end
|
208
|
+
|
209
|
+
# 自玉の位置にいる?
|
210
|
+
def king_default_place?(location)
|
211
|
+
column_is_center?(location) && bottom_spaces(location) == 0
|
212
|
+
end
|
213
|
+
|
214
|
+
def xy_add(x, y)
|
215
|
+
self.class.lookup([@column.value + x, @row.value + y])
|
216
|
+
end
|
217
|
+
private :xy_add
|
218
|
+
|
219
|
+
def vector_add(vector)
|
220
|
+
xy_add(vector.x, vector.y)
|
221
|
+
end
|
222
|
+
|
223
|
+
# 上下左右 -1 +1 -1 +1 に進んだ位置を返す (white側の場合も考慮する)
|
224
|
+
# 2つ進んだ位置などを一発で調べたいときに使う
|
225
|
+
# なるべく使うな
|
226
|
+
def move_to_xy(location, x, y)
|
227
|
+
xy_add(x * location.sign_dir, y * location.sign_dir)
|
169
228
|
end
|
229
|
+
|
230
|
+
################################################################################ location から見た上下左右に寄せた位置を返す
|
231
|
+
|
232
|
+
def move_to_bottom_edge(location)
|
233
|
+
self.class.fetch([column, location.bottom])
|
234
|
+
end
|
235
|
+
|
236
|
+
def move_to_top_edge(location)
|
237
|
+
self.class.fetch([column, location.top])
|
238
|
+
end
|
239
|
+
|
240
|
+
def move_to_left_edge(location)
|
241
|
+
self.class.fetch([location.left, row])
|
242
|
+
end
|
243
|
+
|
244
|
+
def move_to_right_edge(location)
|
245
|
+
self.class.fetch([location.right, row])
|
246
|
+
end
|
247
|
+
|
248
|
+
################################################################################ location から見た情報を返す
|
249
|
+
|
250
|
+
Dimension::Column::DELEGATE_METHODS.each do |name|
|
251
|
+
define_method(name) do |location|
|
252
|
+
@column.white_then_flip(location).public_send(name)
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
Dimension::Row::DELEGATE_METHODS.each do |name|
|
257
|
+
define_method(name) do |location|
|
258
|
+
@row.white_then_flip(location).public_send(name)
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
################################################################################
|
170
263
|
end
|
171
264
|
end
|
@@ -23,7 +23,7 @@ module Bioshogi
|
|
23
23
|
# 入玉している?
|
24
24
|
def king_soldier_entered?
|
25
25
|
if soldier = king_soldier
|
26
|
-
soldier.place.
|
26
|
+
soldier.place.opp_side?(location)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -36,7 +36,7 @@ module Bioshogi
|
|
36
36
|
def entered_soldiers
|
37
37
|
soldiers.find_all do |e|
|
38
38
|
if e.piece.key != :king
|
39
|
-
e.place.
|
39
|
+
e.place.opp_side?(location)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -31,8 +31,8 @@ module Bioshogi
|
|
31
31
|
:lattice_stroke_width => 1, # 格子の線の太さ
|
32
32
|
:inner_frame_stroke_width => 2, # 枠の線お太さ(nil なら lattice_stroke_width を代用)
|
33
33
|
:inner_frame_fill_color => nil, # 基本透明とする(基本指定なしでよい)
|
34
|
-
:dimension_w => Dimension::
|
35
|
-
:dimension_h => Dimension::
|
34
|
+
:dimension_w => Dimension::Column.dimension_size, # 横のセル数
|
35
|
+
:dimension_h => Dimension::Row.dimension_size, # 縦のセル数
|
36
36
|
:fg_file => nil, # 盤テクスチャ
|
37
37
|
|
38
38
|
# optional
|
@@ -109,8 +109,8 @@ module Bioshogi
|
|
109
109
|
cx, cy = *px(v + V.half) # 中央
|
110
110
|
pentagon_points.flat_map do |x, y|
|
111
111
|
[
|
112
|
-
cx + x * scale * location.
|
113
|
-
cy + y * scale * location.
|
112
|
+
cx + x * scale * location.sign_dir,
|
113
|
+
cy + y * scale * location.sign_dir,
|
114
114
|
]
|
115
115
|
end
|
116
116
|
end
|
@@ -125,7 +125,7 @@ module Bioshogi
|
|
125
125
|
# フォントの位置を微調整
|
126
126
|
def piece_char_adjust(location)
|
127
127
|
@piece_char_adjust ||= {}
|
128
|
-
@piece_char_adjust[location.key] ||= V[*params[:piece_char_adjust][location.key]] * location.
|
128
|
+
@piece_char_adjust[location.key] ||= V[*params[:piece_char_adjust][location.key]] * location.sign_dir
|
129
129
|
end
|
130
130
|
|
131
131
|
def soldier_font_scale(piece)
|
@@ -37,7 +37,7 @@ module Bioshogi
|
|
37
37
|
|
38
38
|
container.players.each do |player|
|
39
39
|
location = player.location
|
40
|
-
s = location.
|
40
|
+
s = location.sign_dir
|
41
41
|
|
42
42
|
if player.location.key == :black
|
43
43
|
v = v_bottom_right_outer
|
@@ -85,7 +85,7 @@ module Bioshogi
|
|
85
85
|
def piece_count_draw(v:, count:, location:)
|
86
86
|
if count >= 2
|
87
87
|
w = count <= 9 ? :single : :double
|
88
|
-
v = v + V[*params[:piece_count_position_adjust][w]] * location.
|
88
|
+
v = v + V[*params[:piece_count_position_adjust][w]] * location.sign_dir
|
89
89
|
piece_count_bg_draw(v: v, location: location)
|
90
90
|
char_draw(
|
91
91
|
:layer => @d_piece_count_layer,
|
@@ -106,9 +106,9 @@ module Bioshogi
|
|
106
106
|
draw_context(@d_piece_count_layer) do |g|
|
107
107
|
g.fill(params[:piece_count_bg_color])
|
108
108
|
|
109
|
-
# v2 = v + V[*params[:piece_count_bg_adjust][w]] * location.
|
110
|
-
# v2 = v + (V.half + V[*params[:piece_count_bg_adjust]]) * location.
|
111
|
-
# g.ellipse(*px(v2), *(cell_rect * params[:piece_count_bg_scale] * location.
|
109
|
+
# v2 = v + V[*params[:piece_count_bg_adjust][w]] * location.sign_dir
|
110
|
+
# v2 = v + (V.half + V[*params[:piece_count_bg_adjust]]) * location.sign_dir
|
111
|
+
# g.ellipse(*px(v2), *(cell_rect * params[:piece_count_bg_scale] * location.sign_dir), 0, 360) # x, y, w, h, angle(0 to 360)
|
112
112
|
# g.ellipse(*px(v2), *cell_rect, 0, 360) # x, y, w, h, angle(0 to 360)
|
113
113
|
|
114
114
|
# 個数は左上を原点とした枠の中心(CenterGravity)で表示するのでその位置に移動する
|