Commit 610a76bd authored by Sylvain Lagrue's avatar Sylvain Lagrue
Browse files

exemple plus court

parent e25d55a7
......@@ -3,7 +3,27 @@ import sys
from crocomine_client import CrocomineClient
import time
def part1():
def test():
id="0"
if len(sys.argv) > 1:
id = sys.argv[1]
print(sys.argv)
if id:
group = "Groupe " + id
members = "Khaled et Sylvain " + id
else:
group = "Groupe 12"
members = "Khaled et Sylvain "
server = "http://localhost:8000"
# server = "http://croco.lagrue.ninja:8080"
password = "un mot de passe introuvable mais pas trop"
# croco = CrocomineClient(server, group, members, password, True)
croco = CrocomineClient(server, group, members, password)
## MAP 1
print("new_grid")
status, msg, grid_infos = croco.new_grid()
......@@ -37,77 +57,9 @@ def part1():
print(status, msg)
pprint(infos)
def part2():
## MAP 3
status, msg, grid_infos = croco.new_grid()
print(status, msg)
pprint(grid_infos)
status, msg, infos = croco.discover(0, 4)
print(status, msg)
pprint(infos)
status, msg, infos = croco.guess(0, 1, "S")
print(status, msg)
pprint(infos)
status, msg, infos = croco.guess(3, 6, "T")
print(status, msg)
pprint(infos)
## MAP 4
status, msg, grid_infos = croco.new_grid()
print(status, msg)
pprint(grid_infos)
# status, msg, infos = croco.guess(3, 6, "T")
# print(status, msg)
# pprint(infos)
status, msg, infos = croco.guess(1, 8, "C")
print(status, msg)
pprint(infos)
# status, msg, grid_infos = croco.new_grid()
# print(status, msg)
# pprint(grid_infos)
status, msg, infos = croco.chord(4, 3)
print(status, msg)
pprint(infos)
status, msg, infos = croco.chord(1, 8)
print(status, msg)
pprint(infos)
status, msg, infos = croco.chord(1, 7)
print(status, msg)
pprint(infos)
status, msg, infos = croco.chord(4, 3)
print(status, msg)
pprint(infos)
def test():
id = sys.argv[1]
print(sys.argv)
if id:
group = "Groupe " + id
members = "Khaled et Sylvain " + id
else:
group = "Groupe 12"
members = "Khaled et Sylvain "
server = "http://localhost:8000"
password = "un mot de passe introuvable mais pas trop" # ATTENTION, le mot de passe est en clair dans le fichier
global croco
# croco = CrocomineClient(server, group, members, password, True)
croco = CrocomineClient(server, group, members, password)
part1()
part2()
while status == "OK":
status, msg, grid_infos = croco.new_grid()
if __name__ == "__main__":
test()
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