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

Support generating a random seed from the command-line arguments. #160

Merged
merged 6 commits into from
Dec 18, 2024

Conversation

weilycoder
Copy link
Contributor

@weilycoder weilycoder commented Dec 16, 2024

  • 支持从命令行参数生成固定随机数种子;
  • 顺便重写了部分 utils.py 的内容,未修改或增加任何行为,添加了注释。

不知道需不需要写 test(并且不知道怎么写),所以暂时没写。

一个简单的验证程序:

from cyaron import random, set_seed_from_argv

set_seed_from_argv()

print([random.randrange(8) for _ in range(8)])

如果一切顺利,不带其他命令行参数时,程序应输出 [2, 7, 7, 7, 3, 7, 2, 6]

@Mr-Python-in-China Mr-Python-in-China merged commit a56cc26 into luogu-dev:master Dec 18, 2024
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

Successfully merging this pull request may close these issues.

2 participants