Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import std.stdio, std.random, std.conv, std.string;
- int rnd_number(){
- immutable num = uniform(1, 25);
- return num;
- }
- int main(){
- int solution = rnd_number();
- int guess;
- for(int x = 0; x < 3; x++){
- write(": ");
- readf("%d", &guess);
- if(guess == solution){
- writeln("YEEEEEAAAHHHH");
- return 0;
- } else if(guess < solution){
- writeln("more...");
- } else {
- writeln("too much...");
- }
- }
- writeln("oh no.., the number was: ", solution);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement