diff --git a/tools/draw.py b/tools/draw.py new file mode 100755 index 0000000000000000000000000000000000000000..d55de83e271827cee47a4cbb5fa5cf89ad166af9 --- /dev/null +++ b/tools/draw.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +#-*- encoding: utf-8 -*- +import sys + +while True: + bitboard = int(input("Enter board : ")) + + 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)) diff --git a/tools/penguin.py b/tools/penguin.py new file mode 100755 index 0000000000000000000000000000000000000000..4a7dc5fb95233cf32eb319ba84fb7cec8c3fe8eb --- /dev/null +++ b/tools/penguin.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +#-*- encoding: utf-8 -*- +import sys + +while True: + p = int(input("Enter penguin: ")) + + print("Position: ", p & 63) + print("Nb moves: ", (p >> 6) & 63) + print("Nb moves A: ", (p >> 12) & 7) + print("Nb moves B: ", (p >> 15) & 7) + print("Nb moves C: ", (p >> 18) & 7) + print("Nb moves D: ", (p >> 21) & 7) + print("Nb moves E: ", (p >> 24) & 7) + print("Nb moves F: ", (p >> 27) & 7)