From 812394b611737b7cb738ab70884ceeecca957fd8 Mon Sep 17 00:00:00 2001 From: Fisch Date: Sat, 31 Mar 2018 23:01:33 +0200 Subject: [PATCH] add multi user feature --- eh18-image.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/eh18-image.py b/eh18-image.py index 2b81365..f311bdb 100644 --- a/eh18-image.py +++ b/eh18-image.py @@ -33,8 +33,23 @@ def randomnumber(pseed,pmin,pmax,v1,v2,v3): newseed=(int)(time.time()/60) seed=newseed +parts=4 #n users +user=1 #1..n + if __name__ == '__main__': + pixelcoords=[] + for _x in range(width): + for _y in range(height): + pixelcoords+=[(_x,_y)] + + random.seed(42) + random.shuffle(pixelcoords) + print(pixelcoords) + + + pixelcoords=pixelcoords[int(len(pixelcoords)/parts)*(user-1):int(len(pixelcoords)/parts)*(user)] + while True: starttime=time.time() commandsarray=[] @@ -50,12 +65,7 @@ if __name__ == '__main__': print("xv="+str(xv)+ "yv="+str(yv)) _current_command="" - pixelcoords=[] - for _x in range(width): - for _y in range(height): - pixelcoords+=[(_x,_y)] - shuffle(pixelcoords)