Below I am disclosing a script I wrote. I called it GhostWriter. It is supposed to write a message you type in as if a ghost were writing it for you. It even has some very basic AI to simulate a real person typing. The problem is, is that when it is run in the python shell, it puts spaces in between the letters of my message. Please submit a version of this that will take the spaces out of the Message being written by the ghost. (And yes, I am new to computer programming... so don't criticize my lame program!)
Code:
#-------------------------------------------------------------------------------------------- from time import sleep from GhostWriter import * import random blist=[.1,.3,.3,.7,.05,.1,.3,.57,.7,.6,.6,.6,.5,.05,.5,.02,.05,.06,.03,.04,.05,.05,.05,.05,.06,.04,.05,.04] b=blist[0] def GhostAuthor(name,date,time,prompt): print "Message from: ",name print date print time for x in prompt[:]: loop=1 while loop==1: random.shuffle(blist) sleep(blist[0]) loop=0 print x, print "Welcome to Ghost Writer. We are going to write a \"Ghost Message\"" print "Please fill in the information and then click 'ENTER' to proceed." name=raw_input("What is your name?: ") date=raw_input("What is today's date?: ") time=raw_input("What time is it?: ") prompt=raw_input("Please type in your message: ") GhostAuthor(name,date,time,prompt) print " " print " "
Comment