Skip to content
Extraits de code Groupes Projets
Valider ad79ed5b rédigé par Nathanaël Kindidi's avatar Nathanaël Kindidi
Parcourir les fichiers

Début 1er projet

parent c58de1d1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
import random
from pprint import pprint
import numpy as np
# Initialisation du board
g = [[0 for j in range(15)]for i in range(15)]
# pprint(g)
# Liens entre les cases
for i in range(9):
g[i][i+1]=1
for i in range(10,14):
g[i][i+1]=1
g[2][10]=1
g[9][14]=1
pprint(g)
# 3 types de dés
def safe():
choix = [0,1]
return random.choices(choix,[0.5, 0.5])[0]
def normal():
choix = [0,1,2]
return random.choices(choix,[0.33, 0.33, 0.33])[0]
def risky():
choix = [0,1,2,3]
return random.choices(choix,[0.25, 0.25, 0.25, 0.25])[0]
# markovDecision(layout,circle)
np.random.seed(0)
layout = np.ndarray([0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 1, 0])
choices = [0,1,2,3]
print(layout)
print(np.linspace(1,15,15, dtype=np.float16))
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter