Javaで実装されたチェッカープレイエージェント。エージェントは、Alpha-Beta Pruningを使用してMinimaxアルゴリズムを使用します。
英語のドラフトまたはアメリカのチェッカーは、8x8チェッカーボードで再生される人気の2プレーヤーゲームです。 AIは、コンピューターゲームの先駆者であるAIであるAiが自己学習チェッカーズプログラムを作成したArthur Samuelで、チェッカーを介したゲームで最も初期の成功の1つを目撃しました。このプロジェクトは、ゲームプレイとAIの歴史によって動機付けられています。
フォークボタン(ページの右上隅)を押して、このプロジェクトのコピーをアカウントに保存します。
ダウンロードセクションからリポジトリファイル(プロジェクト)をダウンロードするか、次のコマンドをbashに入力してこのプロジェクトをクローンします。
git clone https://github.com/sramakrishnan247/Checkers-AI
Intellij IDE(またはその他のIDEまたはお気に入りのテキストエディター)を使用してプロジェクトをインポートします
game.javaからアプリケーションを実行:d
プロンプトは、ユーザーが必要な移動のみを選択する必要があるように、この形式で利用可能なすべての動きをリストします。
次のように標準のチェッカー表記に従います。
Welcome!
Pick the difficulty!
1.Rookie
2.Intermediate
3.Pro
4.Grandmaster
Pick the difficulty(1-4)!
2
Player color: 2
AI color: 1
Player King: 4
AI King: 3
Light(Player) Pieces: 12,Dark(AI) Pieces: 12
Current Board
0 1 0 1 0 1 0 1
1 0 1 0 1 0 1 0
0 1 0 1 0 1 0 1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
2 0 2 0 2 0 2 0
0 2 0 2 0 2 0 2
2 0 2 0 2 0 2 0
Available Moves:
1: 21-17
2: 22-17
3: 22-18
4: 23-18
5: 23-19
6: 24-19
7: 24-20
Please choose move number:
2
Player Played last...
Light(Player) Pieces: 12,Dark(AI) Pieces: 12
AI thinking...
Heuristic val(AI is winning if +ve): 0.0
Source: 2,1, Dest: 3,2 Jump: false
Skipped squares:
Move notation: 9-14
AI PLAYED LAST...
0 1 0 1 0 1 0 1
1 0 1 0 1 0 1 0
0 0 0 1 0 1 0 1
0 0 1 0 0 0 0 0
0 2 0 0 0 0 0 0
2 0 0 0 2 0 2 0
0 2 0 2 0 2 0 2
2 0 2 0 2 0 2 0
Available Moves:
1: 17-13
2: 23-18
3: 23-19
4: 24-19
5: 24-20
6: 25-22
7: 26-22
Please choose move number:
...
Player Played last...
Light(Player) Pieces: 1,Dark(AI) Pieces: 8
AI thinking...
Heuristic val(AI is winning if +ve): 9.0
Source: 5,6, Dest: 7,4 Jump: true
Skipped squares: (6,5),
Move notation: 24x31
AI PLAYED LAST...
0 0 0 0 0 0 0 1
0 0 0 0 0 0 1 0
0 0 0 1 0 1 0 1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 3 0 3 0 0 0
Light(Player) Pieces: 0,Dark(AI) Pieces: 8
Final Board Status
0 0 0 0 0 0 0 1
0 0 0 0 0 0 1 0
0 0 0 1 0 1 0 1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 3 0 3 0 0 0
1
AI WINS!