-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 98cdafe
Showing
24 changed files
with
75,797 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
include_once(__DIR__.'/vendor/autoload.php'); | ||
|
||
$a = new \Hackathon\Game\Main(); | ||
$a->execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 robinduval | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Hackathon #5 | ||
|
||
## Participants | ||
|
||
* Bobynette : Florent Degardin | ||
* Crazy : Tirage au sort | ||
* Love : Robin Duval | ||
* Zerg : Florent Sevestre | ||
* Hal : Patrick Renaud | ||
* LightJarvis : El Mehdi Brahimi | ||
* Alpha : Ibrahima Sow | ||
* Streichholzschachtel : Verena Lenes | ||
* Prout : Nicolas Moulin | ||
|
||
## Voici les IA déjà mis en place | ||
|
||
* Evil | ||
* Happy | ||
* HardCoop | ||
* HardMajority | ||
* Lain | ||
* Love | ||
* Moody | ||
* PeriodicCCT | ||
* PeriodicTTC | ||
* Rancor | ||
* SoftMajority | ||
* Sounder | ||
* Wary | ||
|
||
# Avant propos | ||
|
||
## Introduction | ||
|
||
Vous êtes enfermés avec une autre IA, dont vous ne connaissez pas l'identité. | ||
|
||
Vous avez deux choix : la coopération (friend) ou le considérer comme un adversaire (foe). | ||
En fonction de vos deux choix, les gains (ou pertes) sont répartis de la manière suivante. | ||
|
||
| Moi @ L'autre | friend | foe | | ||
| ------------- | --------------- | ---------- | | ||
| friend | 3 @ 3 | 0 @ 5 | | ||
| foe | 5 @ 0 | 1 @ 1 | | ||
|
||
## Comment faire ? | ||
|
||
A chaque tour, vous devez faire un choix 'friend' ou 'foe', en fonction du contexte. | ||
|
||
## Objectif | ||
|
||
Il faut avoir le plus haut score. Les scores se cumulent entre chaque match. | ||
|
||
## Informations | ||
|
||
Il y a 10'000 tours par match. | ||
Pour vous aidez à faire vos choix, vous avez accès aux informations suivantes : | ||
- votre (ou son) dernier choix | ||
- la pile de vos (ou ses) choix | ||
- votre (ou son) dernier gain (ou perte) | ||
- la pile de vos (et ses) gains (ou pertes) | ||
- des statistiques (pour vous, pour l'autre ou les deux) concernant le nombre de fois : où il a été dit 'friend', 'foe' et le score de chacun | ||
- le numéro du tour où vous en êtes | ||
|
||
Les informations sont dans la proprieté result de votre objet. | ||
|
||
# Démarrage | ||
|
||
## Etapes d'installation | ||
|
||
* composer install # pour installer les vendors | ||
* ./phpunit.phar # pour vérifier que les fichiers ne sont pas corrompus - et que tout fonctionne | ||
* php EntryPoint.php # lance la génération des résultats dans index.html | ||
|
||
|
||
## Les scripts à connaitre | ||
|
||
./phpunit.phar : permet de lancer les tests (ils seront lancés AVANT de lancer tous les combats) | ||
php EntryPoint.php : permet de lancer les combats ET de générer un fichier index.html avec l'ensemble des résultats | ||
|
||
## Les résultats - Etape par Etape | ||
|
||
* Récupération de vos classes que je remplace | ||
* Remplacement (ou non) de la classe Crazy par les autres IA | ||
* Execution des tests qui permettent de vérifier s'il n'y a pas eu triche et que vos IAs sont compatibles (si une IA ne passe pas les tests ==> c'est la disqualification) | ||
* Generation de la page de résultats | ||
|
||
## Notes | ||
|
||
- Les boucles infinis, l'utilisation de die, exit, exceptions, signal, ... sont interdits. | ||
- Une vérification du temps d'execution sera effectué. | ||
- Les valeurs de la matrice de gains/pertes sont amenées à évoluer, ainsi que le nombre de tours pour un match (le nombre de tours sera toujours supérieur à 100). | ||
- Les IAs Lazy, Crazy ne seront pas les mêmes sur l'environnement final. Elles ne servent qu'à tester votre propre IA. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "robinduval/hackathon", | ||
"description": "New Version of the Hackathon", | ||
"authors": [ | ||
{ | ||
"name": "Robin Duval", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"minimum-stability": "stable", | ||
"autoload": { | ||
"psr-4": { | ||
"Hackathon\\Game\\" : "src/Game/Engine/", | ||
"Hackathon\\PlayerIA\\" : "src/Game/PlayerIA/", | ||
"Hackathon\\Tests\\" : "src/Tests/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Robin Duval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<html> | ||
<body> | ||
<table style="border:1px"> | ||
<tr> | ||
<td><strong>Player A</strong></td> | ||
<td>Score</td> | ||
<td>Friend</td> | ||
<td>Foe</td> | ||
<td><strong>Player B</strong></td> | ||
<td>Score</td> | ||
<td>Friend</td> | ||
<td>Foe</td> | ||
</tr><tr><td>Foe</td> | ||
<td>50</td> | ||
<td>0</td> | ||
<td>10</td> | ||
<td>Friend</td> | ||
<td>0</td> | ||
<td>10</td> | ||
<td>0</td> | ||
</tr></table><br /><br /><br /><table><tr><td>Foe</td><td>50</td></tr> | ||
<tr><td>Friend</td><td>0</td></tr> | ||
<tr><td><strong>Total</strong></td><td><strong>50</strong></td></tr> | ||
</table></body> | ||
</html> |
Oops, something went wrong.