about summary refs log tree commit diff homepage
path: root/client-examples
diff options
context:
space:
mode:
authorNguyễn Gia Phong <vn.mcsinyx@gmail.com>2019-10-09 12:43:22 +0700
committerNguyễn Gia Phong <vn.mcsinyx@gmail.com>2019-10-09 12:43:22 +0700
commitbb3d4158ca78ac53c68f1c5bca26fcef9e4010e5 (patch)
treed5f1bc45eb657192d7c4589ac4e129ef0ec10489 /client-examples
parentef70806a48a6917f64110716ec08d9174626079a (diff)
downloadbrutalmaze-bb3d4158ca78ac53c68f1c5bca26fcef9e4010e5.tar.gz
Remove useless enemy weights and clean up
Diffstat (limited to 'client-examples')
-rwxr-xr-xclient-examples/hit-and-run.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/client-examples/hit-and-run.py b/client-examples/hit-and-run.py
index 7bbf5a1..ef90276 100755
--- a/client-examples/hit-and-run.py
+++ b/client-examples/hit-and-run.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 from math import inf, atan2, degrees
-from random import randrange, shuffle
+from random import randrange
 from socket import socket
 
 AROUND = [5, 2, 1, 0, 3, 6, 7, 8]
@@ -25,8 +25,7 @@ around, move = [0, 1, 2, 3, 5, 6, 7, 8], 4
 while True:
     length = clientsocket.recv(7).decode()
     if length in ('', '0000000'): break     # connection closed or game over
-    l = clientsocket.recv(int(length)).decode().split()
-    data = iter(l)
+    data = iter(clientsocket.recv(int(length)).decode().split())
     nh, ne, nb, score = (int(next(data)) for _ in range(4))
     maze = [list(next(data)) for _ in range(nh)]
     hp = (lambda c: 0 if c == 48 else 123 - c)(ord(next(data)))