iphone/ipod touch向け アプリケーション リーチの …iphone/ipod touch向け...
TRANSCRIPT
![Page 1: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/1.jpg)
iPhone/iPod touch向けアプリケーションリーチの作成
藤本 拓也 大西 建輔
東海大学
2010/3/1
![Page 2: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/2.jpg)
はじめに
やったこと• iPhone/iPod touch向けアプリケーションの作成
動機• 身の回りで使える実用的なプログラムを作成したい
• iPhoneアプリという新しい分野に挑戦したい
![Page 3: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/3.jpg)
リーチの概要
• リーチについて
• アプリケーションの説明
プログラムの実装
• 勝敗判定
• CPU機能によりコマを自動で動かすeasy 一番弱い
medium 中間の強さ
hard 一番強い
発表内容
![Page 4: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/4.jpg)
リーチ概要
![Page 5: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/5.jpg)
リーチとは
• 自修館から発売されているゲーム
URL http://www.jishukan.ne.jp/omocha/reach.html
• 三目並べの一種であるが、先手必勝ではない
• コマは最初から全て配置されている
![Page 6: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/6.jpg)
リーチのルール
•コマの移動色違いでコマのないマスに移動可能
•勝利条件3つあるコマを縦、横、斜めに揃えると勝ち
![Page 7: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/7.jpg)
アプリケーションの操作方法
押してスタート
タッチ
タッチ
再びタッチ
![Page 8: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/8.jpg)
プログラムの実装
![Page 9: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/9.jpg)
Q.コマが縦、横、斜めのいずれかで3つ揃ったことをどのように把握するか?
勝敗判定
A.魔方陣の利用
![Page 10: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/10.jpg)
2+7+6=15
2+9+4=15
2+5+8=15
勝敗判定
![Page 11: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/11.jpg)
CPU機能によるコマの移動
•easy
CPUが勝てる状況なら勝つ
•medium
•hard
![Page 12: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/12.jpg)
勝てるようにコマを移動するには?
コマの和が15であれば勝ち
コマの和が15になるようにコマを移動
![Page 13: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/13.jpg)
動かすコマの求め方
コマの和 4+5+1=10
差分 15-10=5
(4+5)+5+1=154のマスから9のマスへ
4+(5+5)+1=155のマスから10のマスへ←存在しない
4+5+(1+5)=151のマスから6のマスへ
![Page 14: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/14.jpg)
easyの流れ
1.コマの和が15になるようコマを移動
2.そうでなければ、ランダムにコマを移動
![Page 15: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/15.jpg)
CPU機能によるコマの移動
•easy
•medium相手の勝ちを阻止する
•hard
![Page 16: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/16.jpg)
相手の勝ちを阻止するようにコマを移動するには?
相手のコマの和が15になれば負け
相手がコマの和を15にできないよう危険マスにコマを移動
![Page 17: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/17.jpg)
危険マスとは
白の勝ちを阻止する場合
危険マス
危険マス
![Page 18: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/18.jpg)
危険マスの求め方
9+5+6=20
15-20=-5
9+5+(6-5)=151が危険マス
9+(5-5)+6=150のマスは存在しない
(9-5)+5+6=154が危険マス
白の勝ちを阻止
相手のコマの和
差分
![Page 19: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/19.jpg)
危険マスへ動かすコマの求め方
次は黒の番危険マスは1と4
危険マスにあるコマは移動不可
移動できるコマを使って相手の勝ちを阻止
![Page 20: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/20.jpg)
危険マスでないパターン
相手のコマの和 2+6+1=9
差分 15-9=6
(2+6)+6+1=15
2+(6+6)+1=15
2+6+(1+6)=15 白の勝ちを阻止
![Page 21: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/21.jpg)
mediumの流れ
1.相手のコマの和が15になるような危険マスを計算
2.(移動コマの選択)1.危険マスにあるコマは移動不可2.移動できるコマを危険マスへ移動
3.2でコマが移動しない場合はランダムにコマを移動
![Page 22: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/22.jpg)
CPU機能によるコマの移動
•easy
•medium
•hard
CPUが負けないようにコマを動かす
![Page 23: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/23.jpg)
リーチには相手に最善手を打たれると
勝つことのできない
詰み状態
が存在する
詰み状態について
![Page 24: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/24.jpg)
負けないようにコマを動かすには?
詰み状態を避けてコマを移動
仮の一手を打ち
詰み状態の盤面ならばその手を打たない
![Page 25: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/25.jpg)
白のコマの詰み状態の一例
白がコマを動かしたあとの盤面相手の勝ちを阻止できない黒が最善手を打つと
![Page 26: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/26.jpg)
禁止リストとは
仮の一手
比較
詰み状態の集合
![Page 27: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/27.jpg)
禁止リストをどのように作成すれば良いか?
それぞれの盤面に対応した値を使えば良い
禁止リスト作成の準備
![Page 28: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/28.jpg)
盤面と一対一に対応する値
ユニークIDを定義
禁止リストをどのように作成すれば良いか?
禁止リスト作成の準備
![Page 29: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/29.jpg)
ユニークIDの定義
=1
=0
=2
マスの状態値 マスの値
マスの状態値とマスの値の積SユニークID=
![Page 30: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/30.jpg)
ユニークIDの計算
⇒
2×38+1×37+2×36
+0×35+0×34+2×33
+1×32+0×31+1×30
||
16831(ユニークID)
![Page 31: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/31.jpg)
左右対称 90度回転
16831
17263 8063
様々なユニークID
![Page 32: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/32.jpg)
左右対称 90度回転
様々なユニークID
同一視したい
![Page 33: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/33.jpg)
盤面の正規化
16831
17263
8063
14119
7799
7367
18487
12431
![Page 34: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/34.jpg)
• 左上にコマが多く置いてある状態
• 黒いコマより白いコマを重視
ユニークIDが最大
盤面の正規化
![Page 35: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/35.jpg)
2×38+2×37+1×36
+1×35+0×34+0×33
+2×32+0×31+1×30
盤面の正規化
![Page 36: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/36.jpg)
• 左上にコマが多く置いてある状態
• 黒いコマより白いコマを重視
ユニークIDが最大
盤面の正規化
![Page 37: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/37.jpg)
仮の一手 正規化してから禁止リストに含まれるか判定
仮の一手と禁止リストの比較
![Page 38: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/38.jpg)
hardの流れ
1. 仮の一手を決定
2. 仮の一手を打った盤面を正規化
3. 正規化した盤面と禁止リストとを比較
4. もし禁止リストに含まれるなら1に戻るそうでないときは、その手を実際に打つ
![Page 39: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/39.jpg)
まとめ
開発当初の目標
リーチを遊べるアプリの作成
CPU機能の強さを3段階に設定
AppStoreで配信 △
![Page 40: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/40.jpg)
おわりに
課題・禁止リストの中身を一般化する
・レベルの違いに差があるので
強さを自然に変更したい
• ゲーム理論としてのリーチの位置づけ
![Page 41: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/41.jpg)
CM
研究室開発Google Desktop用ガジェット おでかけ君公開中
– Googleカレンダーからデータを取得
– イベントの場所を取得し、Google乗換案内へのリンクを作成
![Page 42: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/42.jpg)
詳しくは、http://www.ss.u-tokai.ac.jp/~onishi/odekakekun.html へ
![Page 43: iPhone/iPod touch向け アプリケーション リーチの …iPhone/iPod touch向け アプリケーション リーチの作成 藤本拓也 大西建輔 東海大学 2010/3/1](https://reader036.vdocuments.site/reader036/viewer/2022063020/5fe297fe6a413e0f905aa6d5/html5/thumbnails/43.jpg)
終わり