fork(1) download
  1. import string
  2. import random
  3. import time
  4.  
  5. possibleCharacters = string.ascii_lowercase + string.digits + string.ascii_uppercase + ' .,!?;:'
  6.  
  7. target = 'python awesome'
  8. attemptThis = ''.join(random.choice(possibleCharacters) for i in range(len(target)))
  9. attemptNext = ''
  10.  
  11. completed = False
  12.  
  13. generation = 0
  14.  
  15. while completed == False:
  16. print(attemptThis)
  17. attemptNext = ''
  18. completed = True
  19. for i in range(len(target)):
  20. if attemptThis[i] != target[i]:
  21. completed = False
  22. attemptNext += random.choice(possibleCharacters)
  23. else:
  24. attemptNext += target[i]
  25. generation += 1
  26. attemptThis = attemptNext
  27. time.sleep(0.001)
  28.  
  29. print("Target matched! That took " + str(generation) + " generation(s)")
Success #stdin #stdout 0.07s 11864KB
stdin
Standard input is empty
stdout
THt.H!GU6sx6bm
PXtya0dLBVK!Dz
bhtVRihgCwCD2u
NRt:Hg.,a4!jHl
7btd:x;,Ht1eMG
z!tLLh0cqcXRvy
Xht2Ri3xpFk?Lk
a5tMsbrKlU?zfU
gytM7ngo;etNEN
jytt!nPAGe.UZj
dytMynmdZeug!t
:ytQynvh?eDhXa
nytgTnuM,euqqx
3yt5hn59qehZjW
VytBFnbokeLe6l
bytdMnfbUeEYDJ
Oyt0Qn1B7ex69j
:ytLRnyT0eK0h5
RyteZnIEFehRsD
hyta?nU4qeNxpE
pytr3npD6eZUkC
pyt65nM4xea!aZ
pyty;nfcjeoH1k
pytURnZ VeT8?:
pytX4nMsAeKk,n
pytyun6KZeE;,x
pytjTnE;1eqdoa
pytNGn xce p?J
pytHNn  peH6D!
pytq?n 9Pe?P,H
pytamn C.ejd!R
pytnin 1Kexh6T
pyt!.n PxeVSY;
pytI6n vVe2U:O
pytAEn y3e4:LA
pytvln LmeBo99
pyt:Fn BpeLoe2
pytTDn V7exoC,
pyt Mn predo6f
pyt?Yn lpeVotp
pyt 3n 7eegowY
pytPPn HteLoEU
pytiRn Mue0oi 
pyt:Mn 2zeUo6a
pytvnn .weNo .
pyt2On 2we6oX;
pytnln uwemoMW
pyt8rn 7weQo9Q
pytzQn xweNo5h
pyte?n 6we:oyZ
pyt!Dn AweJoP9
pytPzn vweGoOa
pytm.n eweAo0M
pytgjn mweBo2z
pytFWn Ywepog,
pythun Lwevo0.
pythYn Lwe4oS?
pythLn cweuo,U
pythbn FweIoMH
pythgn KweQowI
pyth.n Awe7oPy
pythEn GwevoeB
pythln iwe,ou8
pythQn  wejo8Q
pythRn Bweyoc6
pythXn !weXoSz
pythbn ;weDoQ.
pythPn 2wewoqB
pythDn owe2om 
pythsn gwehomj
pyth0n ?we!omj
pythbn .wexomA
pythEn bwexomf
pythun Nwe3omz
pyth:n twePomn
pythNn wwevomG
pythNn qweGomt
pyth!n iweqom3
pyth0n Hwekom:
pythLn ZweFomy
pythJn 3wekomu
pythRn zwebomD
pythsn Qwe.oma
pythWn Fwe9omf
pythCn aweKomX
pythLn aweoomO
pyth5n awehoms
pythzn aweIomP
pythtn aweMom.
pythhn awe6omY
pythzn aweNomH
pyth6n aweJom8
pythdn awecomz
pythqn aweeomB
pythen aweWom1
pythkn aweDom6
pythPn aweqoml
pythWn awegom7
pyth.n aweqom4
pythgn aweqome
pythRn awe!ome
pythun aweMome
pyth;n aweyome
pyth;n awe ome
pythnn awewome
pythwn awehome
pythVn awebome
pythmn awe3ome
pythTn awepome
pyth;n awefome
pythLn awe?ome
pythsn aweeome
pyth4n aweVome
pythAn aweOome
pythQn awe7ome
pythZn awekome
pyth9n awe2ome
pythyn aweqome
pyth;n aweTome
pythyn awe ome
pythdn awepome
pythTn aweAome
pythvn awegome
pyth0n awe:ome
pythJn awe,ome
pythPn aweeome
pythLn aweSome
pyth?n aweIome
pyth2n awesome
pythsn awesome
pythhn awesome
pythKn awesome
pythjn awesome
pythDn awesome
pythmn awesome
pythun awesome
pyth,n awesome
pythYn awesome
pythnn awesome
pyth7n awesome
pythen awesome
pythwn awesome
pythxn awesome
pyth7n awesome
pythwn awesome
pythnn awesome
pyth9n awesome
pyth?n awesome
pyth3n awesome
pythKn awesome
pythRn awesome
pythUn awesome
pyth9n awesome
pythmn awesome
pythFn awesome
pyth.n awesome
pythgn awesome
pyth:n awesome
pythpn awesome
pythjn awesome
pyth:n awesome
pythBn awesome
pyth5n awesome
pyth1n awesome
pythin awesome
pythnn awesome
pythUn awesome
pythJn awesome
pyth?n awesome
pythWn awesome
pyth!n awesome
pythRn awesome
pythOn awesome
pyth3n awesome
pythdn awesome
pythIn awesome
pyth2n awesome
pyth8n awesome
pyth5n awesome
pyth.n awesome
pyth5n awesome
pythsn awesome
pyth3n awesome
pyth7n awesome
pythPn awesome
pythpn awesome
pythRn awesome
pythgn awesome
pythxn awesome
pythQn awesome
pythfn awesome
pythNn awesome
pythxn awesome
pythRn awesome
pythCn awesome
pythtn awesome
pyth1n awesome
pythCn awesome
pythmn awesome
python awesome
Target matched! That took 200 generation(s)