rosaage

Untitled

Mar 11th, 2016
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import socket
  2. import time
  3. from random import randint
  4.  
  5. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  6. s.connect(('127.0.0.1', 54321))
  7. s.send(bytes("NAME 神さま\n", 'UTF-8'))
  8.  
  9. cmd = ["MISSILE\n", "SEEKING\n", "MINE\n"];
  10. move = ["ACCELERATE\n", "LEFT\n", "RIGHT\n"];
  11.  
  12. while 1==1:
  13.     s.send(bytes(cmd[randint(0,2)], 'UTF-8'))
  14.     time.sleep(1)
  15.     s.send(bytes(move[randint(0,2)], 'UTF-8'))
  16.     time.sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment