Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[新功能]变量机制添加随机整数变量 #654

Open
WangJianG584 opened this issue Mar 18, 2025 · 0 comments
Open

[新功能]变量机制添加随机整数变量 #654

WangJianG584 opened this issue Mar 18, 2025 · 0 comments

Comments

@WangJianG584
Copy link

目前的随机数脚本
setVar:a=random();
只能随机小数部分,可以扩展到整数,但小数点无法舍去
我提议使用
setVar:a=random(int);
提供int范围的整数,如果要规定最大值,可以取余,如果规定最小值就加上对应的数,
如果要同时规定最大值和最小值,变量为a,最大值为b,最小值为c
运算为
setVar:e=a%(b-c)+c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant