@wuchang/

minirace1

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
def str_to_bin(_string):
  """ Takes a string and outputs each character's 
    value as its binary ASCII code
    :param _string: string to convert
    :return:  converted string
  """
  m = ""
  for char in _string:
    m += "  {num:08b}\n".format(num=ord(char))
  return m
def str_to_hex(_string):
  """ Takes a string and outputs each character's 
    value as its hexadecimal ASCII code
    :param _string: string to convert
    :return:  converted string
  """
  m = ""
  for char in _string:
    m += "{:x} ".format(ord(char)) 
  return m

# Point bit.ly link to a page that has puzzle
#  e.g. "For key one, who are 'the ones' on the stone benches outside of Epler's Hall?""
print(str_to_hex("Visit bit.ly with"))

# bit.ly link points to Google Doc to edit
print(str_to_bin("2YTwT47"))