rapport debut

This commit is contained in:
Dylan LANDRIN 2024-09-18 16:48:02 +02:00
parent c834b7f4ac
commit 4ae0bc2ecc
4 changed files with 114 additions and 2 deletions

112
README.md
View File

@ -39,6 +39,23 @@ exploreMin calls = 19
First player winning ? = False First player winning ? = False
``` ```
Test avec 11 allumettes :
```
$ python3 game.py
-----------------------
Game and algorithm data
-----------------------
== Game data ==
Remaining matches : 11
Game state : 0
Actual player : 1
== Algorithm data ==
exploreMax calls = 261
exploreMin calls = 261
First player winning ? = True
```
Test avec 14 allumettes : Test avec 14 allumettes :
``` ```
@ -55,6 +72,33 @@ exploreMin calls = 913
First player winning ? = True First player winning ? = True
``` ```
Test avec 17 allumettes :
```
$ python3 game.py
-----------------------
Game and algorithm data
-----------------------
== Game data ==
Remaining matches : 17
Game state : 0
Actual player : 1
== Algorithm data ==
exploreMax calls = 6401
exploreMin calls = 6403
First player winning ? = False
```
Test avec 42 allumettes :
```
$ python3 game.py
```
Test avec 100 allumettes :
```
$ python3 game.py
```
#### Après #### Après
Test avec 5 allumettes : Test avec 5 allumettes :
``` ```
@ -73,6 +117,23 @@ exploreMin calls = 3
First player winning ? = False First player winning ? = False
``` ```
Test avec 11 allumettes :
```
$ python3 game.py
-----------------------
Game and algorithm data
-----------------------
== Game data ==
Remaining matches : 11
Game state : 0
Actual player : 1
== Algorithm data ==
exploreMax calls = 6
exploreMin calls = 6
First player winning ? = True
```
Test avec 14 allumettes : Test avec 14 allumettes :
``` ```
@ -87,4 +148,55 @@ Actual player : 1
exploreMax calls = 8 exploreMax calls = 8
exploreMin calls = 7 exploreMin calls = 7
First player winning ? = True First player winning ? = True
```
Test avec 17 allumettes :
```
$ python3 game.py
-----------------------
Game and algorithm data
-----------------------
== Game data ==
Remaining matches : 17
Game state : 0
Actual player : 1
== Algorithm data ==
exploreMax calls = 9
exploreMin calls = 9
First player winning ? = False
```
Test avec 42 allumettes :
```
$ python3 game.py
-----------------------
Game and algorithm data
-----------------------
== Game data ==
Remaining matches : 42
Game state : 0
Actual player : 1
== Algorithm data ==
exploreMax calls = 22
exploreMin calls = 21
First player winning ? = True
```
Test avec 100 allumettes :
```
$ python3 game.py
-----------------------
Game and algorithm data
-----------------------
== Game data ==
Remaining matches : 100
Game state : 0
Actual player : 1
== Algorithm data ==
exploreMax calls = 51
exploreMin calls = 50
First player winning ? = True
``` ```

BIN
RapportNim.odt Normal file

Binary file not shown.

View File

@ -101,6 +101,6 @@ class Game(int):
return content return content
game = Game(5) # Creating Nim game with 5 matches game = Game(42) # Creating Nim game with 5 matches
game.miniMax() # Checking if the player 1 is winning game.miniMax() # Checking if the player 1 is winning
print(game) # Displays game and algorithm data print(game) # Displays game and algorithm data

View File

@ -114,6 +114,6 @@ class Game(int):
) )
return content return content
game = Game(5) # Creating Nim game with 5 matches game = Game(100) # Creating Nim game with 5 matches
game.miniMax() # Checking if the player 1 is winning game.miniMax() # Checking if the player 1 is winning
print(game) # Displays game and algorithm data print(game) # Displays game and algorithm data