// A number guessing game (Attmept 1 "Copyed from claude")
#include <iostream>
// input output
#include <cstdlib>
// for the random function
#include <ctime>
// imports time (for the seed)
int main(){
// start
srand(time(0));
// seeds from time (All random numbers have a seed like how every minecraft world has a seed)
int secret = rand() % 100 + 1;
// I have NO IDEA what this dose. int secret rendom then ??? +1?
int guess = 0;
int attempts = 0;
// Guesses and attempts
std::cout<<"I'm thinking of a number between 1 to 100" <<std::endl;
// print
while(guess != secret){
// while guess is NOT = secret
std::cout<<"enter your guess: ";
// print statement
std::cin>>guess;
// takes into guess
attempts++;
// increease attempts by one?
if(guess < secret){
std::cout<<"Too low!";
// screemes too low
}
else if(guess > secret){
std::cout<<"Too high!";
// same but with high
}
else{
std::cout<<"correct you got that in: "<<attempts << " tryes." <<std::endl;
// fancy success message
}
}
return 0;
// end
}