Beispiel #1
0

#########################
# Variables declaration #
#########################
logging.debug('Initialising credits variables...')
page_name:str = 'credits'
credits_objects:dict = dict()


##############################
# Load credits objects #
##############################
logging.debug('Initialising credits objects...')

common_objects.load(credits_objects, page_name, ['back'])

# Button
credits_objects['check_it_out'] = item(name='check_it_out',
                                        type='button',
                                        images=pygame_ess.load.images([page_name, 'check_it_out']),
                                        frame=coord(
                                            266, 906, 
                                            492, 67, 
                                            266, 906),
                                        runclass=webbrowser.open,
                                        runclass_parameter='https://github.com/benwoo1110')


###################
# Generate window #
logging.info('Loading invalid input alert...')

#########################
# Variables declaration #
#########################
logging.debug('Initialising invalid input variables...')
page_name: str = 'invalid_input'
invalid_input_objects: dict = dict()

##############################
# Load invalid input objects #
##############################
logging.debug('Initialising invalid input objects...')

# Load essentials images
common_objects.load(invalid_input_objects, page_name, is_alpha=True)

# Alert
invalid_input_objects['alert'] = item(
    name='alert',
    type='alert',
    images=pygame_ess.load.images([page_name, 'alert'], is_alpha=True),
    frame=coord(306, 291, 412, 186, 0, 0),
)

# Invalid input message
invalid_input_objects['message'] = item(
    name='message',
    type='textfield',
    meta=text_data(text='Oh no! Your input is invalid!',
                   font_type='Monaco.dfont',
Beispiel #3
0
#########################
# Variables declaration #
#########################
logging.debug('Initialising affine cipher variables...')
page_name: str = 'affine_cipher'
affine_cipher_objects: dict = dict()
mode = Mode()

##############################
# Load Affine Cipher objects #
##############################
logging.debug('Initialising affine cipher objects...')

# Load essentials images
common_objects.load(affine_cipher_objects, page_name, ['back', 'info'])

# Textfields
affine_cipher_objects['plaintext'] = item(
    name='plaintext',
    type='textfield',
    meta=text_data(text='plaintext',
                   font_type='Monaco.dfont',
                   font_size=34,
                   colour=pygame_ess.colour.black,
                   validation=validate.text()),
    images=pygame_ess.load.images([page_name, 'plaintext']),
    frame=coord(325, 158, 632, 62, 307, 150),
    runclass=textfield_event.run)

affine_cipher_objects['a'] = item(
#########################
# Variables declaration #
#########################
logging.debug('Initialising atbash cipher variables...')
page_name:str = 'atbash_cipher'
atbash_cipher_objects:dict = dict()
mode = Mode()


##############################
# Load affine cipher objects #
##############################
logging.debug('Initialising atbash cipher objects...')

# background image
common_objects.load(atbash_cipher_objects, page_name, ['back', 'info'])

# Textfield
atbash_cipher_objects['plaintext'] = item(name='plaintext',
                                          type='textfield',
                                          meta=text_data(
                                              text='plaintext',
                                              font_type='Monaco.dfont',
                                              font_size=34,
                                              colour=pygame_ess.colour.black,
                                              validation=validate.text()
                                              ),
                                          images=pygame_ess.load.images([page_name, 'plaintext']),
                                          frame=coord(
                                              325, 156, 
                                              632, 62, 
#########################
# Variables declaration #
#########################
logging.debug('Initialising polyalphabetic subsitution variables...')
page_name: str = 'polyalphabetic_substitution_cipher'
polyalphabetic_substitution_cipher_objects: dict = dict()
mode = Mode()

##############################
# Load affine cipher objects #
##############################
logging.debug('Initialising polyalphabetic subsitution objects...')

# Load essentials images
common_objects.load(polyalphabetic_substitution_cipher_objects, page_name,
                    ['back', 'info'])

# Textfield
polyalphabetic_substitution_cipher_objects['keyword'] = item(
    name='keyword',
    type='textfield',
    meta=text_data(text='KEYWORD',
                   font_type='Monaco.dfont',
                   font_size=34,
                   colour=pygame_ess.colour.black,
                   validation=validate.text()),
    images=pygame_ess.load.images([page_name, 'keyword']),
    frame=coord(325, 176, 632, 62, 307, 165),
    runclass=textfield_event.run)

polyalphabetic_substitution_cipher_objects['plaintext'] = item(
#########################
# Variables declaration #
#########################
logging.debug('Initialising caesar cipher variables...')
page_name: str = 'caesar_cipher'
caesar_cipher_objects: dict = dict()
mode = Mode()

##############################
# Load affine cipher objects #
##############################
logging.debug('Initialising caesar cipher objects...')

# Load essentials images
common_objects.load(caesar_cipher_objects, page_name, ['back', 'info'])

# Textfield
caesar_cipher_objects['plaintext'] = item(
    name='plaintext',
    type='textfield',
    meta=text_data(text='plaintext',
                   font_type='Monaco.dfont',
                   font_size=34,
                   colour=pygame_ess.colour.black,
                   validation=validate.text()),
    images=pygame_ess.load.images([page_name, 'plaintext']),
    frame=coord(325, 156, 632, 62, 307, 146),
    runclass=textfield_event.run)

caesar_cipher_objects['key'] = item(
Beispiel #7
0
    },
    'polyalphabetic_substitution_cipher': {
        'height':
        2010,
        'link':
        'http://practicalcryptography.com/ciphers/classical-era/vigenere-gronsfeld-and-autokey/'
    }
}

##############################
# Load invalid input objects #
##############################
logging.debug('Initialising info input objects...')

# Load back button
common_objects.load(info_objects, page_name, shares=['back'], background=False)

# Load all info objects
for cipher_type in info_screen_data.keys():
    info_objects[cipher_type] = item(
        name=cipher_type,
        type='info',
        images=pygame_ess.load.images([page_name, cipher_type]),
        frame=coord(0, 0, 1024, 2010, 0, 0),
    )

# Learn more! button
info_objects['learn_more'] = item(name='learn_more',
                                  type='button',
                                  images=pygame_ess.load.images(
                                      [page_name, 'learn_more']),