<repo_name>bububa/Clear-History<file_sep>/clearhistory.py
import time
from cmd import *
	
#----------------------------------------------------------------------------------
# Intro
#----------------------------------------------------------------------------------
clear()

raw_input("Press enter to begin...")

print("MyCustomOS")
time.sleep(0.4)
print("Loading CoreOSFiles")
say(1.1, "Connecting to the network")
say(1.2, "Connected")
say(1.1, "Initializing myCustomChat")
say(1.3, "Error! Send function not initialized")
say(1.1, "No friends online")
say(1.1, "Reading from USB")
say(1.2, "Now executing Training Program")
time.sleep(3)
clear()
load_commands()

#==================================================================================
# Stage 1
#----------------------------------------------------------------------------------
# Very early in the morning.
# This takes place in the offices of Pheonixeon Corp.
# The protagonist is just starting his new job as a security consultant.
# He enters an empty room. He then inserts a USB flash drive into his computer as
# he was instructed by his manager over the phone.
#==================================================================================

load_stage_1()

managerName = "<NAME>" #Just so I can change it easily if I want.

say(0, "Hello, I'm " + managerName + ".\n")

say(1, "I'm sorry that I had you bring your own laptop.\nYour office isn't yet ready so you have to use the empty storage room for now.\nI have something to do so I can't come in to work today\nbut I think we can start training with this USB flash drive with instructions.\nLets Begin.\n")

raw_input("Press Enter to Continue")

say(1, "First, I'll teach you how to connect to other computers on the network.\nType 'connect The name of the computer'.\n")
say(1,  "The computers on this network are usually called 'full name of the employee'\n followed by their 'job'.\n")
say(1, "The names don't have any spaces, only underscores.\n")

raw_input("Press Enter to Continue")

say(1, "Now, I want you to connect to 'Steve_Waller_Security_Consultant'\nIt's case-sensitive so be sure to remember.\n")

raw_input("Press Enter to Continue")

say(2, "\nMost of the time.\n The computers will be password protected.\nYou can easily bypass it with the 'crack' command.\n")
say(1, "That won't completely do all the work for you but it'll make it easier.\nIt'll show you the amount of letters the password is along with hints \nof some letters contained.\n")

raw_input("Press Enter to Continue")

say(1, "Just type in a letter at a time to check if it's contained in the word.\nKind of like 'Hangman'\n")
say(1, "Now crack the password.")
say(1, "type: crack Steve_Waller_Security_Consultant\n")

while True:
	if cmd() == ["crack", "Steve_Waller_Security_Consultant"] : break

say(1, "\nNow that the password has been entered, you can connect to it.\n")
say(1, "You type it in this format: connect (name_of_computer)\nNow connect to Steve_Waller_Security_Consultant\n")
	
while True:
	if cmd() == ["connect", "Steve_Waller_Security_Consultant"] : break

say(1, "\nTo see all the files contained in the computer use the 'ls' command.\n")
say(1, "type: ls\n")

while True:
	if cmd() == ["ls"]: break

say(1, "\nTo read files use the 'cat' command\nfollowed by the file you want to read.\n")
say(1, "In this format: cat (name_of_file)\nTry reading SteveMail.hist.\n")

while True:
	if cmd() == ["cat", "SteveMail.hist"]: break

say(1.5, "Good. Now try to decrypt employLst.lst by using the 'decrypt' command\nfollowed by the filename and password(if you have it).\n")
say(1, "That command brings up the jumbled keyword.\nThe letters in the keyword are shifted by a certain number.\n")

raw_input("Press Enter to Continue")

say(1, "For example 'a' shifted by -1 will be 'z'.\nAnd if 'a' is shifted by 1 it will be 'b'.\nIts your job to find out the decryption code\n(the number of letters the keyword is shifted by.)\n")

raw_input("Press Enter to Continue")

say(1, "You can use the keyword 'scan' followed the name of the computer to view its specs.\n")
say(1, "In this format to reveal the jumbled word: decrypt (filename)\n")
say(1, "In this format to enter the password: decrypt (filename) (Password)\n")
say(1, "Type this to see the specs: scan (Name_Of_Computer)\n")
say(1, "Now decrypt employLst.lst\n")

while True:
	if cmd() == ["decrypt", "employLst.lst", "password"]: break

say(1, "\nGood. Now I'm going to need you to retrieve all the files from the computer.")
say(1, "Use the 'download' command followed by the filename\nto download any file to your computer.\n")
say(1, "Like this: download (filename)\n")

while True:
	cmd()
	if "savedFragment2.ry"in Home_Computer.files and "SteveMail.hist" in Home_Computer.files and "employLst.lst" in Home_Computer.files: break

say(1, "\nOnce you've downloaded the file,\ndisconnect from the computer by using the 'disconnect' function.\n")
say(1, "Format: disconnect\n")

while True:
	if cmd() == ["disconnect"] : break

say(1, "\nNow upload savedFragment2.ry to using the 'upload' command\nfollowed by the fileame you want to upload, then the computer name.\n")
say(1, "Format: upload (filename) (Name_Of_Computer)")
say(0, "Send it to 'Amitav_Gutipaty_Manager'\n")

while True:
	if cmd() == ["upload", "savedFragment2.ry", "Amitav_Gutipaty_Manager"]: break

say(2, "\nYou have just given me highly classified information about the company.\nBut since this company has a closed network I couldn't get in it through the inside computers.\n")
say(1, "But with your computer I could access the internet\nand everything will be traced back to you.\n")
say(5, "Good Bye")
say(9, "")

fill_screen()

clear()

#====================================================================================
# Stage 2
#------------------------------------------------------------------------------------
# The protagonist has just been told that he's been had.
#=====================================================================================

load_stage_2()

girlName = "HaxorGurl"
imGirl = girlName + " says: "

say(4, girlName + " is now online.")
say(3, imGirl + "Hey!")
say(2, imGirl + "its really early!")
say(3, imGirl + "Aren't u supposed to be @ work?! o_0")
say(2, imGirl + "Answer me! >_<")
say(4, imGirl + "Dats it! I'm scanning u! >:D")
say(5, imGirl + "Ohh! you ARE at work....")
say(3.8, imGirl + "lol, you're using David's crappy ass OS?!")
say(2.3, imGirl + "It doesn't let you send messages, huh?")
say(2.4, imGirl + "You know he just used that to spy on girls' conversations...")
say(2.1, imGirl + "Anyways~")
say(3.3, imGirl + "I just read on a blog..")
say(3.5, imGirl + "that the company you now work for just got hacked.")
say(3.5, imGirl + "The blog says that the company is not letting anybody leave")
say(2.3, imGirl + "until they catch the culprit.")
say(3.3, imGirl + "So far the only leads the cops have is a new employee")
say(5, imGirl + "was seen bringing a personal laptop. But they can't find him.")
say(3, imGirl + "Wait a minute...")
say(1, imGirl + "Thats....")
say(6, imGirl + "you!")
say(4.2, imGirl + "that's strange though,")
say(3.2, imGirl + "because this other guy is taking credit for it.")
say(2, imGirl + "But he says the cops will never find him cuz he's in hiding.")
say(3.3, imGirl + "it must be a mistake, you have to clear your name...")
say(3.5, imGirl + "look around the network for some proof!")
say(3.2, imGirl + "before the cops find you. D:")
say(3.1, imGirl + "If you want,")
say(5, imGirl + "you can upload files to me and I'll see if i can helps. :3")
say(2.1, imGirl + "Just upload to 'haxorgurl'.")
say(4.1, imGirl + "Don't worry, I'll give you the files back")
say(6.1, imGirl + "A word to the wise...")
say(4, imGirl + "Download anything that might be useful later")
say(3, imGirl + "Try connecting to some computers on the network...")
say(5.3, imGirl + "Now get to searchinnnN!!!!")

while True:
	cmd()
	if "savedFragment3.ih" in Home_Computer.files and "savedFragment0.jby" in Home_Computer.files: break

say(3, "SECURITY TRIGGERED")
say(3.3, "NOW TRIGGERING SECURITY MEASURES")

fill_screen()

clear()

#======================================================================================
# Stage 3
#--------------------------------------------------------------------------------------
# Security was just triggered which means all the computers were switched.
#============================================================================================

load_stage_3_1()

say(1.5, imGirl + "wut was dat?! D:")
say(2.2, imGirl + "An update on that dude's blog...")
say(3, imGirl + "he says that security\nhas been activated.")
say(2.3, imGirl + "o_o")
say(6, imGirl + "not")
say(6, imGirl + "good")
say(2.1, imGirl + "pick up the pace!")
	
while True:
	cmd()
	if final_conditions() == True: break

fill_screen()

clear()

load_stage_3_2()

say(1, imGirl + "what cause thkat/")
say(2.2, imGirl + "caused that?")
say(2.3, imGirl + "send the file to me")

while True:
	if cmd() == ["upload", "pandorasBox.exe", "haxorgurl"]: break

say(1.1, imGirl + "lets see")
say(1, imGirl + "har harhahar har!!!")
say(2.5, imGirl + "this guy is a dummy! XD")
say(2.5, imGirl + "He wrote this from his home computer!!")
say(3, imGirl + "I was able to extract all his location information!!!")
say(2.3, imGirl + "Imma give this to the cops.")
say(2.3, imGirl + "maybe I'll get a reward for giving tips hehehe :P")
say(1.2, imGirl + "brb")
say(10, imGirl + "urgh, they put me on hold >:C")
say(5, imGirl + "okay hold on, they're processing.")
say(5, imGirl + "haha they said my tip was helpfulllll ^^")
say(2.5, imGirl + "oh, Pheonixeon's website posted something!")
say(3, imGirl + "'Thanks to an anonymous tip,")
say(3, imGirl + "the hacker has been identified as a recently laid off employee.")
say(5, imGirl + "Even though he just hacked through our least important")
say(3, imGirl + "and least secure network we are working our hardest to get things")
say(2, imGirl + "back to normal.'")
say(4, imGirl + "That was damn quick!")
say(3, imGirl + "They're not a top company for nothing...")
say(1, imGirl + "it seems that you're off the hook! :D")
say(2.5, imGirl + "but this pandora file.....")
say(2.5, imGirl + "only contains personal conversations between employees...")
say(5, imGirl + "I guess that's all the 'least important' network contained.")
say(2.3, imGirl + "either way, congrats on your new job XD")
say(2.3, imGirl + "well, i'm off! see ya after work!")
say(1.4, imGirl + "oh...")
say(3.5, imGirl + "The guy's fetish....")
say(4, imGirl + "is peanut butter....go figure :/")
say(1, girlName + " is now offline.")

# EXIT the game
<file_sep>/Constants.py
# This string is shown when user enters the 'ls' command
file_header = """
Files:
-------"""

Haxor_Gurl_Responses = { "SteveMail.hist" : "A cute new employee? I wonder who she means? o_o That must be quite a fetish!", 
						"RichardMemo.txt" : "So if somebody triggers security the computers available to you are switched around? Weird. :/",
						"ses.png" : ">:/ This isn't the time for this!! @_@; poor donkey.",
						"employees.lst" : "Dang o_O! That Sally is quite old for a receptionist.",
						"TyrellaMail.hst" : "No doubt that 'new recruit' is u, huh. :p",
						"AmitavMemo.txt" : "....Does he mean the file extensions? I guess you have to read them in order?",
						"savedFragment0.jby" : "They seem to be numbered. Try to collect all of them together in your computer.^^",
						"savedFragment1.ihc" : "They seem to be numbered. Try to collect all of them together in your computer.^^",
						"savedFragment2.ry" : "They seem to be numbered. Try to collect all of them together in your computer.^^",
						"savedFragment3.ih" : "They seem to be numbered. Try to collect all of them together in your computer.^^",
						"pandorasBox.exe" : "Thnx ^_^"}
						
Haxor_Random_Responses = ["I don't know what to tell you.", "I don't know what this is.", "I dunno what this is. :(", "Sorry, I can't help you with this.", "You're on your on on this one. :)"]

# This string is shows when the user enters 'help' command
help = """
<> = required, || = optional
ls				List files on current computer
cat <file>			Displays file
connect <computer>		Connect to given computer
disconnect 			Return to home computer
scan <computer>			Get information on given computer
crack <computer> |password|	Crack given computer's password
decrypt <file>			Decrypt encrypted file
download <file>			Download file to home computer
upload <file> <computer>	Upload given file to given computer
help 				Provides help information
"""

home_computer = """
My Computer
---------------------------
CPU: Intel Celeron D @ 1.3 Ghz
RAM: 256 MB 
OS: MyCustomOS
"""

Steve_Waller_Security_Consultant = """
<NAME>er Securty Consultant
----------------------------------------
CPU: Intel i7 Extreme 8 cores @ 3.4 GHz
RAM: 8GB
OS: Windows8
"""

Steve_Mail = """
------------------------------------------------------------
From: <NAME>
Hey, do you remember the encryption code for our employee
files?
						
To: <NAME>
Why do you want to know? And hey, how about dinner tonight?

From: <NAME>
I told you, Steve! We're over! Now just tell me the code!!

To: <NAME>
It's against policy to say! You're a receptionist! why the
hell would you want to know the code?! Only Security Consultants
would want to know that.

From: <NAME>
It's to help a cute new employee! He forgot it and I want to look smart so
I can ride him!! Cuz i know he'll be better than you!! Now
if you don't tell me I'LL TELL EVERYONE ABOUT YOUR FETISH!!

To: <NAME>
FUUUCK! OKay bitch! I can't tell you directly but its the
amount of RAM on your computer. Its on the sticker on your
computer you dumb bitch.
P.S. I hope he gives you the AIDS.
-----------------------------------------------------------
"""

Sally_Stark_Receptionist = """
Sally Stark Receptionist
--------------------------------------
CPU: Intel i7 Extreme 8 cores @ 3.4Ghz
RAM: 8GB
OS: Windows8
"""

Sally_Mail = """
From: <NAME>
Hey, Sal. I need a big favor from you! I need to take my
kid to the doctor. Could you clock me in anyway? Appreciate it.
		 
To: <NAME>
No problem, I hope he gets better because I know you love your little boy.
						
To: <NAME>
Remember me? It's Sally, the receptionist. I just wanted to say
that I found out the code for you. It's 8.

From: <NAME>
Thank you so much, ma'am. You are a life saver. It would be
so embarrassing to ask for such important information from my
boss. Especially right after he just told me. So, thanks again.

To: <NAME>
No problem. And what's with the ma'am stuff? Just call me Sally."
						 
From: <NAME>
Haha okay Sally. The code you gave me worked for most of the files
except for one. I don't know what the file does, I'll ask my boss.
"""

Richard_Moliere_Security_Consultant = """
<NAME> Security Consultant
--------------------------------------
CPU: Intel i7 Extreme 8 cores @ 3.4Ghz
RAM: 8GB
OS: Windows8
"""

Richard_Mail = """
To: <NAME>
I'm sorry to disturb you but I have a file here sitting on my computer.
I can't open it with our current encryption code. Do you know how to
decrypt it?

From: <NAME>
No.

To: <NAME>
So, do I just leave it alone?

From: <NAME>
Yes.
"""

Richard_Memo = """
Things to remember:
1. The decryption code for our files is 8.
But when security is comprimised it turns into the opposite plus the ram contained.
Then the network will re-arrange itself. Which means some computers will not be hooked up.
But some others will.
						
2. I was told not to mess that wierd savedFragment file.
						
3. Call Sally by her first name...even though she's like 20 years older than me.
						
4. Our HR Manager really loves her little boy. His name is Chris.

5. Don't fuck this up.
"""

Tyrella_Jensen_HR_Manager = """
Tyrella_Jensen HR Manager
--------------------------------------
CPU: Intel i7 Extreme 8 cores @ 3.4Ghz
RAM: 4GB
OS: Windows8
"""

Tyrella_Mail = """
To: <NAME>
We're were very honored to have you work for us. But as a
result of the recent economy we have no choice but to let
you go. We wish you luck and you should recieve your final
check by the end of the week. Thank you.

From: <NAME>
What?! Bullshit!!!! if the whole shit about the economy is
true, then you wouldn't be hiring more motherfucking security
consultants! I just trained that stupid little jerk-off and
now you're firing me? FUCk you! and all your shit. I'm gonna
go work for Google....fuck you and Pheonixeon.

To: <NAME>
Please refrain from using vulgar language. And both of those
consultants will make less than what you make. I will ask
that you train this new recruit as well before you leave. Thanks :)

From: <NAME>
Oh, I'm gonna train him good alright.
"""

Amitav_Gutipaty_Manager = """
Amitav Gutipaty Manager
--------------------------------------
CPU: Intel i7 Extreme 8 cores @ 3.4Ghz
RAM: 16GB
OS: Windows8
"""

Amitav_Memo = """
The connection: The name of the son and the job of the mother
The ends of the files Encrypted by the age of the new employee will give me Passage.
Once the fragments are happy together with the son and mother, they will gossip.
"""

Chris_Jensen_HR_Manager = """
<NAME> HR Manager
--------------------------------------
CPU: Intel i7 Extreme 8 cores @ 3.4Ghz
RAM: 4GB
OS: Windows8
"""<file_sep>/cmd.py
from resources import *
import time
import random
import os

# Public variables
command_list = {}
success_flag = False

#----------------------------------------------------------------------------------
# im(numOfSecToWait, stringToPrint)
#	So I don't have to keep typing time.sleep()
# ---------------------------------------------------------------------------------
def say(num, str):
	time.sleep(num)
	print(str)

#----------------------------------------------------------------------------------
# Clears the console
#----------------------------------------------------------------------------------
def clear():
	os.system(['clear', 'cls'][os.name=='nt'])

def random_line():
	characters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'l', 'm', 'n', 'o', 
				'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', 
				'4', '5', '6', '7', '8', '9', '0', '!', '@', '#', '$', '%', '^', '&', 
				'*', '(', ')', ',', '.', ';', '[', ']', '{', '}', ':', '"', '<', '>', 
				'?']
	line = ""
	for i in range(78):
		line += characters[random.randint(0, len(characters) - 1)] 
	return line
	
def fill_screen():
	for i in range(10000):
		print random_line()
	
# This function displays the the files to the user
def ls():
	if current_computer.files:
		print Constants.file_header
		for file in current_computer.files:
			if current_computer.files[file].encrypted:
				print file, "(encrypted)"
			else:
				print file
		print "\n"
	else:
		print "No files."
	
# This functions displays the text of a file if not encrypted
def cat(file_name = None):
	if file_name:
		if file_name in current_computer.files:
			file = current_computer.files[file_name]
			if file.encrypted != True:
				print file.text
			else:
				print "File is encrypted, cannot display content."
		else:
			print "%s does not exist." % file_name
	else:
		print "Please enter name of file you wish to open."

def connect(name = None):
	if name != "":
		if name in computer_list:
			if computer_list[name].protected == False:
				global current_computer
				current_computer = computer_list[name]
				print "Connecting to %s..." % current_computer.name
				time.sleep(2)
				print "Connected to %s." % current_computer.name
			else:
				print name, "is password protected, cannot connect."
		else:
			print name, "does not exist or is not connected."
	else:
		print "No address given, try again.."
	
def disconnect():
	global current_computer
	if current_computer == Home_Computer:
		print "Can't disconnect from home computer."
		return
	current_computer = Home_Computer
	print "Disconnecting..."
	time.sleep(2)
	print "Disconnected."

def scan(computer_name = None):
	if computer_name:
		if computer_name in computer_list:
			print computer_list[computer_name].specs
		else:
			print computer_name, "does not exist or is not connected."
	else:
		print "Enter name of computer you wish to scan."

def crack(computer_name = None, password = None):
	if computer_name:
		if computer_name in computer_list:
			if computer_list[computer_name].protected == True:
				if password:
					if computer_list[computer_name].password == password:
						computer_list[computer_name].protected = False
						print "Access granted, you can now connect."
					else:
						print "Access denied."
				else:
					global success_flag
					success_flag = computer_list[computer_name].crack()
					if success_flag == True:
						computer_list[computer_name].protected = False
						print "Access granted, you can now connect."
			else:
				print computer_name, "does not need to be cracked."
		else:
			print computer_name, "does not exist or is not connected."
	else:
		print "Please enter name of computer you wish to crack."

def decrypt(file_name = None, password = None):
	if file_name:
		if file_name in current_computer.files:
			if current_computer.files[file_name].encrypted == True:
				if password:
					if current_computer.files[file_name].password == <PASSWORD>:
						current_computer.files[file_name].encrypted = False
						print file_name, "decrypted, you can now access content"
				else:
					print "Running decrypter..."
					time.sleep(1)
					print "Displaying encryption keyword:", current_computer.files[file_name].encrypted_password
			else:
				print file_name, "is not encrypted."
		else:
			print file_name, "does not exist."
	else:
		print "Enter filename."
	
def download(file_name = None):
	if file_name:
		if file_name in current_computer.files:
			print "Downloading %s..." % file_name
			Home_Computer.files[file_name] = current_computer.files[file_name]
			del current_computer.files[file_name]
			time.sleep(1)
			print "Transfer complete."
		else:
			print file_name, "is not a valid filename."
	else:
		print "Enter name of file you wish to download."

def upload(file_name = None, computer_name = None):
	if file_name and computer_name:
		if file_name in Home_Computer.files:
			if computer_name in computer_list:
				if computer_list[computer_name].protected == False:
					print "Transfering %s to %s..." % (file_name, computer_name)
					computer_list[computer_name].files[file_name] = Home_Computer.files[file_name]
					del Home_Computer.files[file_name]
					time.sleep(1)
					print "Transfer complete."
				else:
					print "Cannot upload file, %s is protected." % computer_name
			elif computer_name == "haxorgurl":
				Haxor_Gurl(file_name)
			else:
				print computer_name, "does not exist or is not connected."
		else:
			print file_name, "is not a valid filename"
	else:
		print "Enter valid file and computer name."
	
def help():
	print Constants.help
	
# Load the command list into the command_list dictionary
def load_commands():
	command_list["ls"] = ls
	command_list["cat"] = cat
	command_list["connect"] = connect
	command_list["disconnect"] = disconnect
	command_list["scan"] = scan
	command_list["crack"] = crack
	command_list["decrypt"] = decrypt
	command_list["download"] = download
	command_list["upload"] = upload
	command_list["help"] = help
	
def load_stage_1():
	global computer_list
	computer_list = load_stage1_computers()
	
def load_stage_2():
	global computer_list
	computer_list = load_stage2_computers()
	
def load_stage_3_1():
	global computer_list
	computer_list = load_stage3_computers()
	
def load_stage_3_2():
	global computer_list
	computer_list["Chris_Jensen_HR_Manager"].files = Chris_Jensen_Files()
	
def cmd():
	while True:
		command = raw_input(current_computer.prompt).split()
		if command:
			if command[0] in command_list:
				if len(command) == 1:
					try:
						command_list[command[0]]()
					except:
						pass
					else:
						return command
				elif len(command) == 2:
					try:
						command_list[command[0]](command[1])
					except:
						print "Too many arguments given"
					else:
						return command
				elif len(command) == 3:
					try:
						command_list[command[0]](command[1], command[2])
					except:
						print "Too many arguments given."
					else:
						return command
				else:
					print "Too many parameters, re-enter command."
					return command
			else:
				print command[0], "is not a valid command"
				return command
		else:
			return None
			
def final_conditions():
	return "savedFragment0.jby" in computer_list["Chris_Jensen_HR_Manager"].files and "savedFragment1.ihc" in computer_list["Chris_Jensen_HR_Manager"].files and "savedFragment2.ry" in computer_list["Chris_Jensen_HR_Manager"].files and "savedFragment3.ih" in computer_list["Chris_Jensen_HR_Manager"].files<file_sep>/resources.py
import time
import Constants
import random

def Haxor_Gurl(file_name):
	if file_name:
		if file_name in Constants.Haxor_Gurl_Responses:
			print "HaxorGurl says: ", Constants.Haxor_Gurl_Responses[file_name]
		else:
			print "HaxorGurl says: ", Constants.Haxor_Random_Responses[random.randint(0, 4)]
			

def protect_password(password, hints):
		result = ""
		if password and hints:
			for letter in password:
				if letter in hints:
					result = result + letter + " "
				else:
					result = result + "_ "
		return result
			
def get_guess():
	while True:
		guess = raw_input("Guess:> ")
		if len(guess) != 1:
			print "Only one character guesses accepted."
		else:
			return guess

# This class represents a computer
class Computer(object):
	
	def __init__(self, name, specs, protected, password = None, hints = None, tries = None):
		self.name = name
		self.prompt = "user@%s:> " % name
		self.files = {}
		self.specs = specs
		self.protected = protected
		self.password = <PASSWORD>
		self.protected_password = protect_password(password, hints)
		self.hints = hints
		self.tries = tries
		
	def crack(self):
		current_tries = 0
		incorrect_guesses = []
		print "Starting cracking program..."
		time.sleep(2)
		while(current_tries != self.tries):
			print "Password:", self.protected_password
			print "Tries left: %s" % (self.tries - current_tries)
			if incorrect_guesses:
				print "Guesses:", ''.join(incorrect_guesses)
			guess = get_guess() 
			if guess in self.password:
				self.hints += guess
				self.protected_password = protect_password(self.password, self.hints)
				if not '_' in self.protected_password:
					print "The password for %s is %s" % (self.name, self.password)
					return True
			elif guess in incorrect_guesses:
				print "Already attempted that character."
				time.sleep(1)
				continue
			else:
				current_tries = current_tries + 1
				incorrect_guesses.append(guess)
		print "Too many incorrect guesses, reseting..."
		return False
		
def encrypt(text, shift = 1):
	if text:
		return ''.join([[ch,chr((ord(ch) - ord(['A','a'][ch.islower()]) + shift)%26+ord(['A','a'][ch.islower()]))][ch.isalpha()] for ch in text])
	else:
		return None
	
# This class represents a file
class File(object):

	def __init__(self, name, text, is_encrypted, password = None, shift = None):
		self.name = name
		self.text = text
		self.encrypted = is_encrypted
		self.password = <PASSWORD>
		self.shift = shift
		self.encrypted_password = encrypt(password, shift)
		
def Home_Computer_Files():
	files = {}
	core_os_files = File("CoreOSFiles.bndl", "Unable to read", False)
	files["CoreOSFiles.bndl"] = core_os_files
	core_img_files = File("coreImgFiles.bndl", "Unable to read", False)
	files["coreImgFiles.bndl"] = core_img_files
	core_script = File("coreScript.bndl", "Unable to read", False)
	files["coreScript.bndl"] = core_script
	ses_crk = File("sesCrk.txt", "Pandora's (i is sqrt of: ?)", False)
	files["sesCrk.txt"] = ses_crk
	ses = File("ses.png", "256kb image file retrieved from http://www.elcachondo.net/", True, "box", -1)
	files["ses.png"] = ses
	error_log = File("errorLog.txt", "Damn send function, I'll write it later, not like I need it to evesdrop on conversations...", False)
	files["errorLog.txt"] = error_log
	return files

Home_Computer = Computer("My_Computer", Constants.home_computer, False)
Home_Computer.files = Home_Computer_Files()
current_computer = Home_Computer
computer_list = {}
		
def Steve_Waller_Files():
	files = {}
	saved_fragment = File("savedFragment2.ry", "N/A", True, "lakjdhgfnhkjfbhfhfyghkfjujutrrfrtyujrturgtttygreeetryerlirvioej", 1)
	files["savedFragment2.ry"] = saved_fragment
	employ_list = File("employLst.lst", "<NAME>\n<NAME>\n<NAME>\n<NAME>\n", True, "password", 8)
	files["employLst.lst"] = employ_list
	steve_mail = File("SteveMail.hist", Constants.Steve_Mail, False)
	files["SteveMail.hist"] = steve_mail
	return files
	
def load_stage1_computers():
	global computer_list
	Steve_Waller_Security_Consultant = Computer("Steve_Waller_Security_Consultant", Constants.Steve_Waller_Security_Consultant, True, "password", "<PASSWORD>", 10)
	Steve_Waller_Security_Consultant.files = Steve_Waller_Files()
	computer_list["Steve_Waller_Security_Consultant"] = Steve_Waller_Security_Consultant
	return computer_list

def Sally_Stark_Files():
	files = {}
	saved_fragment_3 = File("savedFragment3.ih", "N/A", True, "asdfjklroidgthjrgtyt464tyer5rgyhrdrfk7yte3wegfgtfktryjrjrt6gjoidfj", 1)
	files["savedFragment3.ih"] = saved_fragment_3
	present_employ = File("presentEmploy.lst", "Present Employees:\n<NAME>\n<NAME>\<NAME>\n<NAME>\n<NAME>", False)
	files["presentEmploy.lst"] = present_employ
	sally_mail = File("SallyMail.hist", Constants.Sally_Mail, True, "sally", 8)
	files["SallyMail.hist"] = sally_mail
	return files

def Richard_Moliere_Files():
	files = {}
	saved_fragment_0 = File("savedFragment0.jby", "N/A", True, "skjdoidfuvhjerujri473kijtduyhjt58eujfie498e490odeie490we9odeirni", 1)
	files["savedFragment0.jby"] = saved_fragment_0
	richard_mail = File("RichardMail.hist", Constants.Richard_Mail, True, "password", 8)
	files["RichardMail.hist"] = richard_mail
	richard_memo = File("RichardMemo.txt", Constants.Richard_Memo, True, "gingerbread", 8)
	files["RichardMemo.txt"] = richard_memo
	return files
	
def load_stage2_computers():
	global computer_list
	Sally_Stark_Receptionist = Computer("Sally_Stark_Receptionist", Constants.Sally_Stark_Receptionist, False)
	Sally_Stark_Receptionist.files = Sally_Stark_Files()
	computer_list["Sally_Stark_Receptionist"] = Sally_Stark_Receptionist
	Richard_Moliere_Security_Consultant = Computer("Richard_Moliere_Security_Consultant", Constants.Richard_Moliere_Security_Consultant, False)
	Richard_Moliere_Security_Consultant.files = Richard_Moliere_Files()
	computer_list["Richard_Moliere_Security_Consultant"] = Richard_Moliere_Security_Consultant
	return computer_list

def Tyrella_Jensen_Files():
	files = {}
	employees = File("employees.lst", "<NAME>\nAge: 40\n Receptionist\n\n<NAME>\nAge: 33\nSecurity Consultant", True, "christopher", -4)
	files["employees.lst"] = employees
	tyrella_mail = File("TyrellaMail.hist", Constants.Tyrella_Mail, True, "crissyboo", -4)
	files["TyrellaMail.hist"] = tyrella_mail
	saved_fragment_1 = File("savedFragment1.ihc", "N/A", True, "irimckjrmey5uih598ersuhig54uierfsuih4t7eskus7ie8i4hvuhs4ihswiuhoisgrieds", 1)
	files["savedFragment1.ihc"] = saved_fragment_1
	return files

def Amitav_Gutipaty_Files():
	files = {}
	amitav_memo = File("AmitavMemo.txt", Constants.Amitav_Memo, True, "amitav", 8)
	files["AmitavMemo.txt"] = amitav_memo
	return files

def Chris_Jensen_Files():
	files = {}
	pandoras_box = File("pandorasBox.exe", "Unable to read", False)
	files["pandorasBox.exe"] = pandoras_box
	return files
	
def load_stage3_computers():
	global computer_list
	del computer_list["Steve_Waller_Security_Consultant"]
	del computer_list["Sally_Stark_Receptionist"]
	Tyrella_Jensen_HR_Manager = Computer("Tyrella_Jensen_HR_Manager", Constants.Tyrella_Jensen_HR_Manager, True, "chris", "cs", 3)
	Tyrella_Jensen_HR_Manager.files = Tyrella_Jensen_Files()
	computer_list["Tyrella_Jensen_HR_Manager"] = Tyrella_Jensen_HR_Manager
	Amitav_Gutipaty_Manager = Computer("Amitav_Gutipaty_Manager", Constants.Amitav_Gutipaty_Manager, True, "google", "o", 3)
	Amitav_Gutipaty_Manager.files = Amitav_Gutipaty_Files()
	computer_list["Amitav_Gutipaty_Manager"] = Amitav_Gutipaty_Manager
	Chris_Jensen_HR_Manager = Computer("Chris_Jensen_HR_Manager", Constants.Chris_Jensen_HR_Manager, True, "pheonixeon", "", 3)
	computer_list["Chris_Jensen_HR_Manager"] = Chris_Jensen_HR_Manager
	return computer_list