level 3
如题,(╯‘□′)╯(┻━┻什么错误都没找到......显示此时不应有else
@echo off&setlocal enabledelayedexpansion
set /a all=%random%%%50+5
set /a one=%random%%%5+1
echo 总数=%all%
echo 次数=%one%
set /p player=Who first?(0=computer and 1=human)
if not !player!== 0 (
if not !player!== 1 (
goto :error)
)
echo Start!
set /a now=0,add=!one!+1
if !player!==0 (
set /a win=!all!-1
set /a now0=!win!-!now!
if !now0! lss !one! (
set /a now=!win! )else(
set /a mustwin=!now0!%%!one!
if !mustwin!==0 (
if !now!==!win! (
set now==!all!
goto :cend
)
set /a now+=%random%%%!one!+1
goto :cend)else(
set /a now+=!mustwin!
goto :cend
)
)
:cend
echo computer say:!now!
if !now!==!all! (
echo You win!
)
:error
echo "Sorry,Something worry"&pause>nul
(代码还是半成品)
2014年10月26日 11点10分
1
@echo off&setlocal enabledelayedexpansion
set /a all=%random%%%50+5
set /a one=%random%%%5+1
echo 总数=%all%
echo 次数=%one%
set /p player=Who first?(0=computer and 1=human)
if not !player!== 0 (
if not !player!== 1 (
goto :error)
)
echo Start!
set /a now=0,add=!one!+1
if !player!==0 (
set /a win=!all!-1
set /a now0=!win!-!now!
if !now0! lss !one! (
set /a now=!win! )else(
set /a mustwin=!now0!%%!one!
if !mustwin!==0 (
if !now!==!win! (
set now==!all!
goto :cend
)
set /a now+=%random%%%!one!+1
goto :cend)else(
set /a now+=!mustwin!
goto :cend
)
)
:cend
echo computer say:!now!
if !now!==!all! (
echo You win!
)
:error
echo "Sorry,Something worry"&pause>nul
(代码还是半成品)