可以直接用w,a,s,d控制坐标
但需要choice命令,choice下载地址:http://www.bathome.net/thread-1726-1-1.html
还未加入判断输赢的功能- @echo off
- title 五子棋单机版
- color 60
- mode con: cols=34 lines=18
- setlocal enabledelayedexpansion
- set f1t1=└
- set f16t1=┘
- set f1t16=┌
- set f16t16=┐
- FOR /L %%e IN (2,1,15) DO set f%%et1=┴
- FOR /L %%f IN (2,1,15) DO set f1t%%f=├
- FOR /L %%g IN (2,1,15) DO set f16t%%g=┤
- FOR /L %%h IN (2,1,15) DO set f%%ht16=┬
- FOR /L %%i IN (2,1,15) DO (
- FOR /L %%j IN (2,1,15) DO set f%%it%%j=┼
- )
- set xzh=8
- set xzz=8
- set noo=黑
- set er=a
- :xs
- cls
- echo %f1t16%%f2t16%%f3t16%%f4t16%%f5t16%%f6t16%%f7t16%%f8t16%%f9t16%%f10t16%%f11t16%%f12t16%%f13t16%%f14t16%%f15t16%%f16t16%
- echo %f1t15%%f2t15%%f3t15%%f4t15%%f5t15%%f6t15%%f7t15%%f8t15%%f9t15%%f10t15%%f11t15%%f12t15%%f13t15%%f14t15%%f15t15%%f16t15%
- echo %f1t14%%f2t14%%f3t14%%f4t14%%f5t14%%f6t14%%f7t14%%f8t14%%f9t14%%f10t14%%f11t14%%f12t14%%f13t14%%f14t14%%f15t14%%f16t14%
- echo %f1t13%%f2t13%%f3t13%%f4t13%%f5t13%%f6t13%%f7t13%%f8t13%%f9t13%%f10t13%%f11t13%%f12t13%%f13t13%%f14t13%%f15t13%%f16t13%
- echo %f1t12%%f2t12%%f3t12%%f4t12%%f5t12%%f6t12%%f7t12%%f8t12%%f9t12%%f10t12%%f11t12%%f12t12%%f13t12%%f14t12%%f15t12%%f16t12%
- echo %f1t11%%f2t11%%f3t11%%f4t11%%f5t11%%f6t11%%f7t11%%f8t11%%f9t11%%f10t11%%f11t11%%f12t11%%f13t11%%f14t11%%f15t11%%f16t11%
- echo %f1t10%%f2t10%%f3t10%%f4t10%%f5t10%%f6t10%%f7t10%%f8t10%%f9t10%%f10t10%%f11t10%%f12t10%%f13t10%%f14t10%%f15t10%%f16t10%
- echo %f1t9%%f2t9%%f3t9%%f4t9%%f5t9%%f6t9%%f7t9%%f8t9%%f9t9%%f10t9%%f11t9%%f12t9%%f13t9%%f14t9%%f15t9%%f16t9%
- echo %f1t8%%f2t8%%f3t8%%f4t8%%f5t8%%f6t8%%f7t8%%f8t8%%f9t8%%f10t8%%f11t8%%f12t8%%f13t8%%f14t8%%f15t8%%f16t8%
- echo %f1t7%%f2t7%%f3t7%%f4t7%%f5t7%%f6t7%%f7t7%%f8t7%%f9t7%%f10t7%%f11t7%%f12t7%%f13t7%%f14t7%%f15t7%%f16t7%
- echo %f1t6%%f2t6%%f3t6%%f4t6%%f5t6%%f6t6%%f7t6%%f8t6%%f9t6%%f10t6%%f11t6%%f12t6%%f13t6%%f14t6%%f15t6%%f16t6%
- echo %f1t5%%f2t5%%f3t5%%f4t5%%f5t5%%f6t5%%f7t5%%f8t5%%f9t5%%f10t5%%f11t5%%f12t5%%f13t5%%f14t5%%f15t5%%f16t5%
- echo %f1t4%%f2t4%%f3t4%%f4t4%%f5t4%%f6t4%%f7t4%%f8t4%%f9t4%%f10t4%%f11t4%%f12t4%%f13t4%%f14t4%%f15t4%%f16t4%
- echo %f1t3%%f2t3%%f3t3%%f4t3%%f5t3%%f6t3%%f7t3%%f8t3%%f9t3%%f10t3%%f11t3%%f12t3%%f13t3%%f14t3%%f15t3%%f16t3%
- echo %f1t2%%f2t2%%f3t2%%f4t2%%f5t2%%f6t2%%f7t2%%f8t2%%f9t2%%f10t2%%f11t2%%f12t2%%f13t2%%f14t2%%f15t2%%f16t2%
- echo %f1t1%%f2t1%%f3t1%%f4t1%%f5t1%%f6t1%%f7t1%%f8t1%%f9t1%%f10t1%%f11t1%%f12t1%%f13t1%%f14t1%%f15t1%%f16t1%
- title 用w,a,s,d键控制方向,按f下%noo%棋
- choice /c wasdf /n
- set tmmp=%errorlevel%
- if %er%==a goto ere
- if %xzh%==1 (
- if %xzz%==16 set f%xzh%t%xzz%=┌
- )
- if %xzh%==1 (
- if %xzz%==1 set f%xzh%t%xzz%=└
- )
- if %xzh%==16 (
- if %xzz%==1 set f%xzh%t%xzz%=┘
- )
- if %xzh%==16 (
- if %xzz%==16 set f%xzh%t%xzz%=┐
- )
- if %xzh%==1 (
- if %xzz% leq 15 (
- if %xzz% geq 2 set f%xzh%t%xzz%=├
- )
- )
- if %xzh%==16 (
- if %xzz% leq 15 (
- if %xzz% geq 2 set f%xzh%t%xzz%=┤
- )
- )
- if %xzz%==16 (
- if %xzh% leq 15 (
- if %xzh% geq 2 set f%xzh%t%xzz%=┬
- )
- )
- if %xzz%==1 (
- if %xzh% leq 15 (
- if %xzh% geq 2 set f%xzh%t%xzz%=┴
- )
- )
- if %xzz% leq 15 (
- if %xzh% leq 15 (
- if %xzz% geq 2 (
- if %xzh% geq 2 set f%xzh%t%xzz%=┼
- )
- )
- )
- :ere
- if %tmmp% neq 5 (
- if %tmmp%==1 set /a xzz=%xzz%+1&set er=s
- if %tmmp%==2 set /a xzh=%xzh%-1&set er=s
- if %tmmp%==3 set /a xzz=%xzz%-1&set er=s
- if %tmmp%==4 set /a xzh=%xzh%+1&set er=s
- )
- if %tmmp%==5 (
- if %noo%==黑 (
- set er=a
- set f%xzh%t%xzz%=●
- set noo=白
- goto xs
- )
- if %noo%==白 (
- set er=a
- set f%xzh%t%xzz%=○
- set noo=黑
- goto xs
- )
- )
- if %noo%==黑 set f%xzh%t%xzz%=¤
- if %noo%==白 set f%xzh%t%xzz%=¤
- goto xs
复制代码
[ 本帖最后由 嘟嘟猪 于 2008-10-1 22:05 编辑 ] |