Batch-Satti
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Batch-Satti

Você não está conectado. Conecte-se ou registre-se

[Batch] Jogo Quebra Cabeça

Ir para baixo  Mensagem [Página 1 de 1]

1[Batch] Jogo Quebra Cabeça Empty [Batch] Jogo Quebra Cabeça Qua Ago 18, 2010 8:57 pm

NeoqJav

NeoqJav

[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]

Código:
@echo off
rem [url=http://paste.ubuntu.com/100661/][color=black]http://paste.ubuntu.com/100661/[/color][/url]
rem *********************************************
rem *** todos os direitos reservados a: *********
rem *** 1 carta aos corintios cap 1 ver 27 ao 29*
rem *********************************************
mode con cols=80 lines=22
cls
rem echo. *********************************************
rem echo. *** todos os direitos reservados a: *********
rem echo. *** 1 carta aos corintios cap 1 ver 27 ao 29*
rem echo. *********************************************
rem echo. 3
rem for /L %%i in (1,1,1000) do ( echo. > NULL )
color 0a
cls
echo. *********************************************
echo. *** todos os direitos reservados a: *********
echo. *** 1 carta aos corintios cap 1 ver 27 ao 29*
echo. *********************************************
echo. 2
for /L %%i in (1,1,1000) do ( echo. > NULL )
cls
echo. *********************************************
echo. *** todos os direitos reservados a: *********
echo. *** 1 carta aos corintios cap 1 ver 27 ao 29*
echo. *********************************************
echo. 1
for /L %%i in (1,1,1000) do ( echo. > NULL )
REM CRIA GETCH.COM ... PARA NAO PRECISAR DAR ENTER AO DIGITAR O NUM
if exist getch.com ( goto :pula )
echo. a 0100 > getch.dat
echo. XOR    AX,AX >> getch.dat
echo. INT    16 >> getch.dat
echo. MOV    AH,4C >> getch.dat
echo. INT    21 >> getch.dat
echo.  >> getch.dat
echo. r cx >> getch.dat
echo. 8 >> getch.dat
echo. n getch.com >> getch.dat
echo. w >> getch.dat
echo. q >> getch.dat
debug < getch.dat > NULL
:pula
color 0e
set r=%random%
set /a r=r%%5
REM echo. random =  %r%
if %r%==0 (
set a=8
set b=2
set c=X
set d=3
set e=6
set f=1
set g=7
set h=9
set i=4
set x=c
      )
if %r%==1 (
set a=2
set b=1
set c=3
set d=X
set e=9
set f=4
set g=8
set h=7
set i=6
set x=d
          )
if %r%==2 (
set a=9
set b=8
set c=7
set d=6
set e=X
set f=4
set g=3
set h=2
set i=1
set x=e
          )
if %r%==3 (
set a=9
set b=8
set c=4
set d=1
set e=X
set f=2
set g=6
set h=7
set i=3
set x=e
          )
if %r%==4 (
set a=4
set b=1
set c=2
set d=7
set e=6
set f=3
set g=8
set h=9
set i=X
set x=i
          )
echo. a= %a%
:game
cls
echo. ***************************************************************************
echo. *  objetivo: deixar esta figura igual a -------------------- esta daqui --*
echo. *      **** digite 0 para sair ****    // digite 5 para ajuda            *
echo. *                                                                        *
echo. *        -----------                                        -----------  *
echo. *      ! %a% ! %b% ! %c% !                                      ! 1 ! 2 ! 3 !  *
echo. *        --- --- ---                                        --- --- ---  *
echo. *      ! %d% ! %e% ! %f% !                                      ! 4 ! X ! 6 !  *
echo. *        --- --- ---                                        --- --- ---  *
echo. *      ! %g% ! %h% ! %i% !                                      ! 7 ! 8 ! 9 !  *
echo. *        --- --- ---                                        --- --- ---  *
echo. ***************************************************************************
goto :ganha
:cont
getch
set /a num=%errorlevel% - 48
rem echo. aqui0 %errorlevel% = %num% %x%
if %num%==5 (
echo. digite o numero que vc quer trocar de lugar com o X
echo. mas lembre-se: O X soh se movimenta uma casa, e apenas
echo. nas horizontais e verticais.
pause
goto :game
)
rem ****CASO A SEJE X****
if "%x%"=="a" (
if %b%==%num% (
set a=%b%
set b=X
set x=b
goto :game
              )
if %d%==%num% (
set a=%d%
set d=X
set x=d
goto :game
              )
              )
rem ****CASO B SEJE X****
if "%x%"=="b" (
if %a%==%num% (
set b=%a%
set a=X
set x=a
goto :game
              )
if %e%==%num% (
set b=%e%
set e=X
set x=e
goto :game
              )
if %c%==%num% (
set b=%c%
set c=X
set x=c
goto :game
              )
              )
rem ****CASO C SEJE X****
if "%x%"=="c" (
if %b%==%num% (
set c=%b%
set b=X
set x=b
goto :game
              )
if %f%==%num% (
set c=%f%
set f=X
set x=f
goto :game
              )
              )
rem ****CASO D SEJE X****
if "%x%"=="d" (
if %a%==%num% (
set d=%a%
set a=X
set x=a
goto :game
              )
if %e%==%num% (
set d=%e%
set e=X
set x=e
goto :game
              )
if %g%==%num% (
set d=%g%
set g=X
set x=g
goto :game
              )
              )
rem ****CASO e SEJE X****
if "%x%"=="e" (
if %b%==%num% (
set e=%b%
set b=X
set x=b
goto :game
              )
if %d%==%num% (
set e=%d%
set d=X
set x=d
goto :game
              )
if %f%==%num% (
set e=%f%
set f=X
set x=f
goto :game
              )
if %h%==%num% (
set e=%h%
set h=X
set x=h
goto :game
              )
              )
rem ****CASO f SEJE X****
if "%x%"=="f" (
if %c%==%num% (
set f=%c%
set c=X
set x=c
goto :game
              )
if %e%==%num% (
set f=%e%
set e=X
set x=e
goto :game
              )
if %i%==%num% (
set f=%i%
set i=X
set x=i
goto :game
              )
              )
rem ****CASO g SEJE X****
if "%x%"=="g" (
if %d%==%num% (
set g=%d%
set d=X
set x=d
goto :game
              )
if %h%==%num% (
set g=%h%
set h=X
set x=h
goto :game
              )
              )
rem ****CASO h SEJE X****
if "%x%"=="h" (
if %e%==%num% (
set h=%e%
set e=X
set x=e
goto :game
              )
if %g%==%num% (
set h=%g%
set g=X
set x=g
goto :game
              )
if %i%==%num% (
set h=%i%
set i=X
set x=i
goto :game
              )
              )
rem ****CASO i SEJE X****
if "%x%"=="i" (
if %f%==%num% (
set i=%f%
set f=X
set x=f
goto :game
              )
if %h%==%num% (
set i=%h%
set h=X
set x=h
goto :game
              )
              )
if %num%==0 goto :sai
goto :game
:ganha
REM **** VE SE GANHOU *****
if %a%==1 (
if %b%==2 (
if %c%==3 (
if %d%==4 (
if %e%==X (
if %f%==6 (
if %g%==7 (
if %h%==8 (
echo. *****************
echo. * parabens ******
echo. *****************
pause
goto :sai
          )
          )
          )
          )
          )
          )
          )
          )
goto :cont
:sai
cls
echo. Aprenda mais sobre Batch ou mostre o que sabe acessando
echo. [url=http://batch-satti.forumeiros.com]http://batch-satti.forumeiros.com[/url]
rem echo. *********************************************
rem echo. ****** A cada nova descoberta, maior a ******
rem echo. *** nossa definicao de tudo e mais proximo **
rem echo. *** do nada o nosso conhecimento significa **
rem echo. *********************************************
rem ping -n 2 172.0.0.1 > NULL


Quem abre a mente, reduz o mundo! ( NeoqJav )

http://neoqjav.dihitt.com.br

Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos