Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
用户:你好,
艾:你好或你好
我如何让聊天机器人说出其中一个但让它随机化?(我正在制作一个聊天机器人,但我将如何做出随机响应而不是相同的通用响应..)
%random% 返回 0 到 32767 之间。 因此使用 %random% 并根据值是奇数还是偶数来更改响应。像这样。
set /a NUMCACHE = %random%%%2 IF %NUMCACHE% == 1 (echo hi) else (echo hello)