jeudi 5 mars 2020

Python : Is it possible to found a seed that occurence a special sequence of numbers with random.choice(range(128))?

Hey I would find a seed that create a special sequences of numbers that is :

[115,91,45,76,78,93,35,5,29,8,99,88,98,70,40,116,11,39,102,41,124,98,120,57,36,67,57,23,52,34,75,32,117,66,12,19,86,67,62,121,60,5,54,37,65,18,5,56,66,115,32,99,73,70,115,73,123,74,31]

I wonder if I could find one of seed that give me this result with the function get() I created :

def get():
   seed(x)
   return [choice(range(128)) for _ in range(59)]

with x a constant equal to the number that, apply as seed, give me the right top above sequence.

This is a little program I made to expect find it, but right now I'm about 1.6 milions tested seed and still nothing.

from random import choice, seed

lc =[115,91,45,76,78,93,35,5,29,8,99,88,98,70,40,116,11,39,102,41,124,98,120,57,36,67,57,23,52,34,75,32,117,66,12,19,86,67,62,121,60,5,54,37,65,18,5,56,66,115,32,99,73,70,115,73,123,74,31]

sd, h = 0,0
while 1:
  seed(sd)
  for c, o in enumerate(lc):
    if not choice(range(128)) == o:
      if c > h :
        print(f"[Seeed {sd}] {c} matchs")
        h = c
      sd += 1
      break

Can someone help me to find one of the right seed ?




Aucun commentaire:

Enregistrer un commentaire