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

部屋作りすぎるとまずい #4

Open
TwoSquirrels opened this issue Aug 27, 2024 · 1 comment
Open

部屋作りすぎるとまずい #4

TwoSquirrels opened this issue Aug 27, 2024 · 1 comment

Comments

@TwoSquirrels
Copy link
Member

TwoSquirrels commented Aug 27, 2024

まず部屋数が 1000000 を超えるとここで無限ループする上、近づくだけでもかなり時間がかかると予想され危険です。

do {
name = format("{:0{}}", dist(gen_rand), name_length);
} while (name_to_id.contains(name));

そもそも部屋番号が推測できるべきではないため、部屋数上限の設定可能範囲を 1~500000 ぐらいにして実行時チェックさせるのがよさそう。1000 超えてたら警告出すとか

@TwoSquirrels
Copy link
Member Author

優先順位はめちゃ低なので、とりあえず放置で

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