Advertisement
kylemsguy

Story of my life

Dec 1st, 2011
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.40 KB | None | 0 0
  1. #-------------------------------------------------------------------------------
  2. # Name:        Story of my Life
  3. # Purpose:     None at all
  4. #
  5. # Author:      Kyle Zhou
  6. #
  7. # Created:     01/12/2011
  8. # Copyright:   (c) Kyle Zhou 2011
  9. # Licence:     <your licence>
  10. #-------------------------------------------------------------------------------
  11. #!/usr/bin/env python
  12. import math
  13. import random
  14. def main():
  15.     Not_Motivated_To_Do_Work = True
  16.     while Not_Motivated_To_Do_Work:
  17.         Not_Motivated_To_Do_Work = Do_Random_Stuff()
  18.         raw_input()
  19.     print "Now I'm motivated to do work!"
  20.  
  21. def Choose_Random_Task():
  22.     Activities = {
  23.         1 : 'Play Games',
  24.         2 : 'Go on FB',
  25.         3 : 'Talk on MSN',
  26.         4 : 'Write programs',
  27.         5 : "Write useless pseudocode (that actually might function) to describe what you're doing at that moment",
  28.         6 : 'Sleep',
  29.         7 : 'Watch TV',
  30.         8 : 'Tweet',
  31.         9 : 'Eat',
  32.         10 : 'Other stuff'
  33.     }
  34.     Activity_To_Do = math.floor(random.random() * 10 + 1)
  35.     return Activities[Activity_To_Do]
  36.  
  37. def Do_Random_Stuff():
  38.     Task = Choose_Random_Task()
  39.     print Task
  40.  
  41.     # Check if re-motivated to do work
  42.     MotivateNumber = random.random()
  43.     if MotivateNumber < 0.09: # Arbitrarily chosen small number in range [0,1)
  44.         return False
  45.     else:
  46.         return True
  47.  
  48. if __name__ == '__main__':
  49.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement