-
Notifications
You must be signed in to change notification settings - Fork 142
add feature - generate random problem #9
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
Conversation
use "cargo run random" to generate a random problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM.
And this idea is interesting 😜
src/main.rs
Outdated
match id_arg.as_ref() { | ||
"random" => { | ||
println!("You select random mode."); | ||
id = get_random_id(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the problem is locked or don't have a rust version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, current implementation has such limitation.
Do you think we should verify whether the problem of generated id meet these two requirement at first? And regenerate an id that meets these two requirement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition, using random mode to generate problems results in the disorder of lib.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I think it is nice to have the ID re-generation, but a proper error message is also okay.
- It's not a problem, we don't have an order guarantee for
lib.rs
Now that using "cargo run" is ok! Then the user could follow the guide of the system output to do what he/she wants to do (e.g., generate a random problem or select a particular problem).
Now that the program can handle the case that the problem has no rust version. However, I don't know what "the problem is locked" means? Could you please say it in more details? |
I mean some problems are only available for leetcode premium, the subscription plan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, is this PR ready to merge? @yue2388253
Sorry to late reply. This PR is ready for merge. BTW, recently I am preparing my paper and thus might not be able to work on this repo. |
@yue2388253 Thanks! |
use "cargo run random" to generate a random problem.