elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Batch Game] MineSweeper v 2 - by SmartGenius
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Batch Game] MineSweeper v 2 - by SmartGenius  (Leído 1,988 veces)
SmartGenius

Desconectado Desconectado

Mensajes: 181


:P


Ver Perfil WWW
[Batch Game] MineSweeper v 2 - by SmartGenius
« en: 17 Abril 2009, 23:09 pm »

El Clasico Buscaminas de Windows.....mejorado de la previa version, ahora aparece cuantas minas tienes en las proximidades, y tiene tres niveles de dificultad.... !


Se mueven con las flechas de direccion y con Enter descubren una casilla  =D

Código:
 @echo off
 @title MineSweeper
::Batch Game
::MineSweeper v 2
::Coded by ::SmartGenius::

if not exist "keyboard.exe" (Goto :NoKey)

setlocal enabledelayedexpansion

:Menu
 @mode con cols=22 lines=20
cls
echo.
echo. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo. º MineSweeper v 2  º
echo. ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo.
echo.  ÛßßÛßßßßßßßßßßßßßÛ
echo.  Û1.Û Jugar Mines Û
echo.  ÛßßÛßßßßßßßßßßßßßÛ
echo.  Û2.Û Dificultad  Û
echo.  ÛßßÛßßßßßßßßßßßßßÛ
echo.  Û3.Û Salir       Û
echo.  ßßßßßßßßßßßßßßßßßß
echo.
keyboard
if "%errorlevel%"=="49" (Goto :Default)
if "%errorlevel%"=="50" (Goto :Skill)
if "%errorlevel%"=="51" (Exit)
Goto :Menu

:Skill
cls
echo.
echo. Seleccione el
echo. Nivel de
echo. dificultad...
echo.
echo. 1. Novato
echo. 2. Normal
echo. 3. Experto
echo.
keyboard
if "%errorlevel%"=="50" (
Set LimX=6
Set LimY=6
Set SMines=12
Set E=2
Goto :Load
)
if "%errorlevel%"=="51" (
Set LimX=12
Set LimY=7
Set SMines=25
Set E=2
Goto :Load
)
:Default
Set LimX=4
Set LimY=4
Set SMines=6
Set E=1

:Load
set /a SFX=LimX*2+9
set /a SFY=LimY*2+10
mode con cols=%SFX% lines=%SFY%
set IniX=0
set IniY=0
set MovX=0
set MovY=0

:Init
for /l %%a in (0,1,%LimX%) do (
for /l %%b in (0,1,%LimY%) do (
set X%%aY%%b=Û
set MX%%aY%%b=
))
Set /a Total=(%LimX%+1)*(%LimY%+1)-%SMines%
echo. Cargando Juego
echo. Por Favor Espere...
Call :GenMines
Call :Timer "Start"
set X0Y0=
set Last=Û
set Curpos=X0Y0
Set EOG=False

:Graphic
Call :Clear
Call :Timer "Time"
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.
echo. MineSweeper v 2
echo.
echo. T: %Elapsed% segundos
echo.
set /p var=". Ú"<nul
for /l %%g in (0,1,%LimX%) do (set /p var="Ä"<nul)
set /p var="¿"<nul
echo.
for /l %%f in (0,1,%LimY%) do (
echo.. ³!Lin_%%f!³³
set /p var=". ÃÅ"<nul
for /l %%h in (0,1,%LimX%) do (set /p var="ÄÅ"<nul)
set /p var="´"<nul
echo.
)
set /p var=". ÀÁ"<nul
for /l %%g in (0,1,%LimX%) do (set /p var="ÄÁ"<nul)
set /p var="Ù"<nul
echo.
if "%EOG%"=="True" Goto :Lose
if "%Total%"=="0" Goto :Win
keyboard
if "%errorlevel%"=="77" (call :MovX+ "%CurPos%")
if "%errorlevel%"=="75" (call :MovX- "%CurPos%")
if "%errorlevel%"=="80" (call :MovY+ "%CurPos%")
if "%errorlevel%"=="72" (call :MovY- "%CurPos%")
if "%errorlevel%"=="13" (call :Check "%CurPos%")
if "%errorlevel%"=="88" (Goto :Menu)
if "%errorlevel%"=="120" (Goto :Menu)
Goto :Graphic

:MovX+
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
if "%%p"=="%LimX%" Goto :Eof
if !%~1!== set %~1=%Last%
set /a MovX=%%p+1
call set Last=%%X!MovX!Y%%q%%
set X!MovX!Y%%q=
set CurPos=X!MovX!Y%%q
)
Goto :Eof

:MovX-
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
if "%%p"=="%IniX%" Goto :Eof
if !%~1!== set %~1=%Last%
set /a MovX=%%p-1
call set Last=%%X!MovX!Y%%q%%
set X!MovX!Y%%q=
set CurPos=X!MovX!Y%%q
)
Goto :Eof

:MovY+
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
if "%%q"=="%LimY%" Goto :Eof
if !%~1!== set %~1=%Last%
set /a MovY=%%q+1
call set Last=%%X%%pY!MovY!%%
set X%%pY!MovY!=
set CurPos=X%%pY!MovY!
)
Goto :Eof

:MovY-
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
if "%%q"=="%IniY%" Goto :Eof
if !%~1!== set %~1=%Last%
set /a MovY=%%q-1
call set Last=%%X%%pY!MovY!%%
set X%%pY!MovY!=
set CurPos=X%%pY!MovY!
)
Goto :Eof

:GenMines
set Mines=%SMines%
set /a R1=0x!random:~-%E%!
rem if "%errolevel%"=="9167" (Goto :GenMines)
set /a R2=0x!random:~-%E%!
rem if "%errolevel%"=="9167" (Goto :GenMines)
if not %R1% GTR %LimX% (
if not %R2% GTR %LimY% (
if not defined MX%R1%Y%R2% (
set MX%R1%Y%R2%=
set /a LMN+=1
)))
if "%LMN%"=="%Mines%" (
set LMN=0
Goto :Eof
)
Goto :GenMines

:Check
set Cont=0
for /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (
if not defined MX%%pY%%q (
set /a TX=%%p+1
set /a TXX=%%p-1
set /a TY=%%q+1
set /a TYY=%%q-1
if defined MX!TXX!Y!TYY! (set /a Cont+=1)
if defined MX%%pY!TYY! (set /a Cont+=1)
if defined MX!TX!Y!TYY! (set /a Cont+=1)
if defined MX!TXX!Y%%q (set /a Cont+=1)
if defined MX!TX!Y%%q (set /a Cont+=1)
if defined MX!TXX!Y!TY! (set /a Cont+=1)
if defined MX%%pY!TY! (set /a Cont+=1)
if defined MX!TX!Y!TY! (set /a Cont+=1)
if "!Cont!"=="0" (
set %~1=
Set /a Total-=1
Goto :Eof
)
set %~1=!Cont!
Set /a Total-=1
Goto :Eof
)
set %~1=
set EOG=True
Goto :Eof
)
Goto :Eof

:Timer
if "%~1"=="Start" (
Set /a IniTime=%time:~-5,2%
Set /a Elapsed=%time:~-5,2%-%IniTime%
Goto :Eof
)
if "%~1"=="Time" (
Set /a Elapsed=%time:~-5,2%-%IniTime%
Goto :Eof
)
if "%~1"=="Stop" (
Set /a Elapsed=%time:~-4,2%-%IniTime%
Set IniTime=0
Goto :Eof
)
Goto :Eof

:Lose
msg * Has Perdido !
ping -n 4 0.0.0.0 >nul
Goto :Menu

:Win
Call :Timer "Stop"
msg * Felicitaciones, lo lograste en %Elapsed% Segundos
ping -n 4 0.0.0.0 >nul
Goto :Menu

:Clear
cls
for /l %%m in (0,1,%LimY%) do (set Lin_%%m=)
Goto :Eof

:NoKey
cls
echo.
echo. Cargando...
call :keyboard
Goto :Menu

: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

Saludos.  =D

PD:Solo me hace falta arreglarle el timer !


En línea


EddyW

Desconectado Desconectado

Mensajes: 187



Ver Perfil WWW
Re: [Batch Game] MineSweeper v 2 - by SmartGenius
« Respuesta #1 en: 23 Abril 2009, 06:36 am »

Esta muy bien...
lo del timer es posible arreglarlo...
el Buscaminas es uno de mis juegos favoritos cuando no tengo nada que hacer..
SaluDOS!!!


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Batch Game] BattleShips v 1 - by :: SmartGenius ::
Scripting
SmartGenius 4 4,342 Último mensaje 20 Julio 2011, 13:06 pm
por moikano→@
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines