Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. seveur:
  2. string=str(model.map.width) +" "+str(model.map.height)+" "
  3.         for y in range(0,model.map.height):
  4.             for x in range(0,model.map.width):
  5.                 string += str(model.map.array[y][x])
  6. client:
  7. self.model.map.width=int(split[0])
  8.         self.model.map.height=int(split[1])
  9.         pos=0
  10.         array=[]
  11.         raw=[]
  12.         for c in split[2]:
  13.             raw.append(c)
  14.             pos+=1
  15.             if pos%int(split[0])==0 :
  16.                 array.append(raw)
  17.                 raw=[]
  18.         self.model.map.array=array
  19.         connexion_serveur.sendall(b"ok")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement