Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. msg = [1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,1,1,1,1,1,0,0,1,0]
  2.  
  3.  
  4. def get_new_theta(msg, theta):
  5. theta=random.randint(40,45)
  6. new_theta = [theta]
  7. for a, b in zip(msg[3::5], msg[4::5]):
  8. new_theta.append(new_theta[-1] + a + b)
  9. return new_theta
  10.  
  11. for i, theta in enumerate(get_new_theta(msg, 1)[:-1]):
  12. for j in range(5):
  13. print(theta, msg[i*5+j])
  14.  
  15. 44 1
  16. 44 0
  17. 44 1
  18. 44 0
  19. 44 1
  20. 45 0
  21. 45 1
  22. 45 1
  23. 45 1
  24. 45 1
  25. 47 1
  26. 47 1
  27. 47 1
  28. 47 0
  29. 47 1
  30. 48 1
  31. 48 1
  32. 48 1
  33. 48 0
  34. 48 0
  35. 48 0
  36. 48 1
  37. 48 1
  38. 48 1
  39. 48 1
  40. 50 1
  41. 50 0
  42. 50 0
  43. 50 1
  44. 50 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement