Advertisement
Blarx

Untitled

Dec 3rd, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.41 KB | None | 0 0
  1. @echo off
  2. chcp 65001 > nul
  3. set day=%DATE:~0,2%
  4. set month=%DATE:~3,2%
  5. set year=%DATE:~6,4%
  6. :menu
  7. echo Menu
  8. echo    J. Jouer une partie
  9. echo    S. Score(s) du Jour
  10. echo    G. Score(s) global
  11. echo    Q. Quitter
  12. echo.
  13. choice /c:JSGQ /m "Votre choix :"
  14. echo.
  15.  
  16. if %ERRORLEVEL%==1 goto partie
  17. if %ERRORLEVEL%==2 goto scores
  18. if %ERRORLEVEL%==3 goto global
  19. if %ERRORLEVEL%==4 goto fin
  20. :scores
  21. type .\save\score_%day%_%month%_%year%.txt
  22. pause
  23. cls
  24. goto menu
  25.  
  26. :partie
  27. set dateBegin=%TIME%
  28. set /p user=Quel est votre pseudo :
  29. set coups=0
  30. set nbMyst=
  31. set /a nbMyst=%RANDOM% %%100
  32.  
  33. :begin
  34. set /p input=Choisir un nombre :
  35. set /a coups=%coups%+1
  36. if %input%==%nbMyst% (
  37.     IF EXIST .\save (
  38.         goto good
  39.     ) ELSE (
  40.         mkdir save
  41.     )
  42.     :good
  43.  
  44.     echo %user%,%dateBegin%,%TIME%,%coups% >> .\save\score_%day%_%month%_%year%.txt
  45.     echo Bien joué
  46.     timeout 3 > nul
  47.     cls
  48.     goto menu
  49. )
  50. :global
  51. set /p nom=Veuillez saisir le nom du joueur :
  52. echo Statistiques de jeu pour %nom%
  53. set nombre=find /c %nom% .\save\score_*.txt
  54. for /F "tokens=1,2,3 delims= " %%a in ('find /c /i "%nom%" .\save\score_*.txt') do (
  55.     for /F "tokens=1,2,3 delims=\" %%c in ("%%b") do echo %%e   -   Nombre de parties :
  56. )
  57. pause
  58. if %input% LSS %nbMyst% (
  59.     echo Le nombre mystère est supérieur.
  60.     goto begin
  61. )
  62. if %input% GTR %nbMyst% (
  63.     echo Le nombre mystère est inférieur.
  64.     goto begin
  65. )
  66.  
  67. :fin
  68. pause > nul
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement