Browse Source

docs(tron) change URLs

strisnegative
davhojt 2 years ago committed by Dav Hojt
parent
commit
df7eed8272
  1. 23
      subjects/tron/README.md
  2. 45
      subjects/tron/audit/README.md

23
subjects/tron/README.md

@ -30,17 +30,28 @@ You will need to create a public repository with the name `tron`. Next you need
- Once no players can make a move the player with the biggest score wins
### Useful files
- [index.html (Game Engine)](https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/game_students/index.html)
- [hard.js](https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/hard.js)
- [license-to-kill.js](https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/license-to-kill.js)
- [random.js](https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/random.js)
- [right.js](https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/right.js)
- [snail.js](https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/snail.js)
### How to write your AI
- Copy the code on the file [random.js](https://raw.githubusercontent.com/01-edu/public/master/subjects/tron/ai/random.js) to your file, `ai.js`
- You may now edit the `update` function which is called each turn
- Create `ai.js` at the root of your repository.
- Copy the contents of `random.js`, and paste it to `ai.js`.
- You may now edit the `update` function which is called each turn.
> ⚠ Do not rename the `update` function ⚠ \
> as it's the function that the worker will try to run to test your AI.
### How to test your AI
- You may test your ai locally. For that, create a folder and give it a name. Inside the folder you created, insert this file [index.html](<https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/game_students/index.html>).
**AI AT ROOT**
- You may test your ai locally. For that, create a folder and give it a name. Inside the folder you created, insert this file `index.html`.
- After that, create a simple web server by running the following command:
```sh
@ -63,9 +74,9 @@ xdg-open 'http://localhost:8000'
- You can add a local file by specifying the relative path.
- You can add a online raw file by specifying the url to that file.
A example of a url with local files using the default AI `random.js` against the AI `hard.js` would be `localhost:8000/?seed=1636444665&ai=random.js+hard.js`.
A example of a url with local files using the default AI `ai.js` against the AI `hard.js` would be `http://localhost:8000/?ai=hard.js+ai.js&seed=2077349364`.
A example of a url with online files would be `localhost:8000/?seed=1636444665&ai=https://dev.01-edu.org/git/root/public/raw/branch/master/subjects/tron/ai/hard.js+https://dev.01-edu.org/git/root/public/raw/branch/master/subjects/tron/ai/random.js`.
A example of a url with online files would be `http:?/localhost:8000/?ai=https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/hard.js+ai.js`.
Note: You can test a local AI against and online one.

45
subjects/tron/audit/README.md

@ -1,45 +1,44 @@
#### Functional
##### Does the AI not crash because of too much usage of CPU?
##### Modify the link so that you use the AI from the user that is being audited [ai.js](<https://((DOMAIN))/git/GITHUB_LOGIN/tron/raw/branch/master/ai.js>)
##### Open the project, and delete `index.html` if it exists.
##### and [random.js](<https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/random.js>). Try three times, changing the seed each time. The best of three, wins
##### Copy the game engine ([index.html](https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/game_students/index.html)) to the root of the student's project.
###### Did the audited AI won against `random` AI?
##### Create a simple web server by running the following command:
##### Modify the link so that you use the AI from the user that is being audited [ai.js](<https://((DOMAIN))/git/GITHUB_LOGIN/tron/raw/branch/master/ai.js>)
```sh
$ python3 -m http.server
Serving HTTP on :: port 8000 (http://[::]:8000/)
```
##### and [right.js](<https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/right.js>). Try three times, changing the seed each time. The best of three, wins
##### Open a web browser, and go to the specified port. In the above case, that will be http://localhost:8000.
###### Did the audited AI won against `right` AI?
##### Modify the link so that you use the AI from the user that is being audited [ai.js](<https://((DOMAIN))/git/GITHUB_LOGIN/tron/raw/branch/master/ai.js>)
##### Does the AI not crash because of too much usage of CPU?
##### and [snail.js](<https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/snail.js>). Try three times, changing the seed each time. The best of three, wins
##### Battle `ai.js` versus `random.js`. It is best out of 3. Delete the seed before each go. http://localhost:8000/?ai=https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/random.js+ai.js
###### Did the audited AI won against `snail` AI?
###### Did `ai.js` win `random.js` at least 2 times out of the 3 games?
###### Does the code avoid [deep nesting](https://testing.googleblog.com/2017/06/code-health-reduce-nesting-reduce.html)?
##### Battle `ai.js` versus `right.js`. It is best out of 3. Delete the seed before each go. http://localhost:8000/?ai=https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/right.js+ai.js
##### Modify the link so that you use the AI from the user that is being audited [ai.js](<https://((DOMAIN))/git/GITHUB_LOGIN/tron/raw/branch/master/ai.js>)
###### Did `ai.js` win `right.js` at least 2 times out of the 3 games?
##### and [hard.js](<https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/hard.js>). Try three times, changing the seed each time. The best of three, wins
##### Battle `ai.js` versus `snail.js`. It is best out of 3. Delete the seed before each go. http://localhost:8000/?ai=https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/snail.js+ai.js
###### Did the audited AI won against `hard` AI?
###### Did `ai.js` win `snail.js` at least 2 times out of the 3 games?
#### Bonus
###### Does the code avoid [deep nesting](https://testing.googleblog.com/2017/06/code-health-reduce-nesting-reduce.html)?
##### Modify the link so that you use the AI from the user that is being audited [ai.js](<https://((DOMAIN))/git/GITHUB_LOGIN/tron/raw/branch/master/ai.js>)
##### Battle `ai.js` versus `hard.js`. It is best out of 3. Delete the seed before each go. http://localhost:8000/?ai=https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/hard.js+ai.js
##### and [license-to-kill.js](<https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/license-to-kill.js>). Try three times, changing the seed each time. The best of three, wins
###### Did `ai.js` win `hard.js` at least 2 times out of the 3 games?
###### +Did the audited AI won against `license-to-kill` AI?
#### Bonus
##### If you have an AI
##### Battle `ai.js` versus `licence-to-kill.js`. It is best out of 3. Delete the seed before each go. http://localhost:8000/?ai=https://((DOMAIN))/git/root/public/raw/branch/master/subjects/tron/ai/licence-to-kill.js+ai.js
##### Modify the link so that you use the AI from the user that is being audited [ai.js](<https://((DOMAIN))/git/GITHUB_LOGIN/tron/raw/branch/master/ai.js>)
###### +Did `ai.js` win `licence-to-kill.js` at least 2 times out of the 3 games?
##### and **your AI**. Try three times, changing the seed each time. The best of three, wins
##### If you have an AI, and are prepared for battle. Modify the URL to battle against your AI. Best out of 3.
###### +Did the audited AI won against your AI?

Loading…
Cancel
Save