200 likes | 351 Views
[.,8]. [8,.]. 8. 8. 7. 3. [.,8]. [9,.]. 9. 8. 8. 7. 3. 9. 1. 6. [.,8]. 4. [2,.]. 9. 8. [4,.]. 4. 8. 7. 3. 1. 2. 4. 9. 1. 6. [.,5]. 4. [1,.]. [3,.]. 5. 1. 3. 5. 4. [.,5]. [3,.]. [9,.]. 9. 5. 1. 3. 5. 3. 9. 2. [.,5]. 4. 5. [6,.]. 9. 5. 6. 1.
E N D
[.,8] [8,.] 8 8 7 3
[.,8] [9,.] 9 8 8 7 3 9 1 6
[.,8] 4 [2,.] 9 8 [4,.] 4 8 7 3 1 2 4 9 1 6
[.,5] 4 [1,.] [3,.] 5 1 3 5
4 [.,5] [3,.] [9,.] 9 5 1 3 5 3 9 2
[.,5] 4 5 [6,.] 9 5 6 1 3 5 2 6 5 9 1 6
5 4 5 3 …
[.,8] [8,.] 8 8 7 3
[.,8] [.,8] [9,8] X 8 8 7 3 9
[.,8] 4 [.,8] [2,8] X 8 [4,8] 4 8 7 3 1 2 4 9
[4,.] [4,.] [4,5] 4 [4,.] 5 1 3 5
[4,.] [4,5] 4 [4,5] 5 [9,5] X 1 3 5 3 9
[4,.] [4,5] 4 5 [4,5] 5 X [6,5] X 1 3 5 6 3 9
5 [5,.] 4 5 [5,.] X [5, <5] [5,.] < 5 [5,.] X 2 3 2
Othello > prolog –l /it/kurs/logpro/othello/play_game.pl … | ?- start_game. Select white player. (1) human (2) program |: 2. White player full program name : |: std. … Black players full program name : |: ’/home/<username>/<path>/myothello.pl’. … (Othello window pops up.)
Othello White player program Shell program Black player program initialize(white,SW) initialize(black,SB) Initialize SW SB best_move(SB, Move) Ask move Move=6-5 move(6-5, SB, NSB) opponent_move(6-5, SW, NSW) Execute move (shell executes move in Othello window)
Othello White player program Shell program Black player program SW SB game_over(SB, …) Game over? no best_move(SW, Move) Ask move Move = c-r move(c-r, SW, NSW) opponent_move(c-r, SB, NSB) Execute move