本帖最后由 bailong360 于 2015-3-15 10:07 编辑
- @Echo Off 2>nul 3>nul
- Set /P Player1=请输入玩家1姓名:
- Set /P Player2=请输入玩家2姓名:
- :Start
- Set /A N+=1
- Set .%N%=
- >nul Set .9||Goto Start
- :Loop
- echo %.1%丨%.2% 丨%.3%
- echo ─┼─┼─
- echo %.4%丨%.5% 丨%.6%
- echo ─┼─┼─
- echo %.7%丨%.8% 丨%.9%
- Set /P Turn=请玩家%Player1%落子:
- Set ..%Turn%&&Goto :Eof
- Set .%Turn%=O
- Set ..%Turn%=0
- Set "_%.1%%.2%%.3%=0"
- Set "_%.4%%.5%%.6%=0"
- Set "_%.7%%.8%%.9%=0"
- Set "_%.1%%.4%%.7%=0"
- Set "_%.2%%.5%%.8%=0"
- Set "_%.3%%.6%%.9%=0"
- Set "_%.1%%.5%%.9%=0"
- Set "_%.3%%.5%%.7%=0"
- >nul Set _OOO&&(Echo 玩家%Player1%胜利&Pause&Goto :Eof)
- Set /P Turn=请玩家%Player2%落子:
- Set ..%Turn%&&Goto :Eof
- Set .%Turn%=X
- Set ..%Turn%=0
- Set "_%.1%%.2%%.3%=0"
- Set "_%.4%%.5%%.6%=0"
- Set "_%.7%%.8%%.9%=0"
- Set "_%.1%%.4%%.7%=0"
- Set "_%.2%%.5%%.8%=0"
- Set "_%.3%%.6%%.9%=0"
- Set "_%.1%%.5%%.9%=0"
- Set "_%.3%%.5%%.7%=0"
- >nul Set _XXX&&(Echo 玩家%Player2%胜利&Pause&Goto :Eof)
- Goto Loop
复制代码 符合要求否? |