From bfe2d1e03d37e70505d60d7b54a33c9a27fb9ecf Mon Sep 17 00:00:00 2001 From: Francesco Bariatti <francesco.bariatti@insa-rennes.fr> Date: Mon, 7 Mar 2016 16:09:49 +0100 Subject: [PATCH] Changes aux toolls --- tools/draw.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tools/draw.py b/tools/draw.py index d55de83..6b99ba7 100755 --- a/tools/draw.py +++ b/tools/draw.py @@ -1,21 +1,21 @@ #!/usr/bin/env python3 #-*- encoding: utf-8 -*- -import sys +try: + while True: + bitboard = int(input("Enter board : ")) -while True: - bitboard = int(input("Enter board : ")) + output = [" "] - output = [] - - for i in range(59, -1, -1): - if(i % 15 == 14): - output.append("|\n ") - elif(i % 15 == 7): - output.append("|\n") - if((bitboard >> i) & 1 == 1): - output.append("|x") - else: - output.append("| ") - - output.append("|") - print(''.join(output)) + for i in range(59, -1, -1): + if((bitboard >> i) & 1 == 1): + output.append("|x") + else: + output.append("| ") + + if(i % 15 == 0): + output.append("|\n ") + elif(i % 15 == 8): + output.append("|\n") + print(''.join(output)) +except KeyboardInterrupt: + print("\nMay the fish be with you.") -- GitLab