Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Shiny Pokémon
- //Program by Hydreigon_Lord
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- srand(time(0));
- unsigned short trainerID = rand();
- cout << "Trainer ID = " << trainerID << endl;
- unsigned short secretID = rand();
- cout << "Secret ID = " << secretID << endl;
- int numAttempts = 0;
- unsigned int personalityValue = 0;
- while (true)
- {
- numAttempts++;
- personalityValue = (rand() << 16) + rand();
- unsigned short highWord = personalityValue >> 16;
- unsigned short lowWord = (personalityValue << 16) >> 16;
- unsigned short diff = (trainerID ^ secretID) ^ (highWord ^ lowWord);
- if (diff < 16)
- {
- cout << "Shiny found!\nDifference = " << diff << endl;
- break;
- }
- }
- cout << "Personality value = " << personalityValue << endl;
- cout << "Attempts = " << numAttempts << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement