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
Documentation : | |
Defenders strategies : | |
- 0 : always roll 2 dice | |
- 1 : roll one die if the sum of the best two attacker dice is >= 8 | |
- 1.n : roll one die if the sum of the best two attacker dice is >= n | |
- 2 : like 1 but if there are only 2 defender units remaining always roll 2 dice | |
- 3 : like 2 but if the attacker has only 3 or fewer units remaining always throw 2 dice | |
Winning rate is the probability of an attacker victory |
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
use std::cmp::min; | |
use rand::Rng; | |
use crate::Player::{Attacker, Defender}; | |
enum Player { | |
Attacker, Defender | |
} | |
struct Delta { | |
a_delta: u32, |
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
When a Django project is configured with an interpreter located in a docker container, the python console encounter errors. | |
To fix that, go to file > settings > Build, Execution, Deployment > Console > Django Console. | |
Then override the starting script with the following snippet : | |
import sys; print('Python %s on %s' % (sys.version, sys.platform)) | |
import django; print('Django %s' % django.get_version()) | |
sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS, '/opt/.pycharm_helpers/pycharm', '/opt/.pycharm_helpers/pydev']) | |
if 'setup' in dir(django): django.setup() | |
import django_manage_shell; django_manage_shell.run(PROJECT_ROOT) |
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
75.83 | |
55.912 | |
56.9861 | |
98 | |
92.6667 | |
83 | |
69.7037 | |
55.2549 | |
54.6 |
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
There is nothing after death, you will disappear, like you were never existed, as if your story was never told. | |
There was nothing before your birth and there will be nothing after your death. | |
Your free will is an illusion, you are a living organism just like every other animal, you are built with similar systems as to all mammals, you are not so different than a rat roaming the street, searching for potential mate, shelter, or food. | |
Your life matters just like the animal that had to be murdered in order for you to eat it's meat few days ago. | |
You are made out of material, you are nothing special among the 7.6 billion humans living on earth. |
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
#!/usr/bin/env python | |
def read_stdin() -> list: | |
""" | |
Returns a list of str read from stdin. | |
Use whitespaces as word separator. | |
""" | |
# 0 is the file descriptor of stdin. | |
# A more clever way would have been to use sys.stdin, but it is forbidden for pedagogic reasons |
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
#!/usr/bin/env python3.7 | |
def read_stdin() -> list: | |
""" | |
Returns a list of str read from stdin. | |
Use whitespaces as word separator. | |
""" | |
# 0 is the file descriptor of stdin. | |
# A more clever way would have been to use sys.stdin, but it is forbidden for pedagogic reasons |
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
from random import randint | |
from time import time | |
# Runtime values | |
i, j, k = randint(0, 9), randint(0, 9), randint(0, 9) | |
start = time() | |
for _ in range(10_000_000): |
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
import json | |
def is_iterable(obj): | |
try: | |
for _ in obj: | |
return True | |
except TypeError: | |
return False |
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
rm(list=ls()) | |
Eleve1 = c(17, 18.5, 14, 17.5, 13) | |
Eleve2 = c(8, 19.5, 20, 6.5, 18.5) | |
Eleve3 = c(14, 15.5, 12.5, 15.5, 13) | |
Matiere = c("Maths", "Anglais", "Chimie", "Sport", "Dessin") | |
Eleves = c("Eleve4", "Eleve5", "Eleve6", "Eleve7", "Eleve8", "Eleve9", "Eleve10", "Eleve1", "Eleve2", "Eleve3") | |
NewerOlder