feat: Premier essai du script, ajout de consignes dans le readme.
This commit is contained in:
15
.vscode/launch.json
vendored
Normal file
15
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
// Utilisez IntelliSense pour en savoir plus sur les attributs possibles.
|
||||
// Pointez pour afficher la description des attributs existants.
|
||||
// Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Python Debugger: Current File",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"program": "${file}",
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
]
|
||||
}
|
@@ -1,2 +1,11 @@
|
||||
# cmd-alexandra-toxicity
|
||||
|
||||
## Installation
|
||||
|
||||
1. Télécharger ce dépôt
|
||||
2. Le Déziper dans un dossier de ton choix (ex: *Mes Documents*)
|
||||
2. Créer un raccourci de `lancer_jeu.bat` :
|
||||
1. Cliquer-droit sur `lancer_jeu.bat` > *Créer un raccourci*
|
||||
2. Glisser le raccourci sur le bureau Windows
|
||||
3. Cliquer-droit sur le raccourci > *Propriétés*
|
||||
- Dans l'onglet Raccourci, activer *Exécuter : Agrandie*
|
66
controleur_de_gaz.py
Normal file
66
controleur_de_gaz.py
Normal file
@@ -0,0 +1,66 @@
|
||||
from time import sleep
|
||||
from random import uniform as rand
|
||||
from colorama import init, Fore, Style
|
||||
|
||||
|
||||
init(autoreset=True)
|
||||
code_secret = "TCPTAR".lower()
|
||||
entree = ""
|
||||
|
||||
|
||||
sleep(rand(0.7, 1.7))
|
||||
print("Initialisation des capteurs")
|
||||
sleep(rand(0.7, 1.7))
|
||||
print("Analyse des niveaux de gaz")
|
||||
sleep(rand(0.7, 1.7))
|
||||
|
||||
print("Détection de gaz toxiques", end="", flush=True)
|
||||
for i in range(0, 101, 4):
|
||||
bar = "#" * (i // 4) # remplit la barre selon le pourcentage
|
||||
print(f"\rDétection de gaz toxiques : [{bar:<25}] {i}%", end="", flush=True)
|
||||
sleep(rand(0.1, 0.3))
|
||||
|
||||
print(
|
||||
"\r"
|
||||
+ Fore.RED
|
||||
+ Style.BRIGHT
|
||||
+ "Détection de gaz toxiques : Confirmé "
|
||||
)
|
||||
sleep(rand(0.7, 1.7))
|
||||
print("Condition des valves : Ouverte")
|
||||
sleep(rand(0.7, 1.7))
|
||||
print("Procédure de sécurité activée")
|
||||
sleep(rand(0.7, 1.7))
|
||||
print(Style.BRIGHT + "FERMETURE AUTOMATIQUE DES PORTES")
|
||||
sleep(rand(0.7, 1.7))
|
||||
|
||||
entree = input("Entrez le code d'accès pour fermeture des valves : ").strip().lower()
|
||||
while entree != code_secret:
|
||||
sleep(1)
|
||||
entree = input("Code invalide! Veillez reesayer : ").strip().lower()
|
||||
|
||||
print("Code validé")
|
||||
sleep(rand(0.7, 1.3))
|
||||
message = "Fermeture des valves"
|
||||
print(message, end="", flush=True)
|
||||
for _ in range(3):
|
||||
sleep(0.5)
|
||||
print(".", end="", flush=True)
|
||||
|
||||
sleep(rand(0.7, 1.7))
|
||||
print("\rFermeture des valves... Valves fermées")
|
||||
sleep(rand(0.7, 1.7))
|
||||
print("Détection de gaz toxiques", end="", flush=True)
|
||||
for i in range(0, 101, 4):
|
||||
bar = "#" * (i // 4) # remplit la barre selon le pourcentage
|
||||
print(f"\rDétection de gaz toxiques : [{bar:<25}] {i}%", end="", flush=True)
|
||||
sleep(rand(0.1, 0.3))
|
||||
|
||||
sleep(rand(0.7, 1.7))
|
||||
print(
|
||||
"\r"
|
||||
+ Fore.GREEN
|
||||
+ Style.BRIGHT
|
||||
+ "Détection de gaz toxiques : Néant "
|
||||
)
|
||||
sleep(5)
|
6
lancer_jeu.bat
Normal file
6
lancer_jeu.bat
Normal file
@@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
mode con: cols=120 lines=40
|
||||
title ESCAPE GAME
|
||||
cd /d "%USERPROFILE%\Documents\cmd-alexandra-toxicity"
|
||||
python jeu.py
|
||||
pause > nul
|
Reference in New Issue
Block a user