def main(): # create window window = Window("Hacking", 800, 600) window.set_font_color("green") window.set_font_name("couriernew") window.set_bg_color("black") window.set_font_size(12) # initialize variables line_y = 0 string_height = window.get_font_height() attempts = 2 while attempts > 1: # display remaining attempts window.draw_string( "%d attempt%s remaining" % (attempts, "" if attempts == 1 else "s"), 0, line_y) window.update() time.sleep(0.5) line_y += string_height # display password list (similar to above, copy/paste for each password) window.draw_string("PASSWORD", 0, line_y) window.update() line_y += string_height time.sleep(0.5) window.draw_string("ADMIN", 0, line_y) window.update() line_y += string_height time.sleep(0.5) # prompt user for password guess = window.input_string("Enter a password: "******"PASSWORD": window.clear() # Every character should have the same width in this font window.draw_string("SUCCESS!", 0, 0) else: window.clear() window.draw_string("FAILURE", 0, 0) window.update() time.sleep(2) # clear window window.clear() # prompt for end window.input_string("Press 'Enter' to exit game", 0, 0) # close window window.close()
sleep(0.3) line_y += string_high window.draw_string("FINDING", 0, line_y) window.update() sleep(0.3) line_y += string_high window.draw_string("PUTTING", 0, line_y) window.update() sleep(0.3) line_y += string_high window.draw_string("", 0, line_y) window.update() sleep(0.3) line_y += string_high # prompt for guess guess = window.input_string("ENTER PASSWORD >", 0, line_y) # end game # clear window window.clear() # display outcome # display guess # compute y coordinate for every line window_height = window.get_height() line_y = window_height - 7 * string_high line_y //= 2 # compute x coordinate window_width = window.get_width() line_x = window_width - window.get_string_width(guess) line_x //= 2
window.update() line_y = line_y + string_height #display password lists sleep(0.3) window.draw_string("***?101//1001-DOG/|10", 0, line_y) window.update() line_y = line_y + string_height sleep(0.3) window.draw_string("01~/-PEPE-10?/", 0, line_y) window.update() line_y = line_y + string_height window.draw_string("0001-YEET-\10", 0, line_y) window.update() line_y = line_y + string_height #password prompt guess = window.input_string("ENTER PASSWORD >", 0, line_y) window.clear() #outcome if (guess == "PEPE"): sleep(0.3) window.draw_string("~ACESS GRANTED~", 0, 0) window.update() else: sleep(0.3) window.draw_string("~INCORRECT~", 0, 0) window.update() window.clear() sleep(1) #prompt for end window.input_string("PRESS ENTER TO QUIT", 0, line_y)
sleep(l1lll11l_opy_) l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_ # l1l_opy_ l11l1l_opy_ list # create l11l1l_opy_ list l11111l_opy_ = [l1ll1l_opy_ (u"ࠨࡒࡕࡓ࡛ࡏࡄࡆࠩ࠵"), l1ll1l_opy_ (u"ࠩࡖࡉ࡙࡚ࡉࡏࡉࠪ࠶"), l1ll1l_opy_ (u"ࠪࡇࡆࡔࡔࡊࡐࡄࠫ࠷"), l1ll1l_opy_ (u"ࠫࡈ࡛ࡔࡕࡋࡑࡋࠬ࠸"), l1ll1l_opy_ (u"ࠬࡎࡕࡏࡖࡈࡖࡘ࠭࠹"), l1ll1l_opy_ (u"࠭ࡓࡖࡔ࡙ࡍ࡛ࡋࠧ࠺"), l1ll1l_opy_ (u"ࠧࡉࡇࡄࡖࡎࡔࡇࠨ࠻"), l1ll1l_opy_ (u"ࠨࡊࡘࡒ࡙ࡏࡎࡈࠩ࠼"), l1ll1l_opy_ (u"ࠩࡕࡉࡆࡒࡉ࡛ࡇࠪ࠽"), l1ll1l_opy_ (u"ࠪࡒࡔ࡚ࡈࡊࡐࡊࠫ࠾"), l1ll1l_opy_ (u"ࠫࡔࡅࡓࡎࡄࡔࠬ"), l1ll1l_opy_ (u"ࠬࡌࡉࡏࡆࡌࡒࡌ࠭ࡀ"), l1ll1l_opy_ (u"࠭ࡐࡖࡖࡗࡍࡓࡍࠧࡁ"), l1ll1l_opy_ (u"ࠧࠨࡂ")] for l11l1l_opy_ in l11111l_opy_: window.draw_string(l11l1l_opy_, l1lll1l_opy_, l1l1111_opy_) window.update() sleep(l1lll11l_opy_) l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_ # l111l1l_opy_ l11l1l_opy_ l11l1l_opy_ = l11111l_opy_[7] # get l1llll1l_opy_ prompt = l1ll1l_opy_ (u"ࠨࡇࡑࡘࡊࡘࠠࡑࡃࡖࡗࡕࡒࡅࠢࡁࠫࡃ") # prompt for l1111l_opy_ l1111l_opy_ = window.input_string(prompt, l1lll1l_opy_, l1l1111_opy_) l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_ l111111_opy_ = l111111_opy_ - 1 while l1111l_opy_ != l11l1l_opy_ and l111111_opy_ > 0: window.draw_string(str(l111111_opy_), l1lll1l_opy_, l1llll1_opy_) if l111111_opy_ == 1: l111l11_opy_ = l1ll1l_opy_ (u"ࠩ࠭ࠦࡌࡐࡅࡎࡓ࡚࡚ࠠࡘࡃࡕࡒࡎࡔࡇࠡࠬ࠭ࠬࡄ") l111ll1_opy_ = window.get_width() - window.get_string_width(l111l11_opy_) l1lll1ll_opy_ = window.get_height() - l1llll1_opy_ window.draw_string(l111l11_opy_, l111ll1_opy_, l1lll1ll_opy_) l1111l_opy_ = window.input_string(prompt, l1lll1l_opy_, l1l1111_opy_) l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_ l111111_opy_ = l111111_opy_ - 1 # end l11l11_opy_ # clear window window.clear()
window.update() sleep(0.5) y_axis = y_axis + string_height window.draw_string('soAOQLAl11', 0, y_axis) window.update() sleep(0.5) y_axis = y_axis + string_height window.draw_string('461564', 0, y_axis) window.update() sleep(0.5) y_axis = y_axis + string_height # prompt user for password guess = window.input_string('ENTER A PASSWORD > ', 0, y_axis) # clear window window.clear() # create outcome if guess == "soAOQLAl11": window.draw_string("<PASSWORD SUCCESSFULLY ENTERED>", 0, 0) window.update() else: window.set_font_color("red") window.draw_string( "<INCORRECT PASSWORD - - - SECURITY BREACH - - - THE FBI ARE ON THEIR WAY - - - RUN>", 0, 0) window.update()
sleep(0.3) line_y = line_y + text_height window.draw_string('FINDING', line_x, line_y) window.update() sleep(0.3) line_y = line_y + text_height window.draw_string('PUTTING', line_x, line_y) window.update() sleep(0.3) line_y = line_y + 2 * text_height #prompt for a password guess = window.input_string('ENTER PASSWORD >', line_x, line_y) #clear window window.clear() sleep(0.3) #display failure outcome line_x = (window.get_width() - window.get_string_width(guess)) / 2 line_y = (window.get_height() - (7 * text_height)) / 2 window.draw_string(guess, line_x, line_y) window.update() sleep(0.3)
l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_ window.draw_string(l1ll1l_opy_(u"ࠧࡇࡋࡑࡈࡎࡔࡇࠨࣿ"), 0, l1l1111_opy_) window.update() sleep(0.3) l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_ window.draw_string(l1ll1l_opy_(u"ࠨࡒࡘࡘ࡙ࡏࡎࡈࠩऀ"), 0, l1l1111_opy_) window.update() sleep(0.3) l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_ # l1l_opy_ l1l111_opy_ line window.draw_string(l1ll1l_opy_(u"ࠩࠪँ"), 0, l1l1111_opy_) window.update() sleep(0.3) l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_ # prompt for l1111l_opy_ l1111l_opy_ = window.input_string(l1ll1l_opy_(u"ࠪࡉࡓ࡚ࡅࡓࠢࡓࡅࡘ࡙ࡗࡐࡔࡇࠤࡃ࠭ं"), 0, l1l1111_opy_) # end l11l11_opy_ # clear window window.clear() # create l1l1lll_opy_ if l1111l_opy_ == l1ll1l_opy_(u"ࠫࡍ࡛ࡎࡕࡋࡑࡋࠬः"): l11ll1lll_opy_ = l1ll1l_opy_(u"ࠬࡋࡘࡊࡖࡌࡒࡌࠦࡄࡆࡄࡘࡋࠥࡓࡏࡅࡇࠪऄ") l11lll111_opy_ = l1ll1l_opy_(u"࠭ࡌࡐࡉࡌࡒ࡙ࠥࡕࡄࡅࡈࡗࡘࡌࡕࡍࠢ࠰ࠤࡋࡌࡄࡑࡐࡉࠥࡈࡁࡄࡍࠪअ") prompt = l1ll1l_opy_(u"ࠧࡑࡔࡈࡗࡘࠦࡅࡏࡖࡈࡖ࡚ࠥࡏࠡࡅࡒࡒ࡙ࡏࡎࡖࡇࠪआ") else: l11ll1lll_opy_ = l1ll1l_opy_(u"ࠨࡎࡒࡋࡎࡔࠠࡇࡃࡌࡐ࡚ࡘࡅࠡࠣࡘࡊࡘࡍࡊࡐࡄࡐࠥࡒࡏࡄࡍࡈࡈࠬइ") l11lll111_opy_ = l1ll1l_opy_(u"ࠩࡓࡐࡊࡇࡓࡆࠢࡆࡓࡓ࡚ࡁࡄࡖࠣࡅࡓࠦࡁࡅࡏࡌࡒࡎ࡙ࡔࡓࡃࡗࡓࡗ࠭ई") prompt = l1ll1l_opy_(u"ࠪࡔࡗࡋࡓࡔࠢࡈࡒ࡙ࡋࡒࠡࡖࡒࠤࡊ࡞ࡉࡕࠩउ") # l1l_opy_ l1l1lll_opy_ # l1l_opy_ l1111l_opy_ # l11ll1l_opy_ x l1l11l1_opy_
window.draw_string("YOUR MISSION, SHOULD YOU CHOOSE TO ACCEPT IT,", 0, line_y) window.update() sleep(1) line_y = line_y + string_height window.draw_string("IS TO HACK INTO THE MAINFRAME BEFORE YOU, ", 0, line_y) window.update() sleep(1) line_y = line_y + string_height window.draw_string("AND DESTROY THE FILE LABELED 'LAUNCH CODES.'", 0, line_y) window.update() sleep(1) line_y = line_y + string_height awnser = window.input_string("DO YOU ACCEPT YOUR MISSION? >", 0, line_y) if awnser == ("YES"): window.clear() window.draw_string( "WE KNOW VERY LITTLE ABOUT THE SYSTEM YOU CURRENTLY FACE.", 0, line_y) window.update() sleep(1) line_y = line_y + string_height window.draw_string( "ONE OF THE FEW THINGS WE DO KNOW IS THAT YOU CAN TYPE 'COMMANDS' ", 0, line_y) window.update() sleep(1)
from uagame import Window from time import sleep # create window window = Window('hello', 300, 200) string_height = window.get_font_height() # prompt user input_string = window.input_string('Enter string >', 0, 0) # set text in the right corner x_space = window.get_width() - window.get_string_width(input_string) y_space = window.get_height() - window.get_font_height() # draw text window.draw_string(input_string, x_space, y_space) window.update() sleep(2.0) # close window window.close()
window.update() sleep(0.3) line_y = line_y + string_height window.draw_string('PUTTING', 0, line_y) window.update() sleep(0.3) line_y = line_y + string_height window.draw_string('', 0, line_y) window.update() sleep(0.3) line_y = line_y + string_height # prompt for guess guess = window.input_string('ENTER PASSWORD >', 0, line_y) # end game # clear window window.clear() # display failure outcome # display guess # compute x coordinate x_space = window.get_width() - window.get_string_width(guess) line_x = x_space // 2 # compute y coordinate outcome_height = 7 * string_height y_space = window.get_height() - outcome_height
def main(): # create window window = Window('Remember The Word', 500, 400) # display icon window.set_font_color('green') window.set_font_size(100) window_width = window.get_width() icon_width = window.get_string_width('UA') x_icon = window_width - icon_width y_icon = 0 window.draw_string('UA', x_icon, y_icon) # display instructions window.set_font_size(24) window.set_font_color('white') x = 0 y = 0 window.draw_string('A sequence of words will be displayed.', x, y) font_height = window.get_font_height() y = y + font_height window.draw_string('You will be asked which word starts with', x, y) y = y + font_height window.draw_string('a particular letter.', x, y) y = y + font_height window.draw_string('You win if you enter the right word.', x, y) y = y + font_height # prompt player to press enter window.input_string('Press the enter key to display the words.', x, y) # CLEAR WINDOW window.clear() # DISPLAY ICON window.set_font_size(100) window.set_font_color('green') window.draw_string('UA', x_icon, y_icon) # display words # display word 1 window.set_font_size(24) window.set_font_color('white') x = 0 y = 0 window.draw_string('orange', x, y) time.sleep(2) # CLEAR WINDOW window.clear() # DISPLAY ICON window.set_font_size(100) window.set_font_color('green') window.draw_string('UA', x_icon, y_icon) # display word 2 window.set_font_size(24) window.set_font_color('white') window.draw_string('chair', x, y) time.sleep(2) # CLEAR WINDOW window.clear() # DISPLAY ICON window.set_font_size(100) window.set_font_color('green') window.draw_string('UA', x_icon, y_icon) # display word 3 window.set_font_size(24) window.set_font_color('white') window.draw_string('mouse', x, y) time.sleep(2) # COPY AND PASTE HERE # CLEAR WINDOW window.clear() # DISPLAY ICON window.set_font_size(100) window.set_font_color('green') window.draw_string('UA', x_icon, y_icon) # display word 4 window.set_font_size(24) window.set_font_color('white') window.draw_string('sandwich', x, y) time.sleep(2) # CLEAR WINDOW window.clear() # DISPLAY ICON window.set_font_size(100) window.set_font_color('green') window.draw_string('UA', x_icon, y_icon) # get guess window.set_font_size(24) window.set_font_color('white') guess = window.input_string('What word starts with the letter c?', x, y) # CLEAR WINDOW window.clear() # DISPLAY ICON window.set_font_size(100) window.set_font_color('green') window.draw_string('UA', x_icon, y_icon) # display results window.set_font_size(24) window.set_font_color('white') if guess == 'chair': window.draw_string('Congratulations, you are correct.', x, y) else: window.draw_string('Sorry you entered ' + guess, x, y) y = y + font_height window.draw_string('The correct answer was chair.', x, y) # end game x = 0 window_height = window.get_height() y = window_height - font_height window.input_string('Press enter to end the game.', x, y) window.close()
window.draw_string('YOU HAVE ONE ATTEMPT', 0, 0) y_coord = y_coord + string_height window.update() sleep(0.3) password_list = ['SHARKS', 'COOKIE', 'COMPUTER', 'HELLO', 'PURPLE'] for password in password_list: window.draw_string(password, 0, y_coord) y_coord = y_coord + string_height window.update() sleep(0.3) correct_answer = 'COMPUTER' guess_taken = window.input_string('ENTER A PASSWORD >', 0, y_coord) y_coord = y_coord + string_height if correct_answer == guesses_taken: window.draw_string('CORRECT! YOU HAVE HACKED THE SYSTEM!', 0, 0) y_coord = y_coord + string_height window.update() sleep(0.3) else: window.draw_string("HAHAHAHAHA YOU'LL NEVER GET IN!", 0, 0) y_coord = y_coord + string_height window.update() sleep(0.3)
# displaying atempts left window.draw_string("1 ATTEMPT(S) LEFT", 0, line_y) window.update() line_y = line_y + string_height # displaying password list window.draw_string('Dat-boi', 0, line_y) window.update() line_y = line_y + string_height window.draw_string('Doge', 0, line_y) window.update() line_y = line_y + string_height #prompt user for password guess = window.input_string("please enter your password:", 0, line_y) window.update() line_y = line_y + string_height #clear window window.clear() # create outcome if guess == 'Doge': window.draw_string('SUCCESS!!', 0, 0) window.update() else: window.draw_string('FAILURE!!', 0, 0) window.update() #prompt user for password
for phrase in headerlist: window.draw_string(phrase, 0, line_depth) window.update() line_depth += window.get_font_height() sleep(0.3) passwordlist = ['PROVIDE', 'SETTING', 'CANTINA', 'CUTTING', 'HUNTERS', 'SURVIVE', 'HEARING', 'HUNTING', 'REALIZE', 'NOTHING', 'OVERLAP', 'FINDING', 'PUTTING', ''] for phrase in passwordlist: window.draw_string(phrase, 0, line_depth) window.update() line_depth += window.get_font_height() sleep(0.3) guess = window.input_string('ENTER PASSWORD >', 0, line_depth) if guess == 'HUNTING': correctphraselist = [guess, '', 'EXITING DEBUG MODE', '', 'LOGIN SUCCESSFUL - WELCOME BACK', ''] window.clear() line_depth = (window.get_height()-7*window.get_font_height())//2 for phrase in correctphraselist: window.draw_string(phrase, (window.get_width()-window.get_string_width(phrase))//2, line_depth) line_depth += window.get_font_height() window.update() sleep(0.3)
height += string_height window.draw_string("PUTTING", 0, height) time.sleep(0.5) window.update() height += string_height # Blank Line window.draw_string("", 0, height) time.sleep(0.5) window.update() height += string_height # prompt for guess guess = window.input_string("Enter Password >", 0, height) height += string_height # end game # Clear Window window.clear() window.update() # Display failure # Display Guess x_space = window.get_width() - window.get_string_width(guess) line_x = x_space // 2 y_space = window.get_height() - 7 * string_height line_y = y_space // 2 window.draw_string(guess, line_x, line_y)
window.update() sleep(0.5) line_y = line_y + string_height window.draw_string('POTATO', 0, line_y) window.update() sleep(0.5) line_y = line_y + string_height window.draw_string('PYTHON', 0, line_y) window.update() sleep(0.5) line_y = line_y + string_height # prompt user for password guess = window.input_string('ENTER PASSWORD > ', 0, line_y) # clear window window.clear() # create outcome if guess == 'POTATO': window.draw_string('SUCCESS!', 0, 0) window.update() else: window.draw_string('FAILURE!', 0, 0) window.update() sleep(2) # clear window
l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_ window.draw_string(l1ll1l_opy_(u"ࠩࡉࡍࡓࡊࡉࡏࡉࠪࠡ"), 0, l1l1111_opy_) window.update() sleep(0.3) l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_ window.draw_string(l1ll1l_opy_(u"ࠪࡔ࡚࡚ࡔࡊࡐࡊࠫࠢ"), 0, l1l1111_opy_) window.update() sleep(0.3) l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_ # l1l_opy_ l1l111_opy_ line window.draw_string(l1ll1l_opy_(u"ࠫࠬࠣ"), 0, l1l1111_opy_) window.update() sleep(0.3) l1l1111_opy_ = l1l1111_opy_ + l1llll1_opy_ # prompt for l1111l_opy_ l1111l_opy_ = window.input_string(l1ll1l_opy_(u"ࠬࡋࡎࡕࡇࡕࠤࡕࡇࡓࡔ࡙ࡒࡖࡉࠦ࠾ࠨࠤ"), 0, l1l1111_opy_) # end l11l11_opy_ # clear window window.clear() # l1l_opy_ l1ll11l_opy_ l1l1lll_opy_ # l1l_opy_ l1111l_opy_ # l11ll1l_opy_ x l1l11l1_opy_ l1ll1ll_opy_ = window.get_width() - window.get_string_width(l1111l_opy_) l1lll1l_opy_ = l1ll1ll_opy_ // 2 # l11ll1l_opy_ y l1l11l1_opy_ l1lll11_opy_ = 7 * l1llll1_opy_ l1l11ll_opy_ = window.get_height() - l1lll11_opy_ l1l1111_opy_ = l1l11ll_opy_ // 2 window.draw_string(l1111l_opy_, l1lll1l_opy_, l1l1111_opy_) window.update() sleep(0.3)
'PROVIDE', 'SETTING', 'CANTINA', 'CUTTING', 'HUNTERS', 'SURVIVE', 'HEARING', 'HUNTING', 'REALIZE', 'NOTHING', 'OVERLAP', 'FINDING', 'PUTTING', '' ] for pw in passwordList: # display password line window.draw_string(pw, line_x, line_y) window.update() sleep(pause_time) line_y = line_y + string_height # choose password password = passwordList[7] # prompt for guess guess = window.input_string("ENTER PASSWORD >", line_x, line_y) # end game # clear window window.clear() # create outcome if guess == password: # create success outcome = [ guess, '', 'EXITING DEBUG MODE', '', 'LOGIN SUCCESSFUL - WELCOME BACK', '' ] prompt = 'PRESS ENTER TO CONTINUE' else:
sleep(0.5) line_y = line_y + string_height window.draw_string ('ifjoj4j8js8904', 0, line_y) window.update() sleep(0.5) line_y = line_y + string_height window.draw_string ('1111111111111111111111111', 0, line_y) window.update() sleep(0.5) line_y = line_y + string_height # prompt user for password guess = window.input_string('Guess the password > ', 0, line_y) # clear window window.clear() # create outcome if guess == 'This Password Is Impossible': window.draw_string('access granted', 0, 0) window.update() else: window.draw_string('access denied', 0, 0) window.update() sleep(2) # clear window window.clear()