Batch Games

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
BallisticX
Posts: 3
Joined: 24 Feb 2012 21:04

Batch Games

#1 Post by BallisticX » 24 Apr 2012 21:00

Share Some Batch Game Sripts With All Of Us!

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Batch Games

#2 Post by foxidrive » 25 Apr 2012 07:39

Here's a collection. Some are for MSdos and Win9x so check the headers before running them.

http://www.astronomy.comoj.com/games.zip

Cat
Posts: 32
Joined: 11 Nov 2011 12:04

Re: Batch Games

#3 Post by Cat » 25 Apr 2012 19:15

Coded this a LONG time ago. Horrible coding, but it's too big for me to really redo.

Code: Select all

@ECho off
:s
set a1=_&set a2=_&set a3=_&set a4=_&set b1=_&set b2=_&set b3=_&set b4=_&set c1=_&set c2=_&set c3=_&set c4=_
set d3=_&set d4=_&set e1=_&set e2=_&set e3=_&set e4=_&set f1=_&set f2=_&set f3=_&set f4=_&set d1=_&set d2=_
set moves=0&set AC=1&set BC=1&set CC=1&set DC=1&set FC=1&set EC=1
cls&call :board
:start
call :player
call :winlist
GOTO :computer
:AFTER
set /a moves= %moves% + 1
if %moves%==12 goto tie
GOTO START
:player
call :board&set /p P1="ENTER A LETTER:"
if /i %p1%%AC%==A1 set A1=X&Set /a AC= %AC%+1&EXIT /B
if /i %p1%%AC%==A2 set A2=X&Set /a AC= %AC%+1&EXIT /B
if /i %p1%%AC%==A3 set A3=X&Set /a AC= %AC%+1&EXIT /B
if /i %p1%%AC%==A4 set A4=X&Set /a AC= %AC%+1&EXIT /B
if /i %p1%%BC%==B1 set B1=X&set /a BC= %BC%+1&EXIT /B
if /i %p1%%BC%==B2 set B2=X&set /a BC= %BC%+1&EXIT /B
if /i %p1%%BC%==B3 set B3=X&set /a BC= %BC%+1&EXIT /B
if /i %p1%%BC%==B4 set B4=X&set /a BC= %BC%+1&EXIT /B
if /i %p1%%CC%==C1 set C1=X&set /a CC= %CC%+1&EXIT /B
if /i %p1%%CC%==C2 set C2=X&set /a CC= %CC%+1&EXIT /B
if /i %p1%%CC%==C3 set C3=X&set /a CC= %CC%+1&EXIT /B
if /i %p1%%CC%==C4 set C4=X&set /a CC= %CC%+1&EXIT /B
if /i %p1%%DC%==D1 set D1=X&set /a DC= %DC%+1&EXIT /B
if /i %p1%%DC%==D2 set D2=X&set /a DC= %DC%+1&EXIT /B
if /i %p1%%DC%==D3 set D3=X&set /a DC= %DC%+1&EXIT /B
if /i %p1%%DC%==D4 set D4=X&set /a DC= %DC%+1&EXIT /B
if /i %p1%%EC%==E1 set E1=X&set /a EC= %EC%+1&EXIT /B
if /i %p1%%EC%==E2 set E2=X&set /a EC= %EC%+1&EXIT /B
if /i %p1%%EC%==E3 set E3=X&set /a EC= %EC%+1&EXIT /B
if /i %p1%%EC%==E4 set E4=X&set /a EC= %EC%+1&EXIT /B
if /i %p1%%FC%==F1 set F1=X&set /a FC= %FC%+1&EXIT /B
if /i %p1%%FC%==F2 set F2=X&set /a FC= %FC%+1&EXIT /B
if /i %p1%%FC%==F3 set F3=X&set /a FC= %FC%+1&EXIT /B
if /i %p1%%FC%==F4 set F4=X&set /a FC= %FC%+1&EXIT /B
ECHO Invalid&timeout /t 1 /nobreak>nul&GOTO START
:COMPUTER
CALL :ATTACKER
CALL :DEFENDER
:RANDOMERROR
set /a N=%random% %% 6
IF %N%%AC%==05 GOTO RANDOMERROR
IF %N%%BC%==15 GOTO RANDOMERROR
IF %N%%CC%==25 GOTO RANDOMERROR
IF %N%%DC%==35 GOTO RANDOMERROR
IF %N%%EC%==45 GOTO RANDOMERROR
IF %N%%FC%==55 GOTO RANDOMERROR
IF %N%==0 SET A%AC%=O&SET /A AC= %AC%+1
IF %N%==1 SET B%BC%=O&SET /A BC= %BC%+1
IF %N%==2 SET C%CC%=O&SET /A CC= %CC%+1
IF %N%==3 SET D%DC%=O&SET /A DC= %DC%+1
IF %N%==4 SET E%EC%=O&SET /A EC= %EC%+1
IF %N%==5 SET F%FC%=O&SET /A FC= %FC%+1
call :board&GOTO AFTER
:lose
call :board&ECho Computer wins&ECho.&ECho Press any key to restart&pause>nul&goto s
:tie
call :board&ECho Tie&ECho.&ECho Press any key to restart&pause>nul&goto s
:win
call :board&EChO You Win&ECho.&ECho Press any key to restart&pause>nul&goto s
:board
cls&ECho.&ECho  _ _ _ _ _ _&ECho ^|%A4%^|%B4%^|%C4%^|%D4%^|%E4%^|%F4%^|
ECho ^|%A3%^|%B3%^|%C3%^|%D3%^|%E3%^|%F3%^|&ECho ^|%A2%^|%B2%^|%C2%^|%D2%^|%E2%^|%F2%^|
ECho ^|%A1%^|%B1%^|%C1%^|%D1%^|%E1%^|%F1%^|&ECho  A B C D E F&ECho.&exit /b
:defender
if %A1%%A2%%A3%%A4%==XXX_ set A4=O&set /a AC= %AC%+1& GOTO AFTER
if %A1%%A2%%A3%%A4%==XX_X set A3=O&set /a AC= %AC%+1& GOTO AFTER
if %A1%%A2%%A3%%A4%==X_XX set A2=O&set /a AC= %AC%+1& GOTO AFTER
if %A1%%A2%%A3%%A4%==_XXX set A1=O&set /a AC= %AC%+1& GOTO AFTER
if %B1%%B2%%B3%%B4%==XXX_ set B4=O&set /a BC= %BC%+1& GOTO AFTER
if %B1%%B2%%B3%%B4%==XX_X set B3=O&set /a BC= %BC%+1& GOTO AFTER
if %B1%%B2%%B3%%B4%==X_XX set B2=O&set /a BC= %BC%+1& GOTO AFTER
if %B1%%B2%%B3%%B4%==_XXX set B1=O&set /a BC= %BC%+1& GOTO AFTER
if %C1%%C2%%C3%%C4%==XXX_ set C4=O&set /a CC= %CC%+1& GOTO AFTER
if %C1%%C2%%C3%%C4%==XX_X set C3=O&set /a CC= %CC%+1& GOTO AFTER
if %C1%%C2%%C3%%C4%==X_XX set C2=O&set /a CC= %CC%+1& GOTO AFTER
if %C1%%C2%%C3%%C4%==_XXX set C1=O&set /a CC= %CC%+1& GOTO AFTER
if %D1%%D2%%D3%%D4%==XXX_ set D4=O&set /a DC= %DC%+1& GOTO AFTER
if %D1%%D2%%D3%%D4%==XX_X set D3=O&set /a DC= %DC%+1& GOTO AFTER
if %D1%%D2%%D3%%D4%==X_XX set D2=O&set /a DC= %DC%+1& GOTO AFTER
if %D1%%D2%%D3%%D4%==_XXX set D1=O&set /a DC= %DC%+1& GOTO AFTER
if %E1%%E2%%E3%%E4%==XXX_ set E4=O&set /a EC= %EC%+1& GOTO AFTER
if %E1%%E2%%E3%%E4%==XX_X set E3=O&set /a EC= %EC%+1& GOTO AFTER
if %E1%%E2%%E3%%E4%==X_XX set E2=O&set /a EC= %EC%+1& GOTO AFTER
if %E1%%E2%%E3%%E4%==_XXX set E1=O&set /a EC= %EC%+1& GOTO AFTER
if %F1%%F2%%F3%%F4%==XXX_ set F4=O&set /a FC= %FC%+1& GOTO AFTER
if %F1%%F2%%F3%%F4%==XX_X set F3=O&set /a FC= %FC%+1& GOTO AFTER
if %F1%%F2%%F3%%F4%==X_XX set F2=O&set /a FC= %FC%+1& GOTO AFTER
if %F1%%F2%%F3%%F4%==_XXX set F1=O&set /a FC= %FC%+1& GOTO AFTER
if %A4%%b4%%c4%%d4%==XXX_ if NOT %d3%==_ set d4=O&Set /a DC= %DC%+1& GOTO AFTER
if %A4%%b4%%c4%%d4%==XX_X if NOT %d3%==_ set c4=O&set /a CC= %CC%+1& GOTO AFTER
if %A4%%b4%%c4%%d4%==X_XX if NOT %d3%==_ set b4=O&set /a BC= %BC%+1& GOTO AFTER
if %A4%%b4%%c4%%d4%==_XXX if NOT %d3%==_ set A4=O&set /a AC= %AC%+1& GOTO AFTER
if %A3%%b3%%c3%%d3%==XXX_ if NOT %d2%==_ set d3=O&set /a DC= %DC%+1& GOTO AFTER
if %A3%%b3%%c3%%d3%==XX_X if NOT %c2%==_ set c3=O&set /a CC= %CC%+1& GOTO AFTER
if %A3%%b3%%c3%%d3%==X_XX if NOT %b2%==_ set b3=O&set /a BC= %BC%+1& GOTO AFTER
if %A3%%b3%%c3%%d3%==_XXX if NOT %a2%==_ set A3=O&set /a AC= %AC%+1& GOTO AFTER
if %A2%%b2%%c2%%d2%==XXX_ if NOT %d1%==_ set d2=O&set /a DC= %DC%+1& GOTO AFTER
if %A2%%b2%%c2%%d2%==XX_X if NOT %c1%==_ set c2=O&set /a CC= %CC%+1& GOTO AFTER
if %A2%%b2%%c2%%d2%==X_XX if NOT %b1%==_ set b2=O&set /a BC= %BC%+1& GOTO AFTER
if %A2%%b2%%c2%%d2%==_XXX if NOT %a1%==_ set A2=O&set /a AC= %AC%+1& GOTO AFTER
if %A1%%b1%%c1%%d1%==XXX_ set d1=O&set /a DC= %DC%+1& GOTO AFTER
if %A1%%b1%%c1%%d1%==XX_X set c1=O&set /a CC= %CC%+1& GOTO AFTER
if %A1%%b1%%c1%%d1%==X_XX set b1=O&set /a BC= %BC%+1& GOTO AFTER
if %A1%%b1%%c1%%d1%==_XXX set A1=O&set /a AC= %AC%+1& GOTO AFTER
if %b4%%c4%%d4%%e4%==XXX_ if NOT %e3%==_ set e3=O&set /a EC= %EC%+1& GOTO AFTER
if %b4%%c4%%d4%%e4%==XX_X if NOT %d3%==_ set d3=O&set /a DC= %DC%+1& GOTO AFTER
if %b4%%c4%%d4%%e4%==X_XX if NOT %c3%==_ set c3=O&set /a CC= %CC%+1& GOTO AFTER
if %b4%%c4%%d4%%e4%==_XXX if NOT %b3%==_ set b3=O&set /a BC= %BC%+1& GOTO AFTER
if %b3%%c3%%d3%%e3%==XXX_ if NOT %e2%==_ set e2=O&set /a EC= %EC%+1& GOTO AFTER
if %b3%%c3%%d3%%e3%==XX_X if NOT %d2%==_ set d2=O&set /a DC= %DC%+1& GOTO AFTER
if %b3%%c3%%d3%%e3%==X_XX if NOT %c2%==_ set c3=O&set /a CC= %CC%+1& GOTO AFTER
if %b3%%c3%%d3%%e3%==_XXX if NOT %b2%==_ set b3=O&set /a BC= %BC%+1& GOTO AFTER
if %b2%%c2%%d2%%e2%==XXX_ if NOT %e1%==_ set e2=O&set /a EC= %EC%+1& GOTO AFTER
if %b2%%c2%%d2%%e2%==XX_X if NOT %d1%==_ set d2=O&set /a DC= %DC%+1& GOTO AFTER
if %b2%%c2%%d2%%e2%==X_XX if NOT %c1%==_ set c2=O&set /a CC= %CC%+1& GOTO AFTER
if %b2%%c2%%d2%%e2%==_XXX if NOT %b1%==_ set b2=O&set /a BC= %BC%+1& GOTO AFTER
if %b1%%c1%%d1%%e1%==XXX_ set e1=O&set /a EC= %EC%+1& GOTO AFTER
if %b1%%c1%%d1%%e1%==XX_X set d1=O&set /a DC= %DC%+1& GOTO AFTER
if %b1%%c1%%d1%%e1%==X_XX set c1=O&set /a CC= %CC%+1& GOTO AFTER
if %b1%%c1%%d1%%e1%==_XXX set b1=O&set /a BC= %BC%+1& GOTO AFTER
if %c4%%d4%%e4%%f4%==XXX_ if NOT %f3%==_ set F4=O&set /a FC= %FC%+1& GOTO AFTER
if %c4%%d4%%e4%%f4%==XX_X if NOT %e3%==_ set E4=O&set /a EC= %EC%+1& GOTO AFTER
if %c4%%d4%%e4%%f4%==X_XX if NOT %d3%==_ set D4=O&set /a DC= %DC%+1& GOTO AFTER
if %c4%%d4%%e4%%f4%==_XXX if NOT %c3%==_ set C4=O&set /a CC= %CC%+1& GOTO AFTER
if %c3%%d3%%e3%%f3%==XXX_ if NOT %f2%==_ set F3=O&set /a FC= %FC%+1& GOTO AFTER
if %c3%%d3%%e3%%f3%==XX_X if NOT %e2%==_ set E3=O&set /a EC= %EC%+1& GOTO AFTER
if %c3%%d3%%e3%%f3%==X_XX if NOT %d2%==_ set D3=O&set /a DC= %DC%+1& GOTO AFTER
if %c3%%d3%%e3%%f3%==_XXX if NOT %c2%==_ set C3=O&set /a CC= %CC%+1& GOTO AFTER
if %c2%%d2%%e2%%f2%==XXX_ if NOT %f1%==_ set F2=O&set /a FC= %FC%+1& GOTO AFTER
if %c2%%d2%%e2%%f2%==XX_X if NOT %e1%==_ set E2=O&set /a EC= %EC%+1& GOTO AFTER
if %c2%%d2%%e2%%f2%==X_XX if NOT %d1%==_ set D2=O&set /a DC= %DC%+1& GOTO AFTER
if %c2%%d2%%e2%%f2%==_XXX if NOT %c1%==_ set C2=O&set /a CC= %CC%+1& GOTO AFTER
if %c1%%d1%%e1%%f1%==XXX_ set F1=O&set /a FC= %FC%+1& GOTO AFTER
if %c1%%d1%%e1%%f1%==XX_X set E1=O&set /a EC= %EC%+1& GOTO AFTER
if %c1%%d1%%e1%%f1%==X_XX set D1=O&set /a DC= %DC%+1& GOTO AFTER
if %c1%%d1%%e1%%f1%==_XXX set C1=O&set /a CC= %CC%+1& GOTO AFTER
if %a1%%b2%%c3%%d4%==XXX_ if NOT %d4%==_ set d4=O&set /a DC= %DC%+ 1& GOTO AFTER
if %a1%%b2%%c3%%d4%==XX_X if NOT %c3%==_ set C3=O&set /a CC= %CC%+ 1& GOTO AFTER
if %a1%%b2%%c3%%d4%==X_XX if NOT %b2%==_ set B2=O&set /a BC= %BC%+ 1& GOTO AFTER
if %a1%%b2%%c3%%d4%==_XXX set A1=O&set /a AC= %AC%+1& GOTO AFTER
if %a4%%b3%%c2%%d1%==XXX_ set D1=O&set /a DC= %DC%+1& GOTO AFTER
if %a4%%b3%%c2%%d1%==XX_X if NOT %c1%==_ set C2=O&set /a CC= %CC%+1& GOTO AFTER
if %a4%%b3%%c2%%d1%==X_XX if NOT %b2%==_ set B3=O&set /a BC= %BC%+1& GOTO AFTER
if %a4%%b3%%c2%%d1%==_XXX if NOT %a3%==_ set A4=O&set /a AC= %AC%+1& GOTO AFTER
if %b1%%C2%%D3%%E4%==XXX_ if NOT %e3%==_ set E4=O&set /a EC= %EC%+1& GOTO AFTER
if %b1%%C2%%D3%%E4%==XX_X if NOT %d2%==_ set D3=O&set /a DC= %DC%+1& GOTO AFTER
if %b1%%C2%%D3%%E4%==X_XX if NOT %c1%==_ set C2=O&set /a CC= %CC%+1& GOTO AFTER
if %b1%%C2%%D3%%E4%==_XXX set B1=O&set /a BC= %BC%+1& GOTO AFTER
if %b4%%C3%%D2%%E1%==XXX_ set E1=O&set /a EC= %EC%+1& GOTO AFTER
if %b4%%C3%%D2%%E1%==XX_X if NOT %d1%==_ set D2=O&set /a DC= %DC%+1& GOTO AFTER
if %b4%%C3%%D2%%E1%==X_XX if NOT %c2%==_ set C3=O&set /a CC= %CC%+1& GOTO AFTER
if %b4%%C3%%D2%%E1%==_XXX if NOT %b3%==_ set B4=O&set /a BC= %BC%+1& GOTO AFTER
if %c1%%d2%%e3%%f4%==XXX_ if NOT %f3%==_ set F4=O&set /a FC= %FC%+1& GOTO AFTER
if %c1%%d2%%e3%%f4%==XX_X if NOT %e2%==_ set E3=O&set /a EC= %EC%+1& GOTO AFTER
if %c1%%d2%%e3%%f4%==X_XX if NOT %d1%==_ set D2=O&set /a DC= %DC%+1& GOTO AFTER
if %c1%%d2%%e3%%f4%==_XXX set C1=O&set /a CC= %CC%+1& GOTO AFTER
if %c4%%d3%%e2%%f1%==XXX_ set F1=O&set /a FC= %FC%+1& GOTO AFTER
if %c4%%d3%%e2%%f1%==XX_X if NOT %e1%==_ set E2=O&set /a EC= %EC%+1& GOTO AFTER
if %c4%%d3%%e2%%f1%==X_XX if NOT %d2%==_ set D3=O&set /a DC= %DC%+1& GOTO AFTER
if %c4%%d3%%e2%%f1%==_XXX if NOT %c3%==_ set C4=O&set /a CC= %CC%+1& GOTO AFTER
exit /b
:attACker
if %A1%%A2%%A3%%A4%==OOO_ if NOT %A3%==_ set A4=O& goto lose
if %A1%%A2%%A3%%A4%==OO_O if NOT %A2%==_ set A3=O& goto lose
if %A1%%A2%%A3%%A4%==O_OO if NOT %A1%==_ set A2=O& goto lose
if %A1%%A2%%A3%%A4%==_OOO set A1=O& goto lose
if %B1%%B2%%B3%%B4%==OOO_ if NOT %B3%==_ set B4=O& goto lose
if %B1%%B2%%B3%%B4%==OO_O if NOT %B2%==_ set B3=O& goto lose
if %B1%%B2%%B3%%B4%==O_OO if NOT %B1%==_ set B2=O& goto lose
if %B1%%B2%%B3%%B4%==_OOO set B1=O& goto lose
if %C1%%C2%%C3%%C4%==OOO_ if NOT %c3%==_ set C4=O& goto lose
if %C1%%C2%%C3%%C4%==OO_O if NOT %c2%==_ set C3=O& goto lose
if %C1%%C2%%C3%%C4%==O_OO if NOT %c1%==_ set C2=O& goto lose
if %C1%%C2%%C3%%C4%==_OOO set C1=O& goto lose
if %D1%%D2%%D3%%D4%==OOO_ if NOT %d3%==_ set D4=O& goto lose
if %D1%%D2%%D3%%D4%==OO_O if NOT %d2%==_ set D3=O& goto lose
if %D1%%D2%%D3%%D4%==O_OO if NOT %d1%==_ set D2=O& goto lose
if %D1%%D2%%D3%%D4%==_OOO set D1=O& goto lose
if %E1%%E2%%E3%%E4%==OOO_ if NOT %e3%==_ set E4=O& goto lose
if %E1%%E2%%E3%%E4%==OO_O if NOT %e2%==_ set E3=O& goto lose
if %E1%%E2%%E3%%E4%==O_OO if NOT %d1%==_ set E2=O& goto lose
if %E1%%E2%%E3%%E4%==_OOO  set E1=O& goto lose
if %F1%%F2%%F3%%F4%==OOO_ if NOT %f3%==_ set F4=O& goto lose
if %F1%%F2%%F3%%F4%==OO_O if NOT %f2%==_ set F3=O& goto lose
if %F1%%F2%%F3%%F4%==O_OO if NOT %f1%==_ set F2=O& goto lose
if %F1%%F2%%F3%%F4%==_OOO set F1=O& goto lose
if %A4%%b4%%c4%%d4%==OOO_ if NOT %d3%==_ set d4=O& goto lose
if %A4%%b4%%c4%%d4%==OO_O if NOT %c3%==_ set c4=O& goto lose
if %A4%%b4%%c4%%d4%==O_OO if NOT %b3%==_ set b4=O& goto lose
if %A4%%b4%%c4%%d4%==_OOO if NOT %a3%==_ set A4=O& goto lose
if %A3%%b3%%c3%%d3%==OOO_ if NOT %d2%==_ set d3=O& goto lose
if %A3%%b3%%c3%%d3%==OO_O if NOT %c2%==_ set c3=O& goto lose
if %A3%%b3%%c3%%d3%==O_OO if NOT %b2%==_ set b3=O& goto lose
if %A3%%b3%%c3%%d3%==_OOO if NOT %a2%==_ set A3=O& goto lose
if %A2%%b2%%c2%%d2%==OOO_ if NOT %d1%==_ set d2=O& goto lose
if %A2%%b2%%c2%%d2%==OO_O if NOT %c1%==_ set c2=O& goto lose
if %A2%%b2%%c2%%d2%==O_OO if NOT %b1%==_ set b2=O& goto lose
if %A2%%b2%%c2%%d2%==_OOO if NOT %a1%==_ set A2=O& goto lose
if %A1%%b1%%c1%%d1%==OOO_ set d1=O& goto lose
if %A1%%b1%%c1%%d1%==OO_O set c1=O& goto lose
if %A1%%b1%%c1%%d1%==O_OO set b1=O& goto lose
if %A1%%b1%%c1%%d1%==_OOO set A1=O& goto lose
if %b4%%c4%%d4%%e4%==OOO_ if NOT %e3%==_ set e4=O& goto lose
if %b4%%c4%%d4%%e4%==OO_O if NOT %d3%==_ set d4=O& goto lose
if %b4%%c4%%d4%%e4%==O_OO if NOT %c3%==_ set c4=O& goto lose
if %b4%%c4%%d4%%e4%==_OOO if NOT %b3%==_ set b4=O& goto lose
if %b3%%c3%%d3%%e3%==OOO_ if NOT %e2%==_ set e3=O& goto lose
if %b3%%c3%%d3%%e3%==OO_O if NOT %d2%==_ set d3=O& goto lose
if %b3%%c3%%d3%%e3%==O_OO if NOT %c2%==_ set c3=O& goto lose
if %b3%%c3%%d3%%e3%==_OOO if NOT %b2%==_ set b3=O& goto lose
if %b2%%c2%%d2%%e2%==OOO_ if NOT %e1%==_ set e2=O& goto lose
if %b2%%c2%%d2%%e2%==OO_O if NOT %d1%==_ set d2=O& goto lose
if %b2%%c2%%d2%%e2%==O_OO if NOT %c1%==_ set c2=O& goto lose
if %b2%%c2%%d2%%e2%==_OOO if NOT %b1%==_ set b2=O& goto lose
if %b1%%c1%%d1%%e1%==OOO_ set e1=O& goto lose
if %b1%%c1%%d1%%e1%==OO_O set d1=O& goto lose
if %b1%%c1%%d1%%e1%==O_OO set c1=O& goto lose
if %b1%%c1%%d1%%e1%==_OOO set b1=O& goto lose
if %c4%%d4%%e4%%f4%==OOO_ if NOT %f3%==_ set F4=O& goto lose
if %c4%%d4%%e4%%f4%==OO_O if NOT %e3%==_ set E4=O& goto lose
if %c4%%d4%%e4%%f4%==O_OO if NOT %d3%==_ set D4=O& goto lose
if %c4%%d4%%e4%%f4%==_OOO if NOT %c3%==_ set C4=O& goto lose
if %c3%%d3%%e3%%f3%==OOO_ if NOT %f2%==_ set F3=O& goto lose
if %c3%%d3%%e3%%f3%==OO_O if NOT %e2%==_ set E3=O& goto lose
if %c3%%d3%%e3%%f3%==O_OO if NOT %d2%==_ set D3=O& goto lose
if %c3%%d3%%e3%%f3%==_OOO if NOT %c2%==_ set C3=O& goto lose
if %c2%%d2%%e2%%f2%==OOO_ if NOT %f1%==_ set F2=O& goto lose
if %c2%%d2%%e2%%f2%==OO_O if NOT %e1%==_ set E2=O& goto lose
if %c2%%d2%%e2%%f2%==O_OO if NOT %d1%==_ set D2=O& goto lose
if %c2%%d2%%e2%%f2%==_OOO if NOT %c1%==_ set C2=O& goto lose
if %c1%%d1%%e1%%f1%==OOO_ set F1=O& goto lose
if %c1%%d1%%e1%%f1%==OO_O set E1=O& goto lose
if %c1%%d1%%e1%%f1%==O_OO set D1=O& goto lose
if %c1%%d1%%e1%%f1%==_OOO set C1=O& goto lose
if %a1%%b2%%c3%%d4%==OOO_ if NOT %d3%==_ set d4=O& goto lose
if %a1%%b2%%c3%%d4%==OO_O if NOT %c2%==_ set C3=O& goto lose
if %a1%%b2%%c3%%d4%==O_OO if NOT %b1%==_ set B2=O& goto lose
if %a1%%b2%%c3%%d4%==_OOO set A1=O& goto lose
if %a4%%b3%%c2%%d1%==OOO_ set D1=O& goto lose
if %a4%%b3%%c2%%d1%==OO_O if NOT %c1%==_ set C2=O& goto lose
if %a4%%b3%%c2%%d1%==O_OO if NOT %b2%==_ set B3=O& goto lose
if %a4%%b3%%c2%%d1%==_OOO if NOT %a3%==_ set A4=O& goto lose
if %b1%%C2%%D3%%E4%==OOO_ if NOT %e3%==_ set E4=O& goto lose
if %b1%%C2%%D3%%E4%==OO_O if NOT %d2%==_ set D3=O& goto lose
if %b1%%C2%%D3%%E4%==O_OO if NOT %c1%==_ set C2=O& goto lose
if %b1%%C2%%D3%%E4%==_OOO set B1=O& goto lose
if %b4%%C3%%D2%%E1%==OOO_ set E1=O& goto lose
if %b4%%C3%%D2%%E1%==OO_O if NOT %d1%==_ set D2=O& goto lose
if %b4%%C3%%D2%%E1%==O_OO if NOT %c2%==_ set C3=O& goto lose
if %b4%%C3%%D2%%E1%==_OOO if NOT %b3%==_ set B4=O& goto lose
if %c1%%d2%%e3%%f4%==OOO_ if NOT %f3%==_ set F4=O& goto lose
if %c1%%d2%%e3%%f4%==OO_O if NOT %e3%==_ set E3=O& goto lose
if %c1%%d2%%e3%%f4%==O_OO if NOT %d1%==_ set D2=O& goto lose
if %c1%%d2%%e3%%f4%==_OOO set C1=O& goto lose
if %c4%%d3%%e2%%f1%==OOO_ set F1=O& goto lose
if %c4%%d3%%e2%%f1%==OO_O if NOT %e1%==_ set E2=O& goto lose
if %c4%%d3%%e2%%f1%==O_OO if NOT %d2%==_ set D3=O& goto lose
if %c4%%d3%%e2%%f1%==_OOO if NOT %c3%==_ set C4=O& goto lose
exit /b
:winlist
call :board
if %A1%%A2%%A3%%A4%==XXXX GOTO WIN
if %B1%%B2%%B3%%B4%==XXXX GOTO WIN
if %C1%%C2%%C3%%C4%==XXXX GOTO WIN
if %D1%%D2%%D3%%D4%==XXXX GOTO WIN
if %E1%%E2%%E3%%E4%==XXXX GOTO WIN
if %F1%%F2%%F3%%F4%==XXXX GOTO WIN
if %A4%%B4%%C4%%D4%==XXXX GOTO WIN
if %A3%%B3%%C3%%D3%==XXXX GOTO WIN
if %A2%%B2%%C2%%D2%==XXXX GOTO WIN
if %A1%%B1%%C1%%D1%==XXXX GOTO WIN
if %B4%%C4%%D4%%E4%==XXXX GOTO WIN
if %B3%%C3%%D3%%E3%==XXXX GOTO WIN
if %B2%%C2%%D2%%E2%==XXXX GOTO WIN
if %B1%%C1%%D1%%E1%==XXXX GOTO WIN
if %C4%%D4%%E4%%F4%==XXXX GOTO WIN
if %C3%%D3%%E3%%F3%==XXXX GOTO WIN
if %C2%%D2%%E2%%F2%==XXXX GOTO WIN
if %C1%%D1%%F1%%E1%==XXXX GOTO WIN
if %A1%%B2%%C3%%D4%==XXXX GOTO WIN
if %A4%%B3%%C2%%D1%==XXXX GOTO WIN
if %B1%%C2%%D3%%E4%==XXXX GOTO WIN
if %B4%%C3%%D2%%E1%==XXXX GOTO WIN
if %C1%%D2%%E3%%F4%==XXXX GOTO WIN
if %C4%%D3%%E2%%F1%==XXXX GOTO WIN
EXIT /B

MrKnowItAllxx
Posts: 43
Joined: 20 Mar 2012 20:53

Re: Batch Games

#4 Post by MrKnowItAllxx » 26 Apr 2012 18:09

I made this game a while ago, and it's not finished, but I would be curious to see if it could run on other people's computers
There are quite a few files and a few external executables (taken from a site called lingubender.com which is no longer online)

Anyway most info is in instructions.txt, but to start the game, run maximize.bat, and if you want to create your own maps follow the examples in the other maps "Data\maps" folder

Note the editor isn't really even close to done (I don't think you can save or change map options in it)

http://uploading.com/files/627fb563/Maze%2BGame.zip/ I apologize it is a wait to download site

Anastasia
Posts: 1
Joined: 08 May 2012 23:24
Contact:

Re: Batch Games

#5 Post by Anastasia » 08 May 2012 23:29

thank you for share it .i will try when i have time

SmartGenius
Posts: 2
Joined: 17 May 2012 00:15

Re: Batch Games

#6 Post by SmartGenius » 17 May 2012 00:24

I'm interested in this topic, you can search "my nickname + batch + games" and found a lot of games coded by me in batch script a few years ago, i will be posting them here for you to enjoy it ;)

Greets :D

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Batch Games

#7 Post by aGerman » 18 May 2012 08:44

The only game I ever wrote (normally I'm not interested in games):

Code: Select all

@echo off&setlocal&color 0c&mode con cols=65 lines=30
chcp 437>nul
title YAHTZEE
for /f %%i in ('"prompt $H&echo on&for %%j in (1) do rem"') do set "BS=%%i"
:again
cls
for /l %%i in (0,1,9) do echo.
echo                     '''''''''''''''''''
echo     ,-.            ''                 ''    ,-.           ,-.
echo    / \_\    ,-.   ''  YAHTZEE In Batch ''  / \_\   ,-.   / \_\
echo    \ / /   / \_\  ''                   ''  \ / /  / \_\  \ / /
echo     `-'    \ / /  ''      aGerman      ''   `-'   \ / /   `-'
echo             `-'    ''                 ''           `-'
echo                     '''''''''''''''''''
for /l %%i in (0,1,8) do echo.
set /p "name=%BS% Enter your name: "
if not defined name goto again
set "top=ÚÄÄÄÄÄÄÄÄÄ¿"
set "bottom=ÀÄÄÄÄÄÄÄÄÄÙ"
for %%a in ("[1,1]" "[1,2]" "[1,4]" "[1,5]" "[2,1]" "[2,3]" "[2,5]" "[3,2]" "[3,4]" "[4,1]" "[4,3]" "[4,5]" "[5,2]" "[5,4]" "[6,2]" "[6,4]") do (
  set "%%~a=³         ³"
)
for %%a in ("[1,3]" "[3,3]" "[5,3]") do set "%%~a=³    @    ³"
for %%a in ("[4,2]" "[4,4]" "[6,1]" "[6,3]" "[6,5]") do set "%%~a=³  @   @  ³"
for %%a in ("[5,1]" "[5,5]") do set "%%~a=³ @     @ ³"
set "[2,2]=³     @   ³"
set "[2,4]=³   @     ³"
set "[3,1]=³ @       ³"
set "[3,5]=³       @ ³"
set "rolls=0"
for /l %%i in (1,1,13) do set "roll%%i= "
for /l %%i in (1,1,13) do set "score%%i=0"
color f1&mode con cols=65 lines=50
:start
set /a rolls+=1
set "iteration=0"
set "fixed="
for /l %%i in (1,1,5) do set "fixed%%i="
for /l %%i in (1,1,5) do set "safe%%i=    "
for /l %%i in (1,1,5) do set "fix%%i=0"
call :calccard
:loop
if %iteration%==3 (
  pause>nul|set /p "=%BS% Register ... "
  goto register
)
set /a iteration+=1
for /l %%i in (0,1,2) do (
  call :displaycard
  call :process
)
if %iteration%==3 (
  pause>nul|set /p "=%BS% Register ... "
  goto register
) else (
  call :fix
  goto loop
)
:register
setlocal enabledelayedexpansion
for /l %%i in (1,1,5) do (
  for /l %%j in (1,1,5) do (
    if !d%%i! lss !d%%j! (
      set "temp=!d%%i!"
      set "d%%i=!d%%j!"
      set "d%%j=!temp!"
    )
  )
)
endlocal&set "d1=%d1%"&set "d2=%d2%"&set "d3=%d3%"&set "d4=%d4%"&set "d5=%d5%"
:loop2
call :calccard
call :displaycard
echo.
echo   Your roll was: %d1%, %d2%, %d3%, %d4%, %d5%
echo.
set "choice="
set "var1="
set "var2="
set /p "choice=%BS% Enter the category number: "
if "%choice%"=="1" (
  set "var1=roll1"
  set "var2=score1"
  call :test1
  goto forward
)
if "%choice%"=="2" (
  set "var1=roll2"
  set "var2=score2"
  call :test2
  goto forward
)
if "%choice%"=="3" (
  set "var1=roll3"
  set "var2=score3"
  call :test3
  goto forward
)
if "%choice%"=="4" (
  set "var1=roll4"
  set "var2=score4"
  call :test4
  goto forward
)
if "%choice%"=="5" (
  set "var1=roll5"
  set "var2=score5"
  call :test5
  goto forward
)
if "%choice%"=="6" (
  set "var1=roll6"
  set "var2=score6"
  call :test6
  goto forward
)
if "%choice%"=="7" (
  set "var1=roll7"
  set "var2=score7"
  call :testThreeOAK
  goto forward
)
if "%choice%"=="8" (
  set "var1=roll8"
  set "var2=score8"
  call :testFourOAK
  goto forward
)
if "%choice%"=="9" (
  set "var1=roll9"
  set "var2=score9"
  call :testFullHouse
  goto forward
)
if "%choice%"=="10" (
  set "var1=roll10"
  set "var2=score10"
  call :testSStraight
  goto forward
)
if "%choice%"=="11" (
  set "var1=roll11"
  set "var2=score11"
  call :testLStraight
  goto forward
)
if "%choice%"=="12" (
  set "var1=roll12"
  set "var2=score12"
  call :testYahtzee
  goto forward
)
if "%choice%"=="13" (
  set "var1=roll13"
  set "var2=score13"
  call :testChance
  goto forward
)
goto :loop2
:forward
set "choice="
if %return%==F (
  set /p "=%BS% This category is disabled. "
  goto loop2
)
if %return%==0 (
  echo  You'll get no score points!
  set /p "choice=%BS% Are you really sure? (y/n) "
) else (
  set "choice=y"
)
if /i "%choice%"=="y" (
  set "%var1%=%d1%, %d2%, %d3%, %d4%, %d5%"
  set "%var2%=%return%"
  call :calccard
  call :displaycard
) else (
  goto :loop2
)
pause>nul|set /p "=%BS% Continue ... "
if %rolls% lss 13 goto start
set "xtime=%time::=.%"
>>"%~0" echo *:%grandtotal%:%date% %xtime:~,5%:%name%
echo.
echo   Final Score: %grandtotal%
echo.
pause>nul|set /p "=%BS% Display Ranking ... "
cls&color 4e
for /f "delims=: tokens=1,3,4*" %%a in ('findstr /b /l /c:"*:" "%~0"^|findstr /n .') do (
  set "LScore%%a=%%b"
  set "LTime%%a=%%c"
  set "LName%%a=%%d"
  set /a n=%%a
)
setlocal enabledelayedexpansion
for /l %%i in (1,1,%n%) do (
  for /l %%j in (1,1,%n%) do (
    if !LScore%%i! gtr !LScore%%j! (
      set "tScore=!LScore%%i!"
      set "LScore%%i=!LScore%%j!"
      set "LScore%%j=!tScore!"
      set "tTime=!LTime%%i!"
      set "LTime%%i=!LTime%%j!"
      set "LTime%%j=!tTime!"
      set "tName=!LName%%i!"
      set "LName%%i=!LName%%j!"
      set "LName%%j=!tName!"
    )
  )
)
(
  @echo off
  echo Ranking List
  echo ÍÍÍÍÍÍÍÍÍÍÍÍ
  echo.
  echo  Place   Score      Date / Time        Name
  echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  for /l %%a in (1,1,%n%) do (
    set "no=     %%a"
    call set "no=%%no:~-6%%"
    call set "LScore%%a=     %%LScore%%a%%"
    call set "LScore%%a=%%LScore%%a:~-6%%"
    call set "LTime%%a=         %%LTime%%a%%"
    call set "LTime%%a=%%LTime%%a:~-20%%"
    call echo %%no%%. %%LScore%%a%% %%LTime%%a%%    %%LName%%a%%
  )
)|more
endlocal
echo.
pause>nul|set /p "=%BS%   QUIT YAHTZEE ... "
goto :eof
:: ***************************** end of main **********************************

:process
if %fix1%==0 set /a d1=(%random%)%%6+1
if %fix2%==0 set /a d2=(%random%)%%6+1
if %fix3%==0 set /a d3=(%random%)%%6+1
if %fix4%==0 set /a d4=(%random%)%%6+1
if %fix5%==0 set /a d5=(%random%)%%6+1
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo  ROLL %iteration%
echo.
echo     Dice 1       Dice 2       Dice 3       Dice 4       Dice 5
echo.     %safe1%         %safe2%         %safe3%         %safe4%         %safe5%
echo  %top%  %top%  %top%  %top%  %top%
for /l %%i in (1,1,5) do call echo  %%[%d1%,%%i]%%  %%[%d2%,%%i]%%  %%[%d3%,%%i]%%  %%[%d4%,%%i]%%  %%[%d5%,%%i]%%
echo  %bottom%  %bottom%  %bottom%  %bottom%  %bottom%
echo.
goto :eof

:calccard
set /a subtotal=%score1%+%score2%+%score3%+%score4%+%score5%+%score6%
if %subtotal% lss 63 (set "bonus=0") else set "bonus=35"
set /a total1=%subtotal%+%bonus%
set /a total2=%score7%+%score8%+%score9%+%score10%+%score11%+%score12%+%score13%
set /a grandtotal=%total1%+%total2%
call :addspaces "%name%" 40 r StrName
call :addspaces "%roll1%" 13 r StrRoll1
call :addspaces "%score1%" 6 l StrScore1
call :addspaces "%roll2%" 13 r StrRoll2
call :addspaces "%score2%" 6 l StrScore2
call :addspaces "%roll3%" 13 r StrRoll3
call :addspaces "%score3%" 6 l StrScore3
call :addspaces "%roll4%" 13 r StrRoll4
call :addspaces "%score4%" 6 l StrScore4
call :addspaces "%roll5%" 13 r StrRoll5
call :addspaces "%score5%" 6 l StrScore5
call :addspaces "%roll6%" 13 r StrRoll6
call :addspaces "%score6%" 6 l StrScore6
call :addspaces "%roll7%" 13 r StrRoll7
call :addspaces "%score7%" 6 l StrScore7
call :addspaces "%roll8%" 13 r StrRoll8
call :addspaces "%score8%" 6 l StrScore8
call :addspaces "%roll9%" 13 r StrRoll9
call :addspaces "%score9%" 6 l StrScore9
call :addspaces "%roll10%" 13 r StrRoll10
call :addspaces "%score10%" 6 l StrScore10
call :addspaces "%roll11%" 13 r StrRoll11
call :addspaces "%score11%" 6 l StrScore11
call :addspaces "%roll12%" 13 r StrRoll12
call :addspaces "%score12%" 6 l StrScore12
call :addspaces "%roll13%" 13 r StrRoll13
call :addspaces "%score13%" 6 l StrScore13
call :addspaces "%subtotal%" 6 l StrSubtotal
call :addspaces "%bonus%" 6 l StrBonus
call :addspaces "%total1%" 6 l StrTotal1
call :addspaces "%total2%" 6 l StrTotal2
call :addspaces "%grandtotal%" 6 l StrGrandtotal
goto :eof

:displaycard
cls
echo  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo  ³Name: %StrName% ³
echo  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
echo  ÃÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ´
echo  ³ No.³ Category:       ³ Roll:         ³ Score: ³
echo  ÃÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄ´
echo  ³  1 ³           Ones: ³ %StrRoll1% ³ %StrScore1% ³
echo  ³  2 ³           Twos: ³ %StrRoll2% ³ %StrScore2% ³
echo  ³  3 ³         Threes: ³ %StrRoll3% ³ %StrScore3% ³
echo  ³  4 ³          Fours: ³ %StrRoll4% ³ %StrScore4% ³
echo  ³  5 ³          Fives: ³ %StrRoll5% ³ %StrScore5% ³
echo  ³  6 ³          Sixes: ³ %StrRoll6% ³ %StrScore6% ³
echo  ÃÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄ´
echo  ³ -------------------------- SUBTOTAL: ³ %StrSubtotal% ³
echo  ³ ----------------------------- BONUS: ³ %StrBonus% ³
echo  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄ´
echo  ³ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ TOTAL 1: ³ %StrTotal1% ³
echo  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄ´
echo  ÃÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ´
echo  ³  7 ³    3 Of A Kind: ³ %StrRoll7% ³ %StrScore7% ³
echo  ³  8 ³    4 Of A Kind: ³ %StrRoll8% ³ %StrScore8% ³
echo  ³  9 ³     Full House: ³ %StrRoll9% ³ %StrScore9% ³
echo  ³ 10 ³ Small Straight: ³ %StrRoll10% ³ %StrScore10% ³
echo  ³ 11 ³ Large Straight: ³ %StrRoll11% ³ %StrScore11% ³
echo  ³ 12 ³        Yahtzee: ³ %StrRoll12% ³ %StrScore12% ³
echo  ³ 13 ³         Chance: ³ %StrRoll13% ³ %StrScore13% ³
echo  ÃÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄ´
echo  ³ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ TOTAL 2: ³ %StrTotal2% ³
echo  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄ´
echo  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ´
echo  ³                                      ³        ³
echo  ³ *********************** GRAND TOTAL: ³ %StrGrandtotal% ³
echo  ³                                      ³        ³
echo  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ
goto :eof

:fix
set /p "fixed=%BS% Enter the dices you want to save (1,2,3,4,5): "
if not defined fixed goto :eof
set fixed=%fixed: =%
if not defined fixed goto :eof
set fixed=%fixed:,=%
if not defined fixed goto :eof
set "fixed1=%fixed:~,1%
set "fixed2=%fixed:~1,1%
set "fixed3=%fixed:~2,1%
set "fixed4=%fixed:~3,1%
set "fixed5=%fixed:~4,1%
if defined fixed1 (set "fix%fixed1%=1"&set "safe%fixed1%=SAFE")
if defined fixed2 (set "fix%fixed2%=1"&set "safe%fixed2%=SAFE")
if defined fixed3 (set "fix%fixed3%=1"&set "safe%fixed3%=SAFE")
if defined fixed4 (set "fix%fixed4%=1"&set "safe%fixed4%=SAFE")
if defined fixed5 (set "fix%fixed5%=1"&set "safe%fixed5%=SAFE")
set /a fixsum=%fix1%+%fix2%+%fix3%+%fix4%+%fix5%
if %fixsum%==5 set /a iteration=3
goto :eof

:test1
if "%roll1%" neq " " (set "return=F"&goto :eof)
setlocal enabledelayedexpansion
set /a one=0
for /l %%i in (1,1,5) do (
  if !d%%i!==1 set /a one+=1
)
endlocal&set "return=%one%"
goto :eof

:test2
if "%roll2%" neq " " (set "return=F"&goto :eof)
setlocal enabledelayedexpansion
set /a two=0
for /l %%i in (1,1,5) do (
  if !d%%i!==2 set /a two+=2
)
endlocal&set "return=%two%"
goto :eof

:test3
if "%roll3%" neq " " (set "return=F"&goto :eof)
setlocal enabledelayedexpansion
set /a three=0
for /l %%i in (1,1,5) do (
  if !d%%i!==3 set /a three+=3
)
endlocal&set "return=%three%"
goto :eof

:test4
if "%roll4%" neq " " (set "return=F"&goto :eof)
setlocal enabledelayedexpansion
set /a four=0
for /l %%i in (1,1,5) do (
  if !d%%i!==4 set /a four+=4
)
endlocal&set "return=%four%"
goto :eof

:test5
if "%roll5%" neq " " (set "return=F"&goto :eof)
setlocal enabledelayedexpansion
set /a five=0
for /l %%i in (1,1,5) do (
  if !d%%i!==5 set /a five+=5
)
endlocal&set "return=%five%"
goto :eof

:test6
if "%roll6%" neq " " (set "return=F"&goto :eof)
setlocal enabledelayedexpansion
set /a six=0
for /l %%i in (1,1,5) do (
  if !d%%i!==6 set /a six+=6
)
endlocal&set "return=%six%"
goto :eof

:testThreeOAK
if "%roll7%" neq " " (set "return=F"&goto :eof)
setlocal
set /a ThreeOAK=0
for /l %%i in (1,1,6) do (
  echo %d1%%d2%%d3%%d4%%d5%|findstr /c:"%%i%%i%%i">nul&&set /a ThreeOAK=%d1%+%d2%+%d3%+%d4%+%d5%
)
endlocal&set "return=%ThreeOAK%"
goto :eof

:testFourOAK
if "%roll8%" neq " " (set "return=F"&goto :eof)
setlocal
set /a FourOAK=0
for /l %%i in (1,1,6) do (
  echo %d1%%d2%%d3%%d4%%d5%|findstr /c:"%%i%%i%%i%%i">nul&&set /a FourOAK=%d1%+%d2%+%d3%+%d4%+%d5%
)
endlocal&set "return=%FourOAK%"
goto :eof

:testFullHouse
if "%roll9%" neq " " (set "return=F"&goto :eof)
setlocal
set /a FullHouse=0
for /l %%i in (1,1,6) do (
  for /l %%j in (%%i,1,6) do (
    echo %d1%%d2%%d3%%d4%%d5%|findstr "%%i%%i%%i%%j%%j %%i%%i%%j%%j%%j">nul&&(
      endlocal
      set "return=25"
      goto :eof
    )
  )
)
endlocal&set "return=%FullHouse%"
goto :eof

:testSStraight
if "%roll10%" neq " " (set "return=F"&goto :eof)
setlocal enabledelayedexpansion
set /a SStraight=0
set "test=%d1%%d2%%d3%%d4%%d5%"
for /l %%i in (1,1,6) do (
  set "test=!test:%%i%%i=%%i!"
)
echo %test%|findstr "1234 2345 3456">nul&&set /a SStraight=30
endlocal&set "return=%SStraight%"
goto :eof

:testLStraight
if "%roll11%" neq " " (set "return=F"&goto :eof)
setlocal
set /a LStraight=0
echo %d1%%d2%%d3%%d4%%d5%|findstr "12345 23456">nul&&set /a LStraight=40
endlocal&set "return=%LStraight%"
goto :eof

:testYahtzee
if "%roll12%" neq " " (set "return=F"&goto :eof)
setlocal
set /a Yahtzee=0
for /l %%i in (1,1,6) do (
  echo %d1%%d2%%d3%%d4%%d5%|findstr /c:"%%i%%i%%i%%i%%i">nul&&set /a Yahtzee=60
)
endlocal&set "return=%Yahtzee%"
goto :eof

:testChance
if "%roll13%" neq " " (set "return=F"&goto :eof)
set /a return=%d1%+%d2%+%d3%+%d4%+%d5%
goto :eof

:addspaces
setlocal
set "spaces=                                        "
if "%~3"=="r" (
  set "string=%~1%spaces%"
  call set "string=%%string:~,%~2%%
) else (
  set "string=%spaces%%~1"
  call set "string=%%string:~-%~2%%
)
endlocal&set "%~4=%string%"
goto :eof


Make sure the last line is a blank line.

Regards
aGerman

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Batch Games

#8 Post by foxidrive » 18 May 2012 09:20

I enjoy Yahtzee. Nice work.

SmartGenius
Posts: 2
Joined: 17 May 2012 00:15

Re: Batch Games

#9 Post by SmartGenius » 18 May 2012 20:28

I have created a Pastebin account just for sharing codes with you, you can see there some of my Old creations in the Batch Game world like Pacman, sokoban, arkanoid, naval battle, minesweeper, space invaders, Pong, F1 Cars, Memory, Labyrint...Etc.

Get Codes here -->> http://pastebin.com/u/SmartGenius

Also see Youtube channel with videos of all the Batch Games and some other stuff -->> http://www.youtube.com/user/GENIUSALEX


This is Tetris.bat

Code: Select all

@Echo off
@title Tetris v 1
@mode con cols=28 lines=24

:: Batch Game - Tetris v 1
:: Proof Of Concept
:: Coded by SmartGenius
:: SmartGenius, Corp. 2010

Choice /N /T:Y,1 >Nul 2>&1
If "%Errorlevel%"=="9009" (Echo. CHOICE command not found&Pause&Exit)

Set "Game=%0"

Call :Logo

:Menu
Cls
Echo.
Echo.
Echo. Tetris v 1 by SmartGenius
Echo. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Echo. ÚÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿
Echo. ³1.³ ³Play TETRIS ³
Echo. ÀÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ
Echo. ÚÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿
Echo. ³2.³ ³How to Play ³
Echo. ÀÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ
Echo. ÚÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿
Echo. ³3.³ ³Exit Game   ³
Echo. ÀÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ
Echo.
CHOICE /C:123 /N >nul
If "%errorlevel%"=="1" (Goto :Load)
If "%errorlevel%"=="2" (Goto :Help)
If "%errorlevel%"=="3" (Goto :End)
Goto :Menu

:Load
Setlocal enabledelayedexpansion
Set /a "LimX=18","LimY=16","TBound=1","LBound=0","Turn=1","Points=0"
Set /a "RBound=%LimX%","BBound=%LimY%"

:Init
For /l %%a in (0,1,%LimX%) do (
For /l %%b in (0,1,%LimY%) do (
Set "X%%aY%%b= "))
Set "Bound=Û"
Set "Bound2=²"

:Main
Set /a "L=(%Random% %% 7)+1"
Call :Figure%L%
Call :Graphic
Goto :Main

:Graphic
If "%New_F%"=="True" (
Call :Solid
Set "New_F=False"
Goto :Eof
)
Call :Clear
Cls
Echo.
Echo.  Tetris v 1 by SmartGenius
Echo.
Echo.   Points:%Points%
Echo.   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
For /l %%f in (0,1,%LimY%) do (Echo.   º!Lin_%%f!º)
Echo.   ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
Call :Move
Goto :Graphic

:Move
:: Normal CHOICE (provided into ZIP package)
CHOICE /C:SADRXC /N >nul
:: Windows 7 or x64 system CHOICE (uncomment)
REM CHOICE /C SADRXC /N
If "%errorlevel%"=="1" (Call :Down)
If "%errorlevel%"=="2" (Call :Left)
If "%errorlevel%"=="3" (Call :Rigth)
If "%errorlevel%"=="4" (Call :Rotate)
If "%errorlevel%"=="5" (Goto :Menu)
If "%errorlevel%"=="6" (Call :MovCR)
::Descomentar para doble movimiento
REM Call :Down
Call :CheckL2
Goto :Eof

::::::::::::::::::::::::::::::::::::::::
:Solid
For %%a in (%Table%) do (Set "%%a=%Bound2%")
Goto :Eof

:Rotate
Set "TmpTB="
If "%XToken%"=="11" (Set "XToken=10")
If "%YToken%"=="15" (Set "XToken=14")
Set /a "NextRotate=(%RotateLevel% %% 4)+1"
Set "TmpTable=!Figure%CurFig%_Pos%NextRotate%!
For %%R in (%TmpTable%) do (
Call :MovR "%YToken%" "%XToken%" "%%R" "Val"
Call Set "TmpTB=!TmpTB!,!Val!"
)
For %%c in (%TmpTB:~1%) do (
If "!%%c!"=="%Bound2%" (
For %%b in (%Table%) do (Set "%%b=%Bound%")
Goto :Eof
))
For %%a in (%Table%) do (Set "%%a= ")
Set "Table=%TmpTB:~1%"
For %%b in (%Table%) do (Set "%%b=%Bound%")
Set /a "RotateLevel+=1"
Goto :Eof

:MovR
For /f "tokens=1,2 delims=X,Y" %%p in ("%~3") do (
Set /a MovY=%%q+%~1
Set /a MovX=%%p+%~2
Set "%~4=X!MovX!Y!MovY!"
Set "%~3= ")
Goto :Eof

:::::::::::::::::::::::::::::::::::::::::::
:Down
Set "TmpTB="
Set "TmpTable=%Table%"
For %%a in (%TmpTable%) do (
Echo.!TmpTable!|Find "Y%BBound%">nul
If !Errorlevel! EQU 0 (Set "New_F=True"&Goto :Eof)
Call :MovYR "1" "%%a" "Val"
Call Set "TmpTB=!TmpTB!,!Val!"
)
For %%c in (%TmpTB:~1%) do (
If "!%%c!"=="%Bound2%" (
Set "New_F=True"
For %%b in (%Table%) do (Set "%%b=%Bound%")
Goto :Eof
))
Set "Table=%TmpTB:~1%"
For %%d in (%Table%) do (Set "%%d=%Bound%")
Set /a "YToken+=1"
Goto :Eof

:MovYR
For /f "tokens=1,2 delims=X,Y" %%p in ("%~2") do (
Set /a MovY=%%q+%~1
Set "%~3=X%%pY!MovY!"
Set "%~2= ")
Goto :Eof

:MovCR
Cls
Echo.
Echo.
Call :L2 "Goto :Eof"
Echo.
For /f "tokens=2 skip=3" %%c in ('find "::_0" %Game%') do (
Set "Tmp_Var=%%c"
Call :Key.A Tmp_Var
Echo. !Tmp_Var!
)
Pause >nul
Goto :Eof
::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::
:Rigth
Set "TmpTB="
Set "TmpTable=%Table%"
For %%a in (%TmpTable%) do (
Echo.!TmpTable!|Find "X%RBound%">nul
If !Errorlevel! EQU 0 (Goto :Eof)
Call :MovXR "+1" "%%a" "Val"
Call Set "TmpTB=!TmpTB!,!Val!"
)
For %%c in (%TmpTB:~1%) do (
If "!%%c!"=="%Bound2%" (
For %%b in (%Table%) do (Set "%%b=%Bound%")
Goto :Eof
))
Set "Table=%TmpTB:~1%"
For %%d in (%Table%) do (Set "%%d=%Bound%")
Set /a "XToken+=1"
Goto :Eof

:Left
Set "TmpTB="
Set "TmpTable=%Table%"
For %%a in (%TmpTable%) do (
Echo.!TmpTable!|Find "X%LBound%">nul
If !Errorlevel! EQU 0 (Goto :Eof)
Call :MovXR "-1" "%%a" "Val"
Call Set "TmpTB=!TmpTB!,!Val!"
)
For %%c in (%TmpTB:~1%) do (
If "!%%c!"=="%Bound2%" (
For %%b in (%Table%) do (Set "%%b=%Bound%")
Goto :Eof
))
Set "Table=%TmpTB:~1%"
For %%d in (%Table%) do (Set "%%d=%Bound%")
Set /a "XToken-=1"
Goto :Eof

:MovXR
For /f "tokens=1,2 delims=X,Y" %%p in ("%~2") do (
Set /a MovX=%%p%~1
Set "%~3=X!MovX!Y%%q"
Set "%~2= ")
Goto :Eof

::::::::::::::::::::::::::::::::::::::::

:CheckL2
If "!Lin_1!"=="²²²²²²²²²²²²²²²²²²²" (Goto :Lost)
If "!Lin_%LimY%!"=="²²²²²²²²²²²²²²²²²²²" (
Call :Clear
For /l %%x in (0,1,%LimX%) do (
For /l %%y in (%LimY%,-1,1) do (
Set /a "UpLine=%%y-1"
Call Set "X%%xY%%y=%%X%%xY!UpLine!%%"
))
Set /a "Points+=100"
For /l %%d in (0,1,%LimX%) do (Set "X%%dY0= ")
Goto :CheckL2
)
Goto :Eof

:::::::::::::::::::::::::::::::::::::::::

:Key.A
If not defined %1 Goto:Eof
Set "c="
Set "d=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz =/\()[]{}_-.:,;* @#"
:Key.B
Set "chr=!%1:~,1!"
For /l %%l in (0 1 80) do if "!chr!" equ "!d:~%%l,1!" (
  set /a "x=%%l^5"
  call set "c=!c!%%d:~!x!,1%%"
)
Set "%1=!%1:~1!"
If defined %1 goto:Key.B
Set "%1=!c!"
Goto :Eof
:::::::::::::::::::::::::::::::::::::::::

:Clear
For /l %%m in (0,1,%LimY%) do (Set Lin_%%m=)
For /l %%d in (0,1,%LimY%) do (
For /l %%e in (0,1,%LimX%) do (
Set Lin_%%d=!Lin_%%d!!X%%eY%%d!))
Goto :Eof

:Lost
Cls
Echo.
Echo.  Tetris v 1 by SmartGenius
Echo.
Echo.     Points:%Points%
Echo.        Perdiste !
Goto :End

:Win
Cls
Echo.
Echo.  Tetris v 1 by SmartGenius
Echo.
Echo.     Points:%Points%
Echo.      Has Ganado !
Goto :End

:End
Echo.     Gracias por Jugar
Echo.  Tetris v1 by SmartGenius
Endlocal
Ping -n 3 localhost >nul
Exit

::::::::::::::::::::::::::::::::::::::::::
:Figure1
Set Figure1_Pos1=X6Y2,X6Y1,X7Y1,X7Y0
Set Figure1_Pos2=X7Y1,X8Y1,X6Y0,X7Y0
Set Figure1_Pos3=X6Y2,X6Y1,X7Y1,X7Y0
Set Figure1_Pos4=X7Y1,X8Y1,X6Y0,X7Y0
Set /a "R=(%Random% %% 4)+1"
Set Table=!Figure1_Pos%R%!
For %%b in (%Table%) do (Set "%%b=%Bound%")
Set /a "XToken=0","YToken=0","CurFig=1","RotateLevel=%R%"
Goto :Eof

:Figure2
Set Figure2_Pos1=X7Y2,X6Y1,X7Y1,X6Y0
Set Figure2_Pos2=X6Y1,X7Y1,X7Y0,X8Y0
Set Figure2_Pos3=X7Y2,X6Y1,X7Y1,X6Y0
Set Figure2_Pos4=X6Y1,X7Y1,X7Y0,X8Y0
Set /a "R=(%Random% %% 4)+1"
Set Table=!Figure2_Pos%R%!
For %%b in (%Table%) do (Set "%%b=%Bound%")
Set /a "XToken=0","YToken=0","CurFig=2","RotateLevel=%R%"
Goto :Eof

:Figure3
Set Figure3_Pos1=X7Y1,X8Y1,X7Y0,X8Y0
Set Figure3_Pos2=X7Y1,X8Y1,X7Y0,X8Y0
Set Figure3_Pos3=X7Y1,X8Y1,X7Y0,X8Y0
Set Figure3_Pos4=X7Y1,X8Y1,X7Y0,X8Y0
Set /a "R=(%Random% %% 4)+1"
Set "Table=!Figure3_Pos%R%!"
For %%b in (%Table%) do (Set "%%b=%Bound%")
Set /a "XToken=0","YToken=0","CurFig=3","RotateLevel=%R%"
Goto :Eof

:Figure4
Set Figure4_Pos1=X6Y1,X7Y1,X8Y1
Set Figure4_Pos2=X7Y2,X7Y1,X7Y0
Set Figure4_Pos3=X6Y1,X7Y1,X8Y1
Set Figure4_Pos4=X7Y2,X7Y1,X7Y0
Set /a "R=(%Random% %% 4)+1"
Set Table=!Figure4_Pos%R%!
For %%b in (%Table%) do (Set "%%b=%Bound%")
Set /a "XToken=0","YToken=0","CurFig=4","RotateLevel=%R%"
Goto :Eof

:Figure5
Set Figure5_Pos1=X6Y1,X7Y1,X8Y1,X7Y0
Set Figure5_Pos2=X7Y2,X7Y1,X8Y1,X7Y0
Set Figure5_Pos3=X7Y1,X6Y0,X7Y0,X8Y0
Set Figure5_Pos4=X8Y2,X7Y1,X8Y1,X8Y0
Set /a "R=(%Random% %% 4)+1"
Set Table=!Figure5_Pos%R%!
For %%b in (%Table%) do (Set "%%b=%Bound%")
Set /a "XToken=0","YToken=0","CurFig=5","RotateLevel=%R%"
Goto :Eof

:Figure6
Set Figure6_Pos1=X6Y1,X6Y0,X7Y0,X8Y0
Set Figure6_Pos2=X8Y2,X8Y1,X8Y0,X7Y0
Set Figure6_Pos3=X6Y1,X7Y1,X8Y1,X8Y0
Set Figure6_Pos4=X6Y2,X7Y2,X6Y1,X6Y0
Set /a "R=(%Random% %% 4)+1"
Set Table=!Figure6_Pos%R%!
For %%b in (%Table%) do (Set "%%b=%Bound%")
Set /a "XToken=0","YToken=0","CurFig=6","RotateLevel=%R%"
Goto :Eof

:Figure7
Set Figure7_Pos1=X8Y1,X6Y0,X7Y0,X8Y0
Set Figure7_Pos2=X7Y2,X8Y2,X8Y1,X8Y0
Set Figure7_Pos3=X6Y1,X7Y1,X8Y1,X6Y0
Set Figure7_Pos4=X6Y2,X6Y1,X6Y0,X7Y0
Set /a "R=(%Random% %% 4)+1"
Set Table=!Figure7_Pos%R%!
For %%b in (%Table%) do (Set "%%b=%Bound%")
Set /a "XToken=0","YToken=0","CurFig=7","RotateLevel=%R%"
Goto :Eof

::_0 xx9tYjYxWvxPrXmoLjqfzpxx
::_0 xxxxxXhXxLBINRPFGBaxxxxxx
::_0 xxxxxxxxxxxxxxxxxxxxxxxxx
::_0 xxxxx8jYfZXojYxOtxJvxxxxx
::_0 EjXzofizgxLfmgimfjqYx9GVJ
::_0 xxxJvx8XmgfqlxNxGtyjxRxxx
::_0 xxxxxxxxxxxxxxxxxxxxxxxxx
::_0 xPrXmoLjqfzpx9tms-x7545xxx

:Help
Cls
Echo.
Call :L2 "Goto :Eof"
Echo.
Echo. How to Play Batch Tetris ?
Echo.
Echo. Use keys A,S,D,R,X
Echo.
Echo. A = Move Shape Left
Echo. S = Move Shape Down
Echo. D = Move Shape Rigth
Echo. R = Rotate Shape
Echo. X = Back to Menu Game
Echo.
Echo.
Pause >nul
Goto :Menu

:Logo
Cls
Color 0b
Echo.
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
:L2
Echo. °°ÛÛÛ°ÛÛÛ°ÛÛÛ°ÛÛ°°Û°°ÛÛ°°°
Echo. °°°Û°°Û°°°°Û°°Û°Û°Û°Û°°°°°
Echo. °°°Û°°ÛÛÛ°°Û°°ÛÛ°°Û°°Û°°°°
Echo. °°°Û°°Û°°°°Û°°Û°Û°Û°°°Û°°°
Echo. °°°Û°°ÛÛÛ°°Û°°Û°Û°Û°ÛÛ°°°°
%~1
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
Echo. °°±°°°°°°°°°²°°°°°°°°°°±°°
Echo. °°±°²°°°²²°°²²°°°²²²°°°±°°
Echo. °°±°²²°°°²°°²°°°°°°°°°°±°°
Echo. °°±°°²°°°²°°°°°°²²°°°°°±°°
Echo. °°±°°°°°°°°°°°°°°²²°°°°±°°
Echo. °°±°°°°°°°°²°°°°°°°°°°°±°°
Echo. °°±²°°°°°°°²²²°°°°°°°°°±°°
Echo. °°±²°°²²°°°°°°°²°°°°°°²±°°
Echo. °°±²°°²²°°°°°°²²²°°°²²²±°°
Echo. °°±±±±±±±±±±±±±±±±±±±±±±°°
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
Echo. °°°°°: SmartGenius :°°°°°°
Echo. °°°°°  Corp.  2010  °°°°°°
Echo. °°°°°°°°°°°°°°°°°°°°°°°°°°
Ping -n 3 0.0.0.0 >nul
Goto :Eof


All codes are the original one, some of them needs to be updated and some bug fixes, i coded them a few years ago while learning batch scripting, also i maded a batch game programming tutorial, but all of those codes are in spanish hack forums because is my native language.

Hope you like it, and any comments and suggestions are welcome ;)

PS: Press "C" during playig Tetris ;)

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Batch Games

#10 Post by Squashman » 18 May 2012 21:22

Arkanoid is my favorite game of all time. I was real close to buying a console a few years ago.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Batch Games

#11 Post by foxidrive » 18 May 2012 21:39

SmartGenius wrote:I have created a Pastebin account just for sharing codes with you, you can see there some of my Old creations in the Batch Game world like Pacman, sokoban, arkanoid, naval battle, minesweeper, space invaders, Pong, F1 Cars, Memory, Labyrint...Etc.

Get Codes here -->> http://pastebin.com/u/SmartGenius

Also see Youtube channel with videos of all the Batch Games and some other stuff -->> http://www.youtube.com/user/GENIUSALEX


That's a lot of coding... is it possible to put them all in a zip file for downloading, please? It would save a lot of cut/paste and typing and clicking.

Jman0209
Posts: 1
Joined: 03 Oct 2017 21:58

Re: Batch Games

#12 Post by Jman0209 » 03 Oct 2017 22:03

I guess this post is really old but I'll still post mine.

https://pastebin.com/9Z3wJfQn

Jim W.
Posts: 8
Joined: 28 May 2017 20:46

Re: Batch Games

#13 Post by Jim W. » 24 Sep 2020 01:12

Cat wrote:
25 Apr 2012 19:15
Coded this a LONG time ago. Horrible coding, but it's too big for me to really redo.
Hope you don't mind, I made a few changes and added some code. Now it's a clickable text messagebox game with speech prompts. I wasn't sure it had a name so I call it '4 Get It?' I kept the underlying game code logic as it was. This may be a novel approach to the problem of using a mouse in a batch program. It needs a few supporting programs to run:

MacroCMD-x64.exe (the critical component)
the next 2 are not critical to running the game:
Speak-x64.exe
SetCursorPosition-x64.exe
all the above are by Fatih Kodak.

WinMsg.exe by Bill Stewart
(or, you could use a VBS messagebox for example.)

You can find all these by poking around a little bit.
It also uses Windows TaskKill.exe

Anyone who wants to convert a batch program to have clickable 'buttons' or menu could use the code I added as the foundation for it.
For instance, the UI could be a web graphic that, to the user, would appear clickable. Might even fool a few people into thinking it really is.
Well, if it walks like a duck and talks like a duck, who's to say it's not a duck, except the programmer who made the hologram?

Btw, anybody know what happened to Fatih Kodak? Seems like he fell into a black hole in the Dark Web or something; no sign of him anywhere, but his CMD apps are still widely available.

Code: Select all

@echo off
setlocal EnableDelayedExpansion
set PATH=%PATH%;%~dp0
Speak-x64.exe -t "4 .. get it"
call :calibrate
:s
set a1=..&set a2=..&set a3=..&set a4=..&set b1=..&set b2=..&set b3=..&set b4=..&set c1=..&set c2=..&set c3=..&set c4=..
set d3=..&set d4=..&set e1=..&set e2=..&set e3=..&set e4=..&set f1=..&set f2=..&set f3=..&set f4=..&set d1=..&set d2=..
set moves=0&set AC=1&set BC=1&set CC=1&set DC=1&set FC=1&set EC=1
Taskkill.exe /F /IM WinMsg.exe
call :board
:start
call :player
call :winlist
goto :computer
:AFTER
Taskkill.exe /F /IM WinMsg.exe
set /a moves= %moves% + 1
if %moves%==12 goto tie
goto START
:player
Taskkill.exe /F /IM WinMsg.exe
call :board
Speak-x64.exe -t "GO"
call :TextBoxMonitor
if %P1%==1 set P1=A
if %P1%==2 set P1=B
if %P1%==3 set P1=C
if %P1%==4 set P1=D
if %P1%==5 set P1=E
if %P1%==6 set P1=F
if /i %p1%%AC%==A1 set A1=X&Set /a AC= %AC%+1&exit /B
if /i %p1%%AC%==A2 set A2=X&Set /a AC= %AC%+1&exit /B
if /i %p1%%AC%==A3 set A3=X&Set /a AC= %AC%+1&exit /B
if /i %p1%%AC%==A4 set A4=X&Set /a AC= %AC%+1&exit /B
if /i %p1%%BC%==B1 set B1=X&set /a BC= %BC%+1&exit /B
if /i %p1%%BC%==B2 set B2=X&set /a BC= %BC%+1&exit /B
if /i %p1%%BC%==B3 set B3=X&set /a BC= %BC%+1&exit /B
if /i %p1%%BC%==B4 set B4=X&set /a BC= %BC%+1&exit /B
if /i %p1%%CC%==C1 set C1=X&set /a CC= %CC%+1&exit /B
if /i %p1%%CC%==C2 set C2=X&set /a CC= %CC%+1&exit /B
if /i %p1%%CC%==C3 set C3=X&set /a CC= %CC%+1&exit /B
if /i %p1%%CC%==C4 set C4=X&set /a CC= %CC%+1&exit /B
if /i %p1%%DC%==D1 set D1=X&set /a DC= %DC%+1&exit /B
if /i %p1%%DC%==D2 set D2=X&set /a DC= %DC%+1&exit /B
if /i %p1%%DC%==D3 set D3=X&set /a DC= %DC%+1&exit /B
if /i %p1%%DC%==D4 set D4=X&set /a DC= %DC%+1&exit /B
if /i %p1%%EC%==E1 set E1=X&set /a EC= %EC%+1&exit /B
if /i %p1%%EC%==E2 set E2=X&set /a EC= %EC%+1&exit /B
if /i %p1%%EC%==E3 set E3=X&set /a EC= %EC%+1&exit /B
if /i %p1%%EC%==E4 set E4=X&set /a EC= %EC%+1&exit /B
if /i %p1%%FC%==F1 set F1=X&set /a FC= %FC%+1&exit /B
if /i %p1%%FC%==F2 set F2=X&set /a FC= %FC%+1&exit /B
if /i %p1%%FC%==F3 set F3=X&set /a FC= %FC%+1&exit /B
if /i %p1%%FC%==F4 set F4=X&set /a FC= %FC%+1&exit /B
goto START
:computer
ping -n 2 0.0.0.0
Taskkill.exe /F /IM WinMsg.exe
CALL :ATTACKER
CALL :DEFENDER
:randomerror
set /a N=%random% %% 6 
IF %N%%AC%==05 goto randomerror
IF %N%%BC%==15 goto randomerror
IF %N%%CC%==25 goto randomerror
IF %N%%DC%==35 goto randomerror
IF %N%%EC%==45 goto randomerror
IF %N%%FC%==55 goto randomerror
IF %N%==0 SET A%AC%=0&SET /A AC= %AC%+1
IF %N%==1 SET B%BC%=0&SET /A BC= %BC%+1
IF %N%==2 SET C%CC%=0&SET /A CC= %CC%+1
IF %N%==3 SET D%DC%=0&SET /A DC= %DC%+1
IF %N%==4 SET E%EC%=0&SET /A EC= %EC%+1
IF %N%==5 SET F%FC%=0&SET /A FC= %FC%+1
call :board
goto AFTER
:lose
Speak-x64.exe -t "i won"
set message="\n       I WON\n\n      It's OK to quit"
WinMsg.exe -t "4get it? Game" -m %message% -c OK,SystemModal -w 3
if %errorlevel%==1 goto :Goodbye
call :board
goto s
:tie
Speak-x64.exe -t "we tied"
set message="\n        WE TIED\n\n      It's OK to quit"
WinMsg.exe -t "4get it? Game" -m %message% -c OK,SystemModal -w 3
if %errorlevel%==1 goto :Goodbye
call :board
goto s
:win
Speak-x64.exe -t "you won"
set message="\n        YOU WON\n\n      It's OK to quit"
WinMsg.exe -t "4get it? Game" -m %message% -c OK,SystemModal -w 3
if %errorlevel%==1 goto :Goodbye
call :board
goto s
:board
set message="        YOUR TURN\n      click a column\n\n       %A4%  %B4%  %C4%  %D4%  %E4%  %F4%\n       %A3%  %B3%  %C3%  %D3%  %E3%  %F3%\n       %A2%  %B2%  %C2%  %D2%  %E2%  %F2%\n       %A1%  %B1%  %C1%  %D1%  %E1%  %F1%"
call start WinMsg.exe -t "4get it? Game" -m %message% -c SystemModal
if %errorlevel%==1 goto :Goodbye
exit /b
:defender
if %A1%%A2%%A3%%A4%==XXX.. set A4=0&set /a AC= %AC%+1& goto AFTER
if %A1%%A2%%A3%%A4%==XX..X set A3=0&set /a AC= %AC%+1& goto AFTER
if %A1%%A2%%A3%%A4%==X..XX set A2=0&set /a AC= %AC%+1& goto AFTER
if %A1%%A2%%A3%%A4%==..XXX set A1=0&set /a AC= %AC%+1& goto AFTER
if %B1%%B2%%B3%%B4%==XXX.. set B4=0&set /a BC= %BC%+1& goto AFTER
if %B1%%B2%%B3%%B4%==XX..X set B3=0&set /a BC= %BC%+1& goto AFTER
if %B1%%B2%%B3%%B4%==X..XX set B2=0&set /a BC= %BC%+1& goto AFTER
if %B1%%B2%%B3%%B4%==..XXX set B1=0&set /a BC= %BC%+1& goto AFTER
if %C1%%C2%%C3%%C4%==XXX.. set C4=0&set /a CC= %CC%+1& goto AFTER
if %C1%%C2%%C3%%C4%==XX..X set C3=0&set /a CC= %CC%+1& goto AFTER
if %C1%%C2%%C3%%C4%==X..XX set C2=0&set /a CC= %CC%+1& goto AFTER
if %C1%%C2%%C3%%C4%==..XXX set C1=0&set /a CC= %CC%+1& goto AFTER
if %D1%%D2%%D3%%D4%==XXX.. set D4=0&set /a DC= %DC%+1& goto AFTER
if %D1%%D2%%D3%%D4%==XX..X set D3=0&set /a DC= %DC%+1& goto AFTER
if %D1%%D2%%D3%%D4%==X..XX set D2=0&set /a DC= %DC%+1& goto AFTER
if %D1%%D2%%D3%%D4%==..XXX set D1=0&set /a DC= %DC%+1& goto AFTER
if %E1%%E2%%E3%%E4%==XXX.. set E4=0&set /a EC= %EC%+1& goto AFTER
if %E1%%E2%%E3%%E4%==XX..X set E3=0&set /a EC= %EC%+1& goto AFTER
if %E1%%E2%%E3%%E4%==X..XX set E2=0&set /a EC= %EC%+1& goto AFTER
if %E1%%E2%%E3%%E4%==..XXX set E1=0&set /a EC= %EC%+1& goto AFTER
if %F1%%F2%%F3%%F4%==XXX.. set F4=0&set /a FC= %FC%+1& goto AFTER
if %F1%%F2%%F3%%F4%==XX..X set F3=0&set /a FC= %FC%+1& goto AFTER
if %F1%%F2%%F3%%F4%==X..XX set F2=0&set /a FC= %FC%+1& goto AFTER
if %F1%%F2%%F3%%F4%==..XXX set F1=0&set /a FC= %FC%+1& goto AFTER
if %A4%%b4%%c4%%d4%==XXX.. if not %d3%==.. set d4=0&Set /a DC= %DC%+1& goto AFTER
if %A4%%b4%%c4%%d4%==XX..X if not %d3%==.. set c4=0&set /a CC= %CC%+1& goto AFTER
if %A4%%b4%%c4%%d4%==X..XX if not %d3%==.. set b4=0&set /a BC= %BC%+1& goto AFTER
if %A4%%b4%%c4%%d4%==..XXX if not %d3%==.. set A4=0&set /a AC= %AC%+1& goto AFTER
if %A3%%b3%%c3%%d3%==XXX.. if not %d2%==.. set d3=0&set /a DC= %DC%+1& goto AFTER
if %A3%%b3%%c3%%d3%==XX..X if not %c2%==.. set c3=0&set /a CC= %CC%+1& goto AFTER
if %A3%%b3%%c3%%d3%==X..XX if not %b2%==.. set b3=0&set /a BC= %BC%+1& goto AFTER
if %A3%%b3%%c3%%d3%==..XXX if not %a2%==.. set A3=0&set /a AC= %AC%+1& goto AFTER
if %A2%%b2%%c2%%d2%==XXX.. if not %d1%==.. set d2=0&set /a DC= %DC%+1& goto AFTER
if %A2%%b2%%c2%%d2%==XX..X if not %c1%==.. set c2=0&set /a CC= %CC%+1& goto AFTER
if %A2%%b2%%c2%%d2%==X..XX if not %b1%==.. set b2=0&set /a BC= %BC%+1& goto AFTER
if %A2%%b2%%c2%%d2%==..XXX if not %a1%==.. set A2=0&set /a AC= %AC%+1& goto AFTER
if %A1%%b1%%c1%%d1%==XXX.. set d1=0&set /a DC= %DC%+1& goto AFTER
if %A1%%b1%%c1%%d1%==XX..X set c1=0&set /a CC= %CC%+1& goto AFTER
if %A1%%b1%%c1%%d1%==X..XX set b1=0&set /a BC= %BC%+1& goto AFTER
if %A1%%b1%%c1%%d1%==..XXX set A1=0&set /a AC= %AC%+1& goto AFTER
if %b4%%c4%%d4%%e4%==XXX.. if not %e3%==.. set e3=0&set /a EC= %EC%+1& goto AFTER
if %b4%%c4%%d4%%e4%==XX..X if not %d3%==.. set d3=0&set /a DC= %DC%+1& goto AFTER
if %b4%%c4%%d4%%e4%==X..XX if not %c3%==.. set c3=0&set /a CC= %CC%+1& goto AFTER
if %b4%%c4%%d4%%e4%==..XXX if not %b3%==.. set b3=0&set /a BC= %BC%+1& goto AFTER
if %b3%%c3%%d3%%e3%==XXX.. if not %e2%==.. set e2=0&set /a EC= %EC%+1& goto AFTER
if %b3%%c3%%d3%%e3%==XX..X if not %d2%==.. set d2=0&set /a DC= %DC%+1& goto AFTER
if %b3%%c3%%d3%%e3%==X..XX if not %c2%==.. set c3=0&set /a CC= %CC%+1& goto AFTER
if %b3%%c3%%d3%%e3%==..XXX if not %b2%==.. set b3=0&set /a BC= %BC%+1& goto AFTER
if %b2%%c2%%d2%%e2%==XXX.. if not %e1%==.. set e2=0&set /a EC= %EC%+1& goto AFTER
if %b2%%c2%%d2%%e2%==XX..X if not %d1%==.. set d2=0&set /a DC= %DC%+1& goto AFTER
if %b2%%c2%%d2%%e2%==X..XX if not %c1%==.. set c2=0&set /a CC= %CC%+1& goto AFTER
if %b2%%c2%%d2%%e2%==..XXX if not %b1%==.. set b2=0&set /a BC= %BC%+1& goto AFTER
if %b1%%c1%%d1%%e1%==XXX.. set e1=0&set /a EC= %EC%+1& goto AFTER
if %b1%%c1%%d1%%e1%==XX..X set d1=0&set /a DC= %DC%+1& goto AFTER
if %b1%%c1%%d1%%e1%==X..XX set c1=0&set /a CC= %CC%+1& goto AFTER
if %b1%%c1%%d1%%e1%==..XXX set b1=0&set /a BC= %BC%+1& goto AFTER
if %c4%%d4%%e4%%f4%==XXX.. if not %f3%==.. set F4=0&set /a FC= %FC%+1& goto AFTER
if %c4%%d4%%e4%%f4%==XX..X if not %e3%==.. set E4=0&set /a EC= %EC%+1& goto AFTER
if %c4%%d4%%e4%%f4%==X..XX if not %d3%==.. set D4=0&set /a DC= %DC%+1& goto AFTER
if %c4%%d4%%e4%%f4%==..XXX if not %c3%==.. set C4=0&set /a CC= %CC%+1& goto AFTER
if %c3%%d3%%e3%%f3%==XXX.. if not %f2%==.. set F3=0&set /a FC= %FC%+1& goto AFTER
if %c3%%d3%%e3%%f3%==XX..X if not %e2%==.. set E3=0&set /a EC= %EC%+1& goto AFTER
if %c3%%d3%%e3%%f3%==X..XX if not %d2%==.. set D3=0&set /a DC= %DC%+1& goto AFTER
if %c3%%d3%%e3%%f3%==..XXX if not %c2%==.. set C3=0&set /a CC= %CC%+1& goto AFTER
if %c2%%d2%%e2%%f2%==XXX.. if not %f1%==.. set F2=0&set /a FC= %FC%+1& goto AFTER
if %c2%%d2%%e2%%f2%==XX..X if not %e1%==.. set E2=0&set /a EC= %EC%+1& goto AFTER
if %c2%%d2%%e2%%f2%==X..XX if not %d1%==.. set D2=0&set /a DC= %DC%+1& goto AFTER
if %c2%%d2%%e2%%f2%==..XXX if not %c1%==.. set C2=0&set /a CC= %CC%+1& goto AFTER
if %c1%%d1%%e1%%f1%==XXX.. set F1=0&set /a FC= %FC%+1& goto AFTER
if %c1%%d1%%e1%%f1%==XX..X set E1=0&set /a EC= %EC%+1& goto AFTER
if %c1%%d1%%e1%%f1%==X..XX set D1=0&set /a DC= %DC%+1& goto AFTER
if %c1%%d1%%e1%%f1%==..XXX set C1=0&set /a CC= %CC%+1& goto AFTER
if %a1%%b2%%c3%%d4%==XXX.. if not %d4%==.. set d4=0&set /a DC= %DC%+ 1& goto AFTER
if %a1%%b2%%c3%%d4%==XX..X if not %c3%==.. set C3=0&set /a CC= %CC%+ 1& goto AFTER
if %a1%%b2%%c3%%d4%==X..XX if not %b2%==.. set B2=0&set /a BC= %BC%+ 1& goto AFTER
if %a1%%b2%%c3%%d4%==..XXX set A1=0&set /a AC= %AC%+1& goto AFTER
if %a4%%b3%%c2%%d1%==XXX.. set D1=0&set /a DC= %DC%+1& goto AFTER
if %a4%%b3%%c2%%d1%==XX..X if not %c1%==.. set C2=0&set /a CC= %CC%+1& goto AFTER
if %a4%%b3%%c2%%d1%==X..XX if not %b2%==.. set B3=0&set /a BC= %BC%+1& goto AFTER
if %a4%%b3%%c2%%d1%==..XXX if not %a3%==.. set A4=0&set /a AC= %AC%+1& goto AFTER
if %b1%%C2%%D3%%E4%==XXX.. if not %e3%==.. set E4=0&set /a EC= %EC%+1& goto AFTER
if %b1%%C2%%D3%%E4%==XX..X if not %d2%==.. set D3=0&set /a DC= %DC%+1& goto AFTER
if %b1%%C2%%D3%%E4%==X..XX if not %c1%==.. set C2=0&set /a CC= %CC%+1& goto AFTER
if %b1%%C2%%D3%%E4%==..XXX set B1=0&set /a BC= %BC%+1& goto AFTER
if %b4%%C3%%D2%%E1%==XXX.. set E1=0&set /a EC= %EC%+1& goto AFTER
if %b4%%C3%%D2%%E1%==XX..X if not %d1%==.. set D2=0&set /a DC= %DC%+1& goto AFTER
if %b4%%C3%%D2%%E1%==X..XX if not %c2%==.. set C3=0&set /a CC= %CC%+1& goto AFTER
if %b4%%C3%%D2%%E1%==..XXX if not %b3%==.. set B4=0&set /a BC= %BC%+1& goto AFTER
if %c1%%d2%%e3%%f4%==XXX.. if not %f3%==.. set F4=0&set /a FC= %FC%+1& goto AFTER
if %c1%%d2%%e3%%f4%==XX..X if not %e2%==.. set E3=0&set /a EC= %EC%+1& goto AFTER
if %c1%%d2%%e3%%f4%==X..XX if not %d1%==.. set D2=0&set /a DC= %DC%+1& goto AFTER
if %c1%%d2%%e3%%f4%==..XXX set C1=0&set /a CC= %CC%+1& goto AFTER
if %c4%%d3%%e2%%f1%==XXX.. set F1=0&set /a FC= %FC%+1& goto AFTER
if %c4%%d3%%e2%%f1%==XX..X if not %e1%==.. set E2=0&set /a EC= %EC%+1& goto AFTER
if %c4%%d3%%e2%%f1%==X..XX if not %d2%==.. set D3=0&set /a DC= %DC%+1& goto AFTER
if %c4%%d3%%e2%%f1%==..XXX if not %c3%==.. set C4=0&set /a CC= %CC%+1& goto AFTER
exit /b
:attacker
if %A1%%A2%%A3%%A4%==000.. if not %A3%==.. set A4=0& goto lose
if %A1%%A2%%A3%%A4%==00..0 if not %A2%==.. set A3=0& goto lose
if %A1%%A2%%A3%%A4%==0..00 if not %A1%==.. set A2=0& goto lose
if %A1%%A2%%A3%%A4%==..000 set A1=0& goto lose
if %B1%%B2%%B3%%B4%==000.. if not %B3%==.. set B4=0& goto lose
if %B1%%B2%%B3%%B4%==00..0 if not %B2%==.. set B3=0& goto lose
if %B1%%B2%%B3%%B4%==0..00 if not %B1%==.. set B2=0& goto lose
if %B1%%B2%%B3%%B4%==..000 set B1=0& goto lose
if %C1%%C2%%C3%%C4%==000.. if not %c3%==.. set C4=0& goto lose
if %C1%%C2%%C3%%C4%==00..0 if not %c2%==.. set C3=0& goto lose
if %C1%%C2%%C3%%C4%==0..00 if not %c1%==.. set C2=0& goto lose
if %C1%%C2%%C3%%C4%==..000 set C1=0& goto lose
if %D1%%D2%%D3%%D4%==000.. if not %d3%==.. set D4=0& goto lose
if %D1%%D2%%D3%%D4%==00..0 if not %d2%==.. set D3=0& goto lose
if %D1%%D2%%D3%%D4%==0..00 if not %d1%==.. set D2=0& goto lose
if %D1%%D2%%D3%%D4%==..000 set D1=0& goto lose
if %E1%%E2%%E3%%E4%==000.. if not %e3%==.. set E4=0& goto lose
if %E1%%E2%%E3%%E4%==00..0 if not %e2%==.. set E3=0& goto lose
if %E1%%E2%%E3%%E4%==0..00 if not %d1%==.. set E2=0& goto lose
if %E1%%E2%%E3%%E4%==..000  set E1=0& goto lose
if %F1%%F2%%F3%%F4%==000.. if not %f3%==.. set F4=0& goto lose
if %F1%%F2%%F3%%F4%==00..0 if not %f2%==.. set F3=0& goto lose
if %F1%%F2%%F3%%F4%==0..00 if not %f1%==.. set F2=0& goto lose
if %F1%%F2%%F3%%F4%==..000 set F1=0& goto lose
if %A4%%b4%%c4%%d4%==000.. if not %d3%==.. set d4=0& goto lose
if %A4%%b4%%c4%%d4%==00..0 if not %c3%==.. set c4=0& goto lose
if %A4%%b4%%c4%%d4%==0..00 if not %b3%==.. set b4=0& goto lose
if %A4%%b4%%c4%%d4%==..000 if not %a3%==.. set A4=0& goto lose
if %A3%%b3%%c3%%d3%==000.. if not %d2%==.. set d3=0& goto lose
if %A3%%b3%%c3%%d3%==00..0 if not %c2%==.. set c3=0& goto lose
if %A3%%b3%%c3%%d3%==0..00 if not %b2%==.. set b3=0& goto lose
if %A3%%b3%%c3%%d3%==..000 if not %a2%==.. set A3=0& goto lose
if %A2%%b2%%c2%%d2%==000.. if not %d1%==.. set d2=0& goto lose
if %A2%%b2%%c2%%d2%==00..0 if not %c1%==.. set c2=0& goto lose
if %A2%%b2%%c2%%d2%==0..00 if not %b1%==.. set b2=0& goto lose
if %A2%%b2%%c2%%d2%==..000 if not %a1%==.. set A2=0& goto lose
if %A1%%b1%%c1%%d1%==000.. set d1=0& goto lose
if %A1%%b1%%c1%%d1%==00..0 set c1=0& goto lose
if %A1%%b1%%c1%%d1%==0..00 set b1=0& goto lose
if %A1%%b1%%c1%%d1%==..000 set A1=0& goto lose
if %b4%%c4%%d4%%e4%==000.. if not %e3%==.. set e4=0& goto lose
if %b4%%c4%%d4%%e4%==00..0 if not %d3%==.. set d4=0& goto lose
if %b4%%c4%%d4%%e4%==0..00 if not %c3%==.. set c4=0& goto lose
if %b4%%c4%%d4%%e4%==..000 if not %b3%==.. set b4=0& goto lose
if %b3%%c3%%d3%%e3%==000.. if not %e2%==.. set e3=0& goto lose
if %b3%%c3%%d3%%e3%==00..0 if not %d2%==.. set d3=0& goto lose
if %b3%%c3%%d3%%e3%==0..00 if not %c2%==.. set c3=0& goto lose
if %b3%%c3%%d3%%e3%==..000 if not %b2%==.. set b3=0& goto lose
if %b2%%c2%%d2%%e2%==000.. if not %e1%==.. set e2=0& goto lose
if %b2%%c2%%d2%%e2%==00..0 if not %d1%==.. set d2=0& goto lose
if %b2%%c2%%d2%%e2%==0..00 if not %c1%==.. set c2=0& goto lose
if %b2%%c2%%d2%%e2%==..000 if not %b1%==.. set b2=0& goto lose
if %b1%%c1%%d1%%e1%==000.. set e1=0& goto lose
if %b1%%c1%%d1%%e1%==00..0 set d1=0& goto lose
if %b1%%c1%%d1%%e1%==0..00 set c1=0& goto lose
if %b1%%c1%%d1%%e1%==..000 set b1=0& goto lose
if %c4%%d4%%e4%%f4%==000.. if not %f3%==.. set F4=0& goto lose
if %c4%%d4%%e4%%f4%==00..0 if not %e3%==.. set E4=0& goto lose
if %c4%%d4%%e4%%f4%==0..00 if not %d3%==.. set D4=0& goto lose
if %c4%%d4%%e4%%f4%==..000 if not %c3%==.. set C4=0& goto lose
if %c3%%d3%%e3%%f3%==000.. if not %f2%==.. set F3=0& goto lose
if %c3%%d3%%e3%%f3%==00..0 if not %e2%==.. set E3=0& goto lose
if %c3%%d3%%e3%%f3%==0..00 if not %d2%==.. set D3=0& goto lose
if %c3%%d3%%e3%%f3%==..000 if not %c2%==.. set C3=0& goto lose
if %c2%%d2%%e2%%f2%==000.. if not %f1%==.. set F2=0& goto lose
if %c2%%d2%%e2%%f2%==00..0 if not %e1%==.. set E2=0& goto lose
if %c2%%d2%%e2%%f2%==0..00 if not %d1%==.. set D2=0& goto lose
if %c2%%d2%%e2%%f2%==..000 if not %c1%==.. set C2=0& goto lose
if %c1%%d1%%e1%%f1%==000.. set F1=0& goto lose
if %c1%%d1%%e1%%f1%==00..0 set E1=0& goto lose
if %c1%%d1%%e1%%f1%==0..00 set D1=0& goto lose
if %c1%%d1%%e1%%f1%==..000 set C1=0& goto lose
if %a1%%b2%%c3%%d4%==000.. if not %d3%==.. set d4=0& goto lose
if %a1%%b2%%c3%%d4%==00..0 if not %c2%==.. set C3=0& goto lose
if %a1%%b2%%c3%%d4%==0..00 if not %b1%==.. set B2=0& goto lose
if %a1%%b2%%c3%%d4%==..000 set A1=0& goto lose
if %a4%%b3%%c2%%d1%==000.. set D1=0& goto lose
if %a4%%b3%%c2%%d1%==00..0 if not %c1%==.. set C2=0& goto lose
if %a4%%b3%%c2%%d1%==0..00 if not %b2%==.. set B3=0& goto lose
if %a4%%b3%%c2%%d1%==..000 if not %a3%==.. set A4=0& goto lose
if %b1%%C2%%D3%%E4%==000.. if not %e3%==.. set E4=0& goto lose
if %b1%%C2%%D3%%E4%==00..0 if not %d2%==.. set D3=0& goto lose
if %b1%%C2%%D3%%E4%==0..00 if not %c1%==.. set C2=0& goto lose
if %b1%%C2%%D3%%E4%==..000 set B1=0& goto lose
if %b4%%C3%%D2%%E1%==000.. set E1=0& goto lose
if %b4%%C3%%D2%%E1%==00..0 if not %d1%==.. set D2=0& goto lose
if %b4%%C3%%D2%%E1%==0..00 if not %c2%==.. set C3=0& goto lose
if %b4%%C3%%D2%%E1%==..000 if not %b3%==.. set B4=0& goto lose
if %c1%%d2%%e3%%f4%==000.. if not %f3%==.. set F4=0& goto lose
if %c1%%d2%%e3%%f4%==00..0 if not %e3%==.. set E3=0& goto lose
if %c1%%d2%%e3%%f4%==0..00 if not %d1%==.. set D2=0& goto lose
if %c1%%d2%%e3%%f4%==..000 set C1=0& goto lose
if %c4%%d3%%e2%%f1%==000.. set F1=0& goto lose
if %c4%%d3%%e2%%f1%==00..0 if not %e1%==.. set E2=0& goto lose
if %c4%%d3%%e2%%f1%==0..00 if not %d2%==.. set D3=0& goto lose
if %c4%%d3%%e2%%f1%==..000 if not %c3%==.. set C4=0& goto lose
exit /b
:winlist
call :board
if %A1%%A2%%A3%%A4%==XXXX goto WIN
if %B1%%B2%%B3%%B4%==XXXX goto WIN
if %C1%%C2%%C3%%C4%==XXXX goto WIN
if %D1%%D2%%D3%%D4%==XXXX goto WIN
if %E1%%E2%%E3%%E4%==XXXX goto WIN
if %F1%%F2%%F3%%F4%==XXXX goto WIN
if %A4%%B4%%C4%%D4%==XXXX goto WIN
if %A3%%B3%%C3%%D3%==XXXX goto WIN
if %A2%%B2%%C2%%D2%==XXXX goto WIN
if %A1%%B1%%C1%%D1%==XXXX goto WIN
if %B4%%C4%%D4%%E4%==XXXX goto WIN
if %B3%%C3%%D3%%E3%==XXXX goto WIN
if %B2%%C2%%D2%%E2%==XXXX goto WIN
if %B1%%C1%%D1%%E1%==XXXX goto WIN
if %C4%%D4%%E4%%F4%==XXXX goto WIN
if %C3%%D3%%E3%%F3%==XXXX goto WIN
if %C2%%D2%%E2%%F2%==XXXX goto WIN
if %C1%%D1%%F1%%E1%==XXXX goto WIN
if %C1%%D1%%e1%%f1%==XXXX goto WIN
if %A1%%B2%%C3%%D4%==XXXX goto WIN
if %A4%%B3%%C2%%D1%==XXXX goto WIN
if %B1%%C2%%D3%%E4%==XXXX goto WIN
if %B4%%C3%%D2%%E1%==XXXX goto WIN
if %C1%%D2%%E3%%F4%==XXXX goto WIN
if %C4%%D3%%E2%%F1%==XXXX goto WIN
exit /B
:calibrate
call start WinMsg.exe -t "4get it? Game" -m "           4 get it?\n             Game\n\n          Calibrate\n            Mouse\n\n       1  2  3  4  5  6" -c SystemModal
Speak-x64.exe -t "click 1"
call :WhenClickGetxY
set /a TextColumn1=!x!
call :MouseTwerk
Speak-x64.exe -t "click 6"
call :WhenClickGetxY
set TextColumn6=!x!
call :MouseTwerk
set /a widthtotal=%TextColumn6%-%TextColumn1%
set /a widthcolumn=%widthtotal%/5
set /a gridmin=%TextColumn1%-(%widthcolumn%/2)
set /a gridmax=%TextColumn6%+(%widthcolumn%/2)
exit /b
:WhenClickGetxY
call MacroCMD-x64.exe /r /m /d:1 /s |findstr "LB"|findstr "LB"
if not %errorlevel%==0 goto :WhenClickGetxY
:GetxY
for /f "tokens=*" %%A in ('MacroCMD-x64.exe /r /m /d:63 /s ^|findstr "x"')do set xystring=%%A
for /F "tokens=2,3 delims= " %%A IN ("!xystring!") do (
for /F "tokens=1,2 delims==" %%D IN ("%%A") do set /a x=%%E
for /F "tokens=1,2 delims==" %%D IN ("%%B") do set /a y=%%E)
exit /b
:MouseTwerk
set P=
for %%A IN ( 15 -15 10 -10 8 -7 6 -5 4 0 ) do (
set /a P+=1
set /a EPx!P!=!x!+%%A)
for /L %%A IN (1,1,10) do (
call setcursorposition-x64.exe !EPx%%A! !y!)
exit /b
:TextBoxMonitor
set /a P+=1
MacroCMD-x64.exe /r /m /d:11 /s |findstr "LB"|findstr "LB"
if %errorlevel%==0 goto :TextBoxMonitor2
MacroCMD-x64.exe /r /m /d:11 /s |findstr "LB"|findstr "LB"
:TextBoxMonitor2
if %P% EQU 200 goto :TextBoxMonitor
if not %errorlevel%==0 goto :TextBoxMonitor
for /f "tokens=*" %%A in ('MacroCMD-x64.exe /r /m /d:63 /s ^|findstr "x"' ) do set xystring=%%A
for /F "tokens=2,3 delims= " %%A IN ("!xystring!") do (
for /F "tokens=1,2 delims==" %%D IN ("%%A") do set /a x=%%E
for /F "tokens=1,2 delims==" %%D IN ("%%B") do set /a y=%%E)
if %x% LSS %gridmin% goto :TextBoxMonitor
if %x% GTR %gridmax% goto :TextBoxMonitor
call :MouseTwerk
set /a selected=(%x%-%gridmin%)/%widthcolumn%+1
set P1=%selected%
Taskkill.exe /F /IM WinMsg.exe
exit /b
:Goodbye
Speak-x64.exe -t "Goodbye"
exit

misol101
Posts: 475
Joined: 02 May 2016 18:20

Re: Batch Games

#14 Post by misol101 » 25 Sep 2020 11:25

Well, here's a decent enough place to list mine, in order of download popularity (all made around 2015-2016, some were updated later):

(open links in separate tab)

CmdRunner
A 3d action game with music, available in both text and pixel versions. Also possible to play fullscreen (Ctrl-Enter, for all versions except cmdrunner.bat). Batch/JS hybrid. Control with cursor keys.
Image
http://www.mediafire.com/download/wj9p9 ... runner.zip

BlockOut
A Blockout (3d Tetris) clone. Also has 2 player mode over network. Control with cursor keys and a bunch of other keys.
Image
http://www.mediafire.com/download/ohyyy ... ockout.zip

MarioRun
A 2d parallax side scroller. Control with cursor keys (make sure to run/jump backwards once the game gets faster or you won't last long).
Image
http://www.mediafire.com/download/4gffc ... riorun.zip

Pong 3D
Pong in 3d, with sound effects. 1 player only, 3 difficulty modes. Control with mouse (easier), or cursor keys (harder).
Image
http://www.mediafire.com/file/ib895y0a2 ... pong3d.zip

Solitaire 3-pack
Includes Klondike, Freecell, and Golf solitaire. Control with keys. (Bonus: In Klondike, press A (shift-a) to make AI play by itself)
Image
http://www.mediafire.com/download/ho7qa ... itaire.zip

Kings of steam
A ridiculous text-based adventure game, Zork style. Easily the game that took the longest to make.
Image
http://www.mediafire.com/download/62ck4 ... fSteam.zip

Also, the Gotoxy/Cmdwiz archive has the following games in the gotoxy-examples folder (try running games.bat for a game menu):
Snake.bat (control with z/x)
World.bat (A "Zelda clone" (well...), unfinished. Control with cursor keys+Ctrl)
Yatzy.bat (Yahtzee clone)
Mastermind.bat (a Mastermind clone)
Flappy.bat (a kind of crappy Flappy Birds-clone). Control by holding down/releasing Ctrl key.
http://www.mediafire.com/download/8xywd ... gotoxy.zip
Last edited by misol101 on 30 Sep 2020 03:38, edited 4 times in total.

Lowsun
Posts: 29
Joined: 14 Apr 2019 17:22

Re: Batch Games

#15 Post by Lowsun » 25 Sep 2020 15:17

I have also made lots of pure Batch games like platformers, rogue-likes, and other stuff. They're are all here

https://lowsun.itch.io/

Post Reply