基本上,我设置了一个问题,如果我回答“打断”,它应该说“你决定最终走到那里......”,然后在这个问题下,“这个人会有什么反应?” 然后,它应该从 1-21 生成一个随机数,然后暂停。但是,当我回答“中断”时,它会关闭程序。虽然,当我移除随机数生成器时,它会在“这个人将如何反应?”之后暂停工作。我可以退出。数字生成器有什么问题?
这是代码:
echo Do you interrupt or wait until they are finished talking?
echo.
set /p choice=
if %choice%==interrupt (
echo You decide to finally walk over there. You ask the man who is telling the story, "So what's in the labyrinth?"
echo How does the man react?
pause
set /a num=((20 + 1) * %random%) / 32768 + 1
echo %num%
pause
exit
)
感谢大家阅读和/或回复!