Commit f0358665 authored by Mestari Yousra's avatar Mestari Yousra
Browse files

algo principal du client

parent a530adb2
import zmq
import grille_client.py
import frappe_client.py
context = zmq.Context()
# Socket to talk to server
socket = context.socket(zmq.DEALER)
socket.connect("tcp://147.250.9.87:5555")
while True :
print("Voulez-vous jouer?")
jeu=input()
if jeu=="PLAY":
socket.send_multipart([b'',b"PLAY"])
empty,reponse=socket.recv_multipart()
print(reponse.decode())
JouC=input()
socket.send_multipart([b'',JouC.encode()])
empty,reponse=socket.recv_multipart()
print(reponse.decode())
nom=input()
socket.send_multipart([b'',nom.encode()])
grille_client(J1)
if JouC =="P":
socket.send_multipart([b'',b''])
grille_client(J2)
empty,message=socket.recv_multipart()
while message.decode()!="jeu fini":
frappe_serveur(J1)
empty,message=socket.recv_multipart()
if message.decode()!="jeu fini":
frappe_serveur(J2)
empty,message=socket.recv_multipart()
elif JouC=="C":
#jouer contre l'IA
empty,victoire=socket.recv()
print(victoire)
# Get the reply.
#message = socket.recv()
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment