Browse Source

adding questions and corrections

pull/578/head
lee 5 years ago committed by Clément
parent
commit
401fa6bf02
  1. 40
      subjects/tron/tron.audit.en.md
  2. 23
      subjects/tron/tron.en.md

40
subjects/tron/tron.audit.en.md

@ -1,8 +1,11 @@
#### Functional #### Functional
##### clone this repo : https://github.com/01-edu/tronAis ##### clone this repo : https://github.com/01-edu/tronAis
##### copy the **GITHUB_LOGIN**.js of the audited inside the /ai folder ##### copy the **GITHUB_LOGIN**.js of the audited inside the /ai folder
##### as such /ai/**GITHUB_LOGIN**.js ##### as such /ai/**GITHUB_LOGIN**.js
##### run this command ##### run this command
```sh ```sh
@ -16,26 +19,63 @@ npm install -g http-server
``` ```
##### go the link created by the http-server, open the inspector and **disable the cache** ##### go the link created by the http-server, open the inspector and **disable the cache**
##### modify the link so that the users are the audited **GITHUB_LOGIN** ##### modify the link so that the users are the audited **GITHUB_LOGIN**
##### and **Frenchris-right-basic** ##### and **Frenchris-right-basic**
###### Does the AI crash because of too much usage of CPU?
###### Did the audited Ai won against the Frenchris-right-basic Ai? ###### Did the audited Ai won against the Frenchris-right-basic Ai?
##### modify the link so that the users are the audited **GITHUB_LOGIN** ##### modify the link so that the users are the audited **GITHUB_LOGIN**
##### and **Frenchris-right** ##### and **Frenchris-right**
###### Did the audited Ai won against the Frenchris-right Ai? ###### Did the audited Ai won against the Frenchris-right Ai?
##### modify the link so that the users are the audited **GITHUB_LOGIN** ##### modify the link so that the users are the audited **GITHUB_LOGIN**
##### and **Frenchris-snail-basic** ##### and **Frenchris-snail-basic**
###### Did the audited Ai won against the Frenchris-snail-basic Ai? ###### Did the audited Ai won against the Frenchris-snail-basic Ai?
##### modify the link so that the users are the audited **GITHUB_LOGIN** ##### modify the link so that the users are the audited **GITHUB_LOGIN**
##### and **Frenchris-snail** ##### and **Frenchris-snail**
###### Did the audited Ai won against the Frenchris-snail Ai? ###### Did the audited Ai won against the Frenchris-snail Ai?
##### modify the link so that the users are the audited **GITHUB_LOGIN** ##### modify the link so that the users are the audited **GITHUB_LOGIN**
##### and **AI5** ##### and **AI5**
###### Did the audited Ai won against the AI5 Ai? ###### Did the audited Ai won against the AI5 Ai?
##### modify the link so that the users are the audited **GITHUB_LOGIN** ##### modify the link so that the users are the audited **GITHUB_LOGIN**
##### and **AI6** ##### and **AI6**
###### Did the audited Ai won against the AI6 Ai? ###### Did the audited Ai won against the AI6 Ai?
##### modify the link so that the users are the audited **GITHUB_LOGIN**
##### and **AIBestPath**
###### Did the audited Ai won against the AIBestPath Ai?
##### modify the link so that the users are the audited **GITHUB_LOGIN**
##### and **kill**
###### Did the audited Ai won against the kill Ai?
#### Bonus
##### modify the link so that the users are the audited **GITHUB_LOGIN**
##### and **hardAI**
###### +Did the audited Ai won against the hardAI Ai?
###### +Does the code avoid deep nesting?

23
subjects/tron/tron.en.md

@ -1,6 +1,6 @@
## tron ## tron
### Ojectives ### Objectives
In this project you will have to create your own Tron Ai snake In this project you will have to create your own Tron Ai snake
@ -19,15 +19,18 @@ if http-server is not installed do this command:
```sh ```sh
npm install -g http-server npm install -g http-server
``` ```
### Controls ### Controls
- `space` toogles autoplay
- `space` toggles auto-play
- `right arrow` plays one move - `right arrow` plays one move
- `up arrow` increases the autoplay speed - `up arrow` increases the auto-play speed
- `down arrow` lowers the autoplay speed - `down arrow` lowers the auto-play speed
- `R` reloads the same play - `R` reloads the same play
- `S` loads a new play (new seed) - `S` loads a new play (new seed)
### Rules ### Rules
- Your Ai has to move every turn *(it can not stay still)* - Your Ai has to move every turn *(it can not stay still)*
- Every time the Ai moves somewhere the Ai leaves a color trail. - Every time the Ai moves somewhere the Ai leaves a color trail.
- the Ai can only move to a blank tile. - the Ai can only move to a blank tile.
@ -39,14 +42,17 @@ npm install -g http-server
- **The Ai has to survive as long as it can.** - **The Ai has to survive as long as it can.**
### The game ends ### The game ends
- Once no players can make a move - Once no players can make a move
- The player with the longest trail wins - The player with the longest trail wins
### How to write your AI ### How to write your AI
- Copy the file [/ai/random.js](https://github.com/01-edu/tronBlank/blob/master/ai/random.js) to /ai/**GITHUB_LOGIN**.js - Copy the file [/ai/random.js](https://github.com/01-edu/tronBlank/blob/master/ai/random.js) to /ai/**GITHUB_LOGIN**.js
- You may now edit the `update` function which is called each turn - You may now edit the `update` function which is called each turn
### How to test your AI ### How to test your AI
- Suppose the link provided by http-server is : `http://127.0.0.1:8080/?seed=somevalue&users=random` - Suppose the link provided by http-server is : `http://127.0.0.1:8080/?seed=somevalue&users=random`
- You need to add your ai as a user in that link, - You need to add your ai as a user in that link,
- Example: if your ai file's name is **/ai/Frenchris.js** - Example: if your ai file's name is **/ai/Frenchris.js**
@ -57,11 +63,14 @@ the link becomes:
- let's change the update function so that your ai only goes forward. - let's change the update function so that your ai only goes forward.
replace this line just before the `return` of the update function Replace this line just before the `return` of the update function
```js ```js
const available = coordsInBound.filter(isFree) const available = coordsInBound.filter(isFree)
``` ```
with this line
With this line
```js ```js
const available = coordsInBound.filter(isFree).filter(el => el.direction === 0) const available = coordsInBound.filter(isFree).filter(el => el.direction === 0)
``` ```
@ -70,7 +79,7 @@ const available = coordsInBound.filter(isFree).filter(el => el.direction === 0)
you have changed your ai behaviour from a random pick of available moves to only going you have changed your ai behaviour from a random pick of available moves to only going
forward. forward.
- To understand better the way of controling your AI, read the comments inside the Ai file and do a lot of testing. - To understand better the way of controlling your AI, read the comments inside the Ai file and do a lot of testing.
- When peer-corrected, you Ai will be competing against other Ais. - When peer-corrected, you Ai will be competing against other Ais.
Be aware that there will be the possibility for the peer-correcter to use his or her own Ai. Be aware that there will be the possibility for the peer-correcter to use his or her own Ai.

Loading…
Cancel
Save