Advertisement
martaczaska

dafuq

May 23rd, 2021
1,024
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.10 KB | None | 0 0
  1. Array.append(type_dictionary[field_type]) ##dodaje element na końcu listy
  2.  
  3. na końcu key == 29:
  4.  
  5. ###MIKOŁAJ - return Array, albo odwołanie do fieldofArray?
  6.     ###prawdopodobnie trzeba będzie
  7.  
  8.  
  9. def recognizeWhatType(numb_oftypebits,mess, poss):
  10.     value = ""
  11.     j = 0
  12.     shape_dictionary = {'000': 2, '001': 3, '010': 4, '011': 5, '100': 7, '101': 9}
  13.  
  14.     while j < numb_oftypebits:
  15.         value += str(mess[poss])
  16.         poss += 1
  17.     typeofshape = shape_dictionary[value]
  18.     numberofFields = len(arrays_aggregates.arraysDataBitlengths[typeofshape])
  19.     poss += 3 #czy potrzebne (to do przedunięcia o liczbę bitów typu na początku ciągu)
  20.  
  21.     return typeofshape, numberofFields
  22.  
  23. def fieldofArray(n, f_num, type, mess, pos, endgameArray, dict): # pozamieniać w typach 6_7 i 8_7
  24.     while n < f_num:
  25.         field_bits = arrays_aggregates.arraysDataBitlengths[type][n]
  26.         field_type = arrays_aggregates.arraysDataTypes[type][n]
  27.         fragment = mess[pos:(field_bits + pos)]
  28.         endgameArray[n] = dict[field_type(fragment, field_bits)]
  29.         n += 1
  30.     return endgameArray
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement