My first programmingpraxis submission. Check out my 1337 use of mapping. But not reducing. *sigh* not reducing.
def e2pword(engword):
if engword[0] in vowellist:
return engword + “-way”
else:
return engword[1:] + “-” + engword[0] + “ay”
def e2p(engstr):
return ” “.join([e2pword(word) for word in engstr.split(' ')])
def p2eword(pigword):
pigsplit = pigword.split(’-')
if pigsplit[1][0]==’w':
return pigsplit[0]
else:
return pigsplit[1][0]+pigsplit[0]
def p2e(pigstr):
return ” “.join([p2eword(word) for word in pigstr.split(' ')])
No comments:
Post a Comment