# Template file for Homework 11, CS 151, Fall 2010, ISU
#
# Name: (put your name here)
#


# >>> setLibPath(pickAFolder())
from cs151functions import *

#
# Problem 1 (-3 points if you do not fill this in.)
#
def collaborators():
  # put into s who you worked with on this homework, "none" if none.
  s = ""
  print "I collaborated with:", s
# ** Note on collaboration: You should not turn in work that is not your own.
#    To make sure you are not violating this, if you work with someone, 
#    you should destroy the file once you are done working together, go 
#    your separate ways, and then you should be able to recreate the file
#    on your own, then turn that in.  If you cannot recreate the file on your
#    own, then it is not your work, and you should not turn it in.
# ** Note on sources: if you use some other source, the web or whatever, you
#    better cite it!  Not doing so is plagiarism.




# Problem 2 (20 Points)
#
# For this problem, create your cheat sheet of information we have
# covered since the first test.  If you want to do this problem in 
# Word or some other format, you may do so and submit both this 
# file and the other file for your homework.
#
# Your cheat sheet should include information on at least all
# of the following: 
#
# while loop, else test, printNow, requestString, requestInteger, 
# accessing parts of strings and lists with [:] notation,
# creating lists and nested lists with [] notation, 
# using for loops to look at each item/character in a list or string,
# string functions: upper, lower, find, replace, split, len, isdigit, isalpha
# list functions: append, len, count, max, min, sort, remove, split
# file functions: open, close, read, write, readlines
# escape characters: \n, \t, \\
# making large strings using triple quotes
# 
# For each of those things, you should give a brief one sentence of what it 
# does and also an example of correct use of it - like I have done in my
# reference sheet.
#
# You must work on this problem by yourself.  You may not share
# work on this problem.  All of this information is in the book, so 
# if you don't remember, you should read through the chapters with the 
# material.



# Problem 3 Extra Credit (5 Points)
#
# For this problem, you will write encryption/decryption functions.
# The encrypt function has two inputs: a string to encrypt and the 
# "secret code".  The secret code is just an integer between 1 and 25.  
# You will "add that number" to each of the characters in the string.
# So, calling >>> encrypt("abc", 1) would return 'bcd'
#
# The decrypt function should subtract instead of adding the secret
# code from each letter.  So, it would work like this.
# >>> encrypt("hi", 2)
#  'jk'
# >>> decrypt("jk", 2)
#  'hi'
# 
# For both encrypt and decrypt you need to deal with "overflow".
# So, what letter should you put if you are adding 2 to z?  You
# should have it "wrap around", so that 2 + z = b
# And you can make it so that only letters are changed by either
# funcion - if it is a space, period, etc. then just don't change it.
#
# For converting from character to number, you can use the ord function.
# To convert a number to a character, you can do something like this
# >>> x = "%c" % 97
# >>> x
#  'a'
# >>> x = "%c" % 98
# >>> x
#  'b'
def encrypt(s, key):
  print "put your code here..."
  
def decrypt(s, key):
  print "put your code here..."
