Advertisement
j311yf1sh

Untitled

Jan 16th, 2012
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.02 KB | None | 0 0
  1. #############################################################
  2. #       JellyCrack!(plan to change name to Jellybrute)      #
  3. #                                                           #
  4. #       Creator: Jellyfish                                  #
  5. #       Version: 1.3       Date: Sunday june 5th 2011       #
  6. #                                                           #
  7. #      Description:                                         #
  8. #      JellyCrack!, is a program that simulates pressing    #
  9. #      random button's on the keyboard until it matches     #
  10. #      your previously supplied word.                       #
  11. #                                                           #
  12. #      Instructions:                                        #
  13. #      Run JellyCrack!, and input the letters of your       #
  14. #      word one at a time in lowercase.                     #
  15. #      Example: enter letter "j", Press enter/return,       #
  16. #      Enter second letter "e", Press enter/return,         #
  17. #      Enter Third letter "l", Press enter/return.          #
  18. #      It's that easy.                                      #
  19. #                                                           #
  20. #      Future:                                              #
  21. #      Plan to implement some more stuff, Fix code to make  #
  22. #      it faster.                                           #
  23. #                                                           #
  24. #      Used: Attempted to calculate "jellyfish".            #
  25. #      went through one billion combo's in 24 hours         #
  26. #      never used to calculate anything longer then         #
  27. #      3 letters with success.                              #
  28. #############################################################
  29.  
  30. #imports
  31. from math import * #probs dont need lol
  32. from random import * #imports random
  33. from sys import exit #imports exit
  34. import os #import OS to use the "clear" command
  35. import time
  36.  
  37. #Variables And Lists
  38. NameList = list() #List of letters that the if statements add to
  39. ListOfName = list() #List holding your letters that you entered
  40. NameLength = 0 #holds 0 to make the first loop continue.
  41. Name = len(ListOfName) #Testing to remove the input needed for number of letters
  42. Numberround = 0 #how long is the list of letters
  43. testy = 0 #how many loop rotations has passed aka combo's
  44. CombosPerSecond = 0
  45. ListOfLetters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
  46. #timeVars
  47. StartTime = time.time()
  48. EndTime = time.time()
  49. ElapsedTimeSeconds = 0
  50. ElapsedTimeMinutes = 0
  51. ElapsedTimeHours = 0
  52. #Checking user inputs for word
  53. while NameLength == 0: #Easiest way to make a do until type loop
  54.    
  55.     os.system("clear") #clear Screen
  56.    
  57.     #Print all of the instructions / Titles to the screen
  58.     print "                             JellyCrack!"
  59.     print "         input the letters of your word one at a time in lowercase."
  60.     print "         Example: enter letter 'j', Press enter/return"
  61.     print "         Enter second letter 'e', Press enter/return"
  62.     print "         Enter Third letter 'l', Press enter/return"
  63.     print "         When Finished press 'Space' then enter/return\n"
  64.     print "         Your current letters are: ",ListOfName,"\n" #print Letters used so far
  65.  
  66.     #get input
  67.     Namey = raw_input("         Letter Input: ")
  68.  
  69.     #append your input to
  70.     ListOfName.append(Namey)
  71.  
  72.     #if it detects user has entered a space it will run this removing the space
  73.     # and adding 1 to namelegnth to break the loop
  74.     if ' ' in Namey:
  75.         ListOfName.remove(' ')#remove the space
  76.         NameLength+= 1
  77.  
  78. #input for the number of letters
  79. Number = raw_input("         How many letters? ")
  80. ConvNum = int(Number) #turns your input from string > integer
  81. Numbert = ConvNum + 1 #Plus 1 to converted number so it works for some reason
  82.                       # if it doesnt + 1 it will be an endless loop
  83.  
  84.  
  85. #main loop that creates a random int between 1 - 26(alphabetical order)
  86. #once a number has been given it then cross checks it with its correspeonding
  87. #letter and appends it to a list
  88.  
  89. StartTime = time.time()
  90.  
  91. while NameList != ListOfName:
  92.  
  93.  
  94.     os.system("clear") #Clear Screen
  95.     #printing Information
  96.  
  97.     #title
  98.     print "\n                             JellyCrack! \n"
  99.     #Working
  100.     print "                  JellyCrack is now wobbling away... \n"
  101.     #Current combination
  102.     print "                  Current word is: ",NameList,"\n"
  103.     #how many combos have been checked?
  104.     print "                  Combination's tried: ", testy
  105.     print "\n                 ",ElapsedTimeHours,"Hour's",ElapsedTimeMinutes,"Minute's",ElapsedTimeSeconds,"Second's"
  106.     print "\n                  Combo's Per Second:",CombosPerSecond,"\n"
  107.     Letter = randint(0,25) #gets random integer
  108.  
  109.     #Pretty self explanatory
  110.     NameList.append(ListOfLetters[Letter])
  111.  
  112.     Numberround+=1 #adds 1 to numberround
  113.     testy+=1 #adds 1 to how many combo's or times this loop has passed
  114.     EndTime = time.time()
  115.  
  116.     ElapsedTimeTrue = EndTime - StartTime
  117.     ElapsedTimeSeconds = int(ElapsedTimeTrue)
  118.     ElapsedTimeMinutes = ElapsedTimeSeconds / 60 / 60
  119.     ElapsedTimeHours = ElapsedTimeSeconds / 60 /60 / 60
  120.     CombosPerSecond = testy / ElapsedTimeTrue
  121.    
  122.     #Checks if the list is longer then the letters in our word
  123.     #While  List is longer then our number
  124.     while Numberround >= Numbert:
  125.         NameList.pop(0) #remove one from 0 position
  126.         Numberround-= 1 #make length less then our number
  127.  
  128. #printing Information
  129.  
  130. #Clear screen
  131.  
  132. os.system("clear")
  133.  
  134. #timestop
  135.  
  136.  
  137. #title
  138. print "\n                             JellyCrack! \n"
  139. #Working
  140. print "                  JellyCrack wobbling was a success...\n"
  141. #word
  142. print "                  Your word: ",NameList,"\n"
  143. print "                  Combination's taken: ",testy,"\n"
  144. print "                  ",ElapsedTimeHours,"Hour's",ElapsedTimeMinutes,"Minute's",ElapsedTimeSeconds,"Second's\n"
  145. print "                  Combo's Per Second:",CombosPerSecond,"\n"
  146.  
  147. exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement