fork 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.04s 11328KB
stdin
Standard input is empty
stdout
Hpb4rfBHL5rbP0
ze,hb:OFC66C4F
lAWhdpK5CFhBaH
h,:h.m,q7.dh w
G8WhPpxUXVL34w
RsbhkMbc!:;9NS
U;ihW6jFf,VgE9
Yr9hDyQaqc;3c4
.6JhuDNaZZJyz1
cyyh5;5aJIN6HQ
3yKhpT;a4.1HYj
tyrhzXea MbhOH
rylh1KEaO5AQF2
Wy4hjZvaxI E6r
oyQh0b?aLN2E9 
oyShH.FaEb7qe 
2yph,zJadkWQtr
fythsjLaaYR3YR
PythS5eaTAKveP
UythAsfaz3lF:a
6ythY9faM1u3sy
yythV.1ay? c4i
dythZPtaUMpoZU
;ythbeWazs7oGk
ZythJtVaTXloC?
yythCZFa1;Oo6A
cythd5LahV6oWm
iythLyuaWw o7x
EythZIgakAzoLa
UythxNdak0CoYc
dythY!xatslorj
 ythVR1aWQsotx
3ythM;SaHPso W
2ythv?7abzsoP?
4yth,3VagxsoHF
 ythSEaaOrsodA
Myth0teasusown
fyth.2maQ8sobz
yythz1Xa8jso:X
bythdDraHXsoFV
KythUsZaHMso,5
QythOANa!IsoVj
uytheQfafFsoiD
Nyth m0a7EsoJ 
PythRrxa2gsoBU
FythGCKa0tsoQM
pyth30garFsoCH
pythVipa;bsoK7
pyth8Qsa6pso6q
pythY4:acnsoq0
pythO49a,Csols
pythpGqa9JsoZX
pythr4UaUxso!Q
pythXwoaPdsoyN
pythLdFanZsou!
pythO.SavwsoUc
pythMd?ayfsoh;
pythhs0aWEsoXM
pythM5kaP0soRk
pythLp2aCQsos:
pytho,iaDHsozY
pythoutas5so37
pytho,patuso1N
pythoUSaE,soXI
pythoSmayBsoq0
pytho0HaDrsoad
pythoG8aLRsouQ
pythoibaF soFA
pythoKta?Lsobo
pythof?anNsoIc
pythoS9aIFsoY0
pytholpa?Rso60
pythoOQaA7sotJ
pytho;Ya bso:N
pythoKSa:Fso.X
pythoJdaQgsorw
pythoG.a:5so8M
pythoz2auEso9;
pytho1BaiJsoXH
pythooPak,sot!
pythoNWaT5soGx
pythom1aLQsoAS
pythorxaZzsoyJ
pythowEalvsoPs
pythoJHa1OsoUZ
pythodaasesoF3
pythoBiaTesocT
pythoNoa,esoy2
pytho5Ha;esotV
pytho fa9esoQh
pytho1ha;esojc
pythoMla3eso:g
pythooiafesoyx
pythoIla5esopK
pythok4a4esonU
pytho19axesoBs
pythoOwaweso3.
pytho.DawesoYy
pytho ,awesoN3
pythoo aweso8Q
pythoS aweso:2
pythob awesorg
pythoW aweso!,
pythoj aweso17
pythoV awesof!
pythoq awesoEy
pythoK awesouK
pytho! awesoYY
pytho? awesog7
pythoh awesosS
pythoL awesoKR
pytho? awesoej
pythoA aweso 0
pythoe awesox4
pythoB awesoJn
pythob awesotb
pythoN awesozF
pythoU awesoka
pytho2 awesoqp
pythoA aweso,Y
pytho: awesoTI
pythov awesoQ.
pythoJ awesoY9
pythok aweso9y
pythox aweso?r
pythos awesoq7
pythot awesoYR
pytho. aweso7a
pytho3 awesoNN
pythoK aweso:H
pythow awesouQ
pythoK aweso2r
pythoV awesoCk
pythop aweso5B
pythoc awesofh
pythoT awesoEE
pythoi awesoXX
pythoL aweso R
pythoo aweso5 
pythoD awesoAs
pythog awesoi8
pythoa awesohs
pythoM awesoC6
pythoZ awesoLd
pythoC awesobX
pythod awesoQL
pytho  awesoaQ
pytho; awesoP1
pythoG awesoer
pythoi aweso2E
pythoS aweso4g
pythop awesowD
pythoP awesoPm
pythop awesoJ7
pythoG aweso:b
pytho2 awesoSw
pythoa awesoVK
pythoF aweso93
pytho0 awesokn
pythoD awesoJz
pythoi awesoRO
pythoz aweso1U
pythoL awesozC
pythoQ awesog.
pythoT aweso6Y
pythoH awesocg
pythoj awesoH3
pythoq awesoH2
pythoL awesoCn
pytho4 aweso81
pythod awesol6
pytho: aweso14
pytho, awesoKB
pythop awesocY
pythoX awesoHP
pythoU awesoxN
pythoJ awesoY6
pythoX awesoM9
pythoX awesoNe
pythor awesope
pythou awesole
pythoJ aweso:e
pythoJ awesoge
pythoD aweso0e
pytho5 awesoMe
pythoe awesole
pythok awesobe
pytho, aweso.e
pythoN awesoee
pythoG awesoXe
pytho1 aweso0e
pythol awesove
pytho! awesoGe
pythoF aweso3e
python awesoZe
python awesoee
python aweso5e
python awesoYe
python awesoRe
python awesoZe
python aweso3e
python awesoPe
python aweso1e
python aweso,e
python awesoFe
python awesoTe
python aweso:e
python awesoEe
python awesoUe
python awesoDe
python aweso,e
python awesoKe
python aweso2e
python aweso,e
python awesoue
python awesofe
python aweso7e
python awesode
python awesoRe
python aweso,e
python awesowe
python awesooe
python awesoxe
python aweso e
python awesote
python awesoqe
python awesoTe
python awesoLe
python awesoMe
python awesoJe
python awesoie
python awesowe
python aweso,e
python awesoVe
python awesoYe
python aweso9e
python awesofe
python awesoNe
python awesoCe
python awesoAe
python awesoPe
python awesoSe
python awesoYe
python awesote
python aweso7e
python aweso!e
python aweso5e
python awesose
python awesoRe
python awesofe
python awesore
python awesoce
python awesoce
python aweso1e
python aweso e
python awesoDe
python awesome
Target matched! That took 257 generation(s)