IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Scripts/Batch Discussion :

Snake en batch


Sujet :

Scripts/Batch

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Septembre 2009
    Messages
    140
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2009
    Messages : 140
    Par défaut Snake en batch
    Bonjour, est-ce possible (si oui comment??) de faire un jeu snake en batch?
    merci
    a+


    PS: le snake c'est sa (en photo):http://www.gnu.org/projects/dotgnu/screenshots/13.png

  2. #2
    Membre Expert
    Avatar de I'm_HERE
    Homme Profil pro
    Inscrit en
    Juillet 2008
    Messages
    1 013
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 013
    Par défaut
    Citation Envoyé par pierreh51 Voir le message
    est-ce possible
    c'est possible
    Citation Envoyé par pierreh51 Voir le message
    comment??
    Avant tout il faut dire que les scripts MS-DOS sont faciles à comprendre et difficiles à cerner, ceci dit, tu trouvera si tu cherches avec l'ami google quelques script/jeux assez sympas en pur batch

  3. #3
    Membre émérite
    Avatar de maxim_um
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    895
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2007
    Messages : 895
    Par défaut
    Salut,

    Citation Envoyé par I'm_HERE Voir le message
    il faut dire que les scripts MS-DOS sont faciles à comprendre et difficiles à cerner
    Je vois pas trop le sens, mais j'aime bien ta formulation. Trop cool.

  4. #4
    Inactif  
    Avatar de Mac LAK
    Profil pro
    Inscrit en
    Octobre 2004
    Messages
    3 893
    Détails du profil
    Informations personnelles :
    Âge : 51
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations forums :
    Inscription : Octobre 2004
    Messages : 3 893
    Par défaut
    Citation Envoyé par I'm_HERE Voir le message
    c'est possible
    Cela va être coton quand même, ce genre de choses, ou alors bonjour les clignotements violents à l'écran...
    Mac LAK.
    ___________________________________________________
    Ne prenez pas la vie trop au sérieux, de toutes façons, vous n'en sortirez pas vivant.

    Sources et composants Delphi sur mon site, L'antre du Lak.
    Pas de question technique par MP : posez-la dans un nouveau sujet, sur le forum adéquat.

    Rejoignez-nous sur : Serveur de fichiers [NAS] Le Tableau de bord projets Le groupe de travail ICMO

  5. #5
    Membre Expert
    Avatar de I'm_HERE
    Homme Profil pro
    Inscrit en
    Juillet 2008
    Messages
    1 013
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 013
    Par défaut
    Citation Envoyé par Mac LAK Voir le message
    Cela va être coton quand même, ce genre de choses, ou alors bonjour les clignotements violents à l'écran...
    salut,

    la démarche consiste en la création d'un petit programme (ou si possible chercher une commande externe) pour manipuler les touches du clavier + jouer sur les ERRORLEVEL's du programme.

  6. #6
    Inactif  
    Avatar de Mac LAK
    Profil pro
    Inscrit en
    Octobre 2004
    Messages
    3 893
    Détails du profil
    Informations personnelles :
    Âge : 51
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations forums :
    Inscription : Octobre 2004
    Messages : 3 893
    Par défaut
    Citation Envoyé par I'm_HERE Voir le message
    la démarche consiste en la création d'un petit programme (ou si possible chercher une commande externe) pour manipuler les touches du clavier + jouer sur les ERRORLEVEL's du programme.
    Mais là, ce n'est plus du batch "pur" !
    Mac LAK.
    ___________________________________________________
    Ne prenez pas la vie trop au sérieux, de toutes façons, vous n'en sortirez pas vivant.

    Sources et composants Delphi sur mon site, L'antre du Lak.
    Pas de question technique par MP : posez-la dans un nouveau sujet, sur le forum adéquat.

    Rejoignez-nous sur : Serveur de fichiers [NAS] Le Tableau de bord projets Le groupe de travail ICMO

  7. #7
    Membre Expert
    Avatar de I'm_HERE
    Homme Profil pro
    Inscrit en
    Juillet 2008
    Messages
    1 013
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 013
    Par défaut
    voici quelques exemples et ceci

    la même démarche citer en haut

    en voici une autre qui m'a fait rire "la nostalgie" (du même auteur)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
       @Echo Off
      @title Adventure Game
    ::Batch Game Adventure
    ::Coded by SmartGenius
    ::Batch Game Maker
    
    setlocal enabledelayedexpansion
    mode con cols=14 lineS=13
    
    If Not Exist "keyboard.exe" (Call :NoKey)
    
    :Vars
    Set "Pj="
    Set "LimX=9"
    Set "LimY=10"
    Set "MovA=0"
    Set "MovB=9"
    Set "Bound=Û"
    Set "Ender= "
    Set "Coin="
    
    :Init
    Set /a Level+=1
    Call :Nivel_%Level%
    For /l %%a in (0,1,%LimX%) do (
    For /l %%b in (0,1,%LimY%) do (
    Set X%%aY%%b=!LN_%%b:~%%a,1!))
    Set "%CurPos%=%Pj%"
    Goto :Graphic
    
    :Graphic
    Call :Clear
    For /l %%d in (0,1,%LimY%) do (
    For /l %%e in (0,1,%LimX%) do (
    Set Lin_%%d=!Lin_%%d!!X%%eY%%d!))
    Echo.
    For /l %%f in (0,1,%LimY%) do (echo.  !Lin_%%f!)
    Keyboard
    If "%errorlevel%"=="77" (Call :Derecha "%CurPos%")
    If "%errorlevel%"=="75" (Call :Izquierda "%CurPos%")
    If "%errorlevel%"=="72" (Call :Saltar "%CurPos%")
    If "%errorlevel%"=="27" (msg * Gracias Por Jugar&Exit)
    Call :Gravity "%CurPos%"
    Goto :Graphic
    
    :Derecha
    If "%Mov%"=="115" Goto :Eof
    For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
    Set /a MovX=%%p+1
    Call Set NMovX=%%X!MovX!Y%%q%%
    if "!NMovX!"=="%Bound%" (Goto :Eof)
    if "!NMovX!"=="%Ender%" (Goto :Win)
    if "!NMovX!"=="%Coin%" (Call :UnCoin "%%q" "%%p" "+1")
    Set /a Mov=Mov+1
    For /l %%d in (0,1,%LimY%) do (Set LNB_%%d=!LN_%%d:~%Mov%!)
    For /l %%a in (0,1,%LimX%) do (
    For /l %%b in (0,1,%LimY%) do (
    Set X%%aY%%b=!LNB_%%b:~%%a,1!))
    Set "%CurPos%=%Pj%")
    Goto :Eof
    
    :Izquierda
    If "%Mov%"=="0" Goto :Eof
    For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
    Set /a MovX=%%p-1
    Call Set NMovX=%%X!MovX!Y%%q%%
    if "!NMovX!"=="%Bound%" (Goto :Eof)
    if "!NMovX!"=="%Ender%" (Goto :Win)
    if "!NMovX!"=="%Coin%" (Call :UnCoin "%%q" "%%p" "+1")
    Set /a Mov=Mov-1
    For /l %%d in (0,1,%LimY%) do (Set LNB_%%d=!LN_%%d:~%Mov%!)
    For /l %%a in (0,1,%LimX%) do (
    For /l %%b in (0,1,%LimY%) do (
    Set X%%aY%%b=!LNB_%%b:~%%a,1!))
    Set "%CurPos%=%Pj%")
    Goto :Eof
    
    :Saltar
    For /l %%z in (1,1,3) do (
    Call :Arriba "!CurPos!"
    Call :Gp2)
    Call :Derecha "%CurPos%"
    Call :Gp2
    Goto :Eof
    
    :Arriba
    for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
    set /a MovY=%%q-1
    call set NMovY=%%X%%pY!MovY!%%
    if "!NMovY!"=="%Bound%" (Goto :Eof)
    if "!NMovY!"=="%Ender%" (Goto :Win)
    Set %~1=°
    set X%%pY!MovY!=%Pj%
    set CurPos=X%%pY!MovY!)
    Goto :Eof
    
    :Abajo
    for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
    set /a MovY=%%q+1
    call set NMovY=%%X%%pY!MovY!%%
    if "!NMovY!"=="%Bound%" (Goto :Eof)
    if "!NMovY!"=="%Ender%" (Goto :Win)
    Set %~1=°
    set X%%pY!MovY!=%Pj%
    set CurPos=X%%pY!MovY!)
    Goto :Eof
    
    :UnCoin
    Set /a "M1=%~2+%Mov%"
    Set /a "M2=%M1%%~3"
    Set "LN_%~1=!LN_%~1:~0,%M1%!°!LN_%~1:~%M2%!
    Set /a Coins+=5
    Goto :Eof
    
    :Gravity
    Set /a "GForce=9-%CurPos:~-1%"
    For /l %%z in (1,1,%GForce%) do (
    Call :Abajo "!CurPos!"
    If "%1"=="!CurPos!" Goto :Eof
    Call :Gp2)
    Goto :Eof
    
    :Gp2
    Call :Clear
    For /l %%d in (0,1,%LimY%) do (
    For /l %%e in (0,1,%LimX%) do (
    Set Lin_%%d=!Lin_%%d!!X%%eY%%d!))
    Echo.
    For /l %%f in (0,1,%LimY%) do (echo.  !Lin_%%f!)
    ping -n 1,5 0.0.0.0 >nul
    Goto :Eof
    
    :Clear
    For /l %%m in (0,1,%LimY%) do (set Lin_%%m=)
    Goto :Eof
    
    :Win
    ping -n 2 0.0.0.0 >nul
    If "%Level%"=="2" (
    echo.
    echo.  Muy Bien
    echo.
    echo. Ganaste %Coins%
    echo.
    echo.   Puntos !
    echo.
    ping -n 4 0.0.0.0 >nul
    msg * Gracias Por Jugar
    Exit
    ) else (Goto :Vars)
    ping -n 2 0.0.0. >nul
    Exit
    
    
    :Nivel_1
    Set "CurPos=X2Y3"
    Set LN_0= ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
    Set LN_1= Û°Û±±±±°±°°°±°±±±±°±±±°Û±±±±±°±±±±±°±±±±°±°°Û±°±±±°±Û°±°±±±±°°°±±±±±°±°°±°±±±±°±±±°±±±±°±±±±°±±±±±°°°°°°°±±±±±°°°Û°°°Û
    Set LN_2= Û°Û±°°°°±±°±±°±°°±°±°°±°°°±°°°±°°°°°±°°°°±±°°±°±°°±Û°±°±°°°°°°°°±°°°±°°±°±°ÛÛÛÛ°±°±Û±°°°°±°°°°°°±°°°°°°°°±°°°°°±° Û°°°Û
    Set LN_3= Û°°±±±±°±°±°±°±±±±°±±±°°±°°°±°±±±±±±±°±°±°±°Û±°°±Û°±°±±±±°°°±°°Û±±±±°±±±±°°±±±ÛÛ±±±±°±±±±°°°±°°°°°°±°°±°±°°±ÛÛ°°°Û
    Set LN_4= ÛÛÛ°°°±°±°°°±°±°°±°±°°±°ÛÛ±°°°±°°°±Û±°°°°±°°±±Û±°°±Û°±ÛÛÛ±Û°°ÛÛ±°ÛÛ±°°±°±°°°°°Û±°Û±Û±°°°°°°°±°°°±°ÛÛÛ°°°±ÛÛÛÛÛÛÛ±°°°°°Û
    Set LN_5= Û°°±±±±°±°°°±°±Û°±°±Û±°°°±°°±±±±±Û±±±±°±°°°±Û±±±°±±±±Û±±±±°°°°°±°°°±°Û±°±±±±°°±±±°Û±±±±°±±±±°±°°Û°°°°±±±±Û°°°°°Û
    Set LN_6= Û°°°°°°°°°Û°°°°Û°°°°°ÛÛÛ°°°ÛÛ°°°ÛÛÛÛ°°°°°°°°°°°°°°°°°°°°°°°ÛÛ°°ÛÛÛÛÛÛÛ°°°°°Û°Û°°ÛÛ°ÛÛÛÛ°°°°ÛÛÛÛÛ°ÛÛÛÛ°Û°°ÛÛÛ°°°°°°°°Û
    Set LN_7= Û°°°°ÛÛÛ°°Û°°°°°°°°Û°°°°°°°°°°°°°°°°°°°°°ÛÛÛ°°°ÛÛÛÛÛÛÛ°°°°°Û°°°°°°°°°°°°°°°°°ÛÛÛÛÛÛ°°°ÛÛ°°°°°°°°°°°°°°°°°°°°°°°°°°Û
    Set LN_8= ÛÛÛ°°Û°°°°°°°ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ°Û°ÛÛÛÛ°°ÛÛÛÛ°°°°°°°°°°Û°°°°°°°°°°Û°°°°°°ÛÛ°Û°Û°ÛÛÛÛ°°°°°°°°°°°°Û°°°°°°°Û°ÛÛÛÛÛÛÛÛÛÛ°°°°°°Û
    Set LN_9= Û°°°°°°°°°°°°°°°°°°°°°°°°Û°°Û°°°°°Û°°°ÛÛ°°°°°°°°°ÛÛÛ°Û°°°°°°°°°°°°°°°°°°°Û°°°ÛÛ°°°°°°°°Û°°°°°°°°°°°°Û
    Set LN_10= ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
    Goto :Eof
    
    :Nivel_2
    Set "CurPos=X2Y2"
    Set LN_0= ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
    Set LN_1= Û°°°°°°°Û°°°°°°°°°°°°°°°°°°°°°°°Û°°°°°°°°°Û
    Set LN_2= Û°°°°°°Û°°°°°ÛÛÛ°°Û°ÛÛÛÛÛÛÛÛÛÛ°°ÛÛ°°ÛÛÛÛÛ°°ÛÛÛÛ°° 
    Set LN_3= ÛÛÛ°°°°°°ÛÛÛ°°°°Û°°°°°°°°°Û°Û°Û°°°°°°°°°°°Û°°°Û
    Set LN_4= Û°°°°°°°°°°°°°ÛÛÛÛÛÛ°°°°°°°Û°°°°°°°ÛÛÛ°°ÛÛ°°Û°°ÛÛ
    Set LN_5= Û°°°°°ÛÛÛ°°°°°°°°°Û°ÛÛ°°Û°°Û°°°°°°°°°°°Û°°°Û
    Set LN_6= Û°Û°°°Û°°°°ÛÛÛ°°°°ÛÛÛÛÛÛÛÛÛÛ°°°°°°°°ÛÛÛÛÛÛÛÛ°°ÛÛÛ
    Set LN_7= ÛÛÛÛ°°°°°°°°°Û°°Û°°°°°Û°°°Û°ÛÛ°°°°°°Û°°ÛÛÛÛÛÛ
    Set LN_8= Û°°°°Û°°°ÛÛ°°Û°°Û°°°°ÛÛÛÛÛ°°°ÛÛ°Û°°ÛÛÛÛ°°ÛÛ°°°°°°°Û
    Set LN_9= Û°°Û°°°Û°Û°°°°°°°°°°°°°°°°°Û°°°°°°°°°°°°Û
    Set LN_10= ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
    Goto :Eof
    
    :NoKey
    Cls
    echo.
    echo. Cargando...
    call :Keyboard
    Goto :Eof
    
    :Keyboard
    (
    echo n keyboard.dat
    echo e 0000 4D 5A 2E 00 01 00 00 00 02 00 00 10 FF FF F0 FF
    echo e 0010 FE FF 00 00 00 01 F0 FF 1C 00 00 00 00 00 00 00
    echo e 0020 B4 08 CD 21 3C 00 75 02 CD 21 B4 4C CD 21
    echo rcx
    echo 002E
    echo w0
    echo q
    echo.
    )>keyboard.dat
    type keyboard.dat|debug>NUL 2>&1
    del /f/q/a "keyboard.exe">NUL 2>&1
    ren keyboard.dat "keyboard.exe"
    Goto :Eof

Discussions similaires

  1. [TP][Projet] Réaliser un Snake-Like
    Par Giovanny Temgoua dans le forum Turbo Pascal
    Réponses: 69
    Dernier message: 17/01/2005, 18h04
  2. Réponses: 5
    Dernier message: 01/10/2003, 15h03
  3. batch pour faire une sauvegarde
    Par bibiodp dans le forum Scripts/Batch
    Réponses: 4
    Dernier message: 13/08/2003, 13h09
  4. [JSP]Exécution d'un batch
    Par tsco_ops dans le forum Servlets/JSP
    Réponses: 2
    Dernier message: 17/07/2003, 14h58
  5. Verifier qu'un dossier existe (batch)
    Par kakou dans le forum Scripts/Batch
    Réponses: 2
    Dernier message: 08/01/2003, 13h46

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo