当前位置:DOS资源站资料中心批处理教程 → 批处理程序五子棋

批处理程序五子棋

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2008-4-22 23:10:04

@echo off&title DOS资源站 www.cmdos.net
setlocal enabledelayedexpansion
mode con cols=48 lines=23
color f0
set x=  ┏━━━━━━━━━━━━━━━━━━━━┓
set y=  ┃   1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9┃
set a=  ┃A ┌┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┐┃
set b=  ┃B ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set c=  ┃C ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set d=  ┃D ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set e=  ┃E ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set f=  ┃F ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set g=  ┃G ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set h=  ┃H ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set i=  ┃I ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set j=  ┃J ├┼┼┼┼┼┼┼┼╋┼┼┼┼┼┼┼┼┤┃
set k=  ┃K ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set l=  ┃L ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set m=  ┃M ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set n=  ┃N ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set o=  ┃O ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set p=  ┃P ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set q=  ┃Q ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set r=  ┃R ├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤┃
set s=  ┃S └┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┘┃
set z=  ┗━━━━━━━━━━━━━━━━━━━━┛
set shu=0
:start
echo %x%
echo %y%
echo %a%
echo %b%
echo %c%
echo %d%
echo %e%
echo %f%
echo %g%
echo %h%
echo %i%
echo %j%
echo %k%
echo %l%
echo %m%
echo %n%
echo %o%
echo %p%
echo %q%
echo %r%
echo %s%
echo %z%

set qi=
set /p qi=输入要下棋的位置 如:10j   
if "%qi%"=="" goto start

set lie=%qi:~0,-1%
set /a u=%lie%+4
set /a v=%lie%+5
set hang=%qi:~-1%
if %shu%==0 set sai=●
if %shu%==1 set sai=○

if %lie% geq 1 (
if %lie% leq 19 (

if %hang%==a set a=!a:~0,%u%!%sai%!a:~%v%!

if %hang%==b set b=!b:~0,%u%!%sai%!b:~%v%!

if %hang%==c set c=!c:~0,%u%!%sai%!c:~%v%!

if %hang%==d set d=!d:~0,%u%!%sai%!d:~%v%!

if %hang%==e set e=!e:~0,%u%!%sai%!e:~%v%!

if %hang%==f set f=!f:~0,%u%!%sai%!f:~%v%!

if %hang%==g set g=!g:~0,%u%!%sai%!g:~%v%!

if %hang%==h set h=!h:~0,%u%!%sai%!h:~%v%!

if %hang%==i set i=!i:~0,%u%!%sai%!i:~%v%!

if %hang%==j set j=!j:~0,%u%!%sai%!j:~%v%!

if %hang%==k set k=!k:~0,%u%!%sai%!k:~%v%!

if %hang%==l set l=!l:~0,%u%!%sai%!l:~%v%!

if %hang%==m set m=!m:~0,%u%!%sai%!m:~%v%!

if %hang%==n set n=!n:~0,%u%!%sai%!n:~%v%!

if %hang%==o set o=!o:~0,%u%!%sai%!o:~%v%!

if %hang%==p set p=!p:~0,%u%!%sai%!p:~%v%!

if %hang%==q set q=!q:~0,%u%!%sai%!q:~%v%!

if %hang%==r set r=!r:~0,%u%!%sai%!r:~%v%!

if %hang%==s set s=!s:~0,%u%!%sai%!s:~%v%!


if %hang%==t goto start
if %hang%==u goto start
if %hang%==v goto start
if %hang%==w goto start
if %hang%==x goto start
if %hang%==y goto start
if %hang%==z goto start

if %shu%==0 (
set shu=1
goto start
)
if %shu%==1 set shu=0
goto start
)
)
goto start