Advertisement
ProjectTitan313

Wurmple Evolution

May 29th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.90 KB | None | 0 0
  1. '''
  2. Beautiful and Dusty, small program to show what Wurmple will evolve into.
  3. Written by ProjectTitan313.
  4.  
  5. == Changelog ==
  6.  
  7. 5/29/2013: Seems to be fully working, unless people throw hex PIDs into
  8. decimal section and vice versa. Not sure how to idiotproof.
  9. Add Gen 3/4 support?
  10. '''
  11.  
  12. # Sleep imported for the intro.
  13.  
  14. from time import sleep
  15.  
  16. # *** Function and Variable Setup ***
  17.  
  18. # GetPID() function prompts user to enter a PID,
  19. # looping until entry is valid.
  20.  
  21. def GetPID():
  22.     loopy0 = 0
  23.     CheckPID = '0x1234ABCD'
  24.     while loopy0 == 0:
  25.  
  26.         print("Hex or Decimal format? enter 'hex' or 'dec'")
  27.         CheckPID = input().lower()
  28.         NewPID = CheckPID
  29.  
  30.         if CheckPID == 'hex':
  31.             print("Enter hex PID:")
  32.             NewPID = input()
  33.             CheckPID = int(NewPID,16)
  34.             return CheckPID
  35.             loopy0 = 1
  36.  
  37.         elif CheckPID == 'dec':
  38.             print("Enter the decimal PID:")
  39.             NewPID = input()
  40.             CheckPID = int(NewPID)
  41.             return CheckPID
  42.             loopy0 = 1
  43.          
  44. # GetPID() seems to work just fine. Moving on.
  45.  
  46. def GetEvolution(CheckPID):
  47.     Evolution = int(((CheckPID >> 0x10) % 0xA))
  48.  
  49.     if Evolution >= 0 and Evolution <= 4:
  50.         print("Your Wurmple will evolve into Silcoon (Beautifly)")
  51.  
  52.     elif Evolution >= 5 and Evolution <= 9:
  53.         print("Your Wurmple will evolve into Cascoon (Dustox)")
  54.  
  55.     else:
  56.         print("You somehow ended up with: " + Evolution + ", congrats.")
  57.  
  58. # GetEvolution(CheckPID) seems to work.
  59.  
  60. # Now that funtions are defined, time for the actual program.
  61.  
  62. print("Beautiful and Dusty, by ProjectTitan313.")
  63. print("A small program to predict what Wurmple will evolve into. Gen 5 only.")
  64. print("") # blank line, just for spacing/looking better.
  65. sleep(2)
  66.  
  67. # /intro. The actual execution of the program is quite massive, see below.
  68.  
  69. GetEvolution(GetPID())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement