From d7a77b73c9e37bab85f1e8b5fa67fb327c996ab7 Mon Sep 17 00:00:00 2001 From: oloturia <5429234+oloturia@users.noreply.github.com> Date: Sat, 30 Oct 2021 03:05:01 +0200 Subject: [PATCH] alignment not good --- damastodon.py | 3 +-- draughts_engine.py | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/damastodon.py b/damastodon.py index 919b531..d98b9ec 100755 --- a/damastodon.py +++ b/damastodon.py @@ -7,7 +7,6 @@ import pickle import random import os import time -import re import sys api_url = sys.argv[1] @@ -62,7 +61,7 @@ def check_message(notification): pickle.dump("@"+challenger,f) pickle.dump(False,f) pickle.dump(board,f) - mastodon.status_post("◾: @"+account+" ◽: @"+challenger+" turn ◽\n"+dama.draw_checkerboard(board,space="🟥 ",white_norm="◽ ",white_knight="⚪ ",black_norm="◾ ",black_knight="⚫ ",empty="🟦 ",frstrow="0🇦 🇧 🇨 🇩 🇪 🇫 🇬 🇭 \n"),visibility="direct") + mastodon.status_post("◾: @"+account+" ◽: @"+challenger+" turn ◽\n"+dama.draw_checkerboard(board,space="🟥",white_norm="◽",white_knight="⚪",black_norm="◾",black_knight="⚫",empty="🟦",frstrow="0 🇦 🇧 🇨 🇩 🇪 🇫 🇬 🇭 \n"),visibility="direct") return elif content.split(" ")[1].lower() == "no": os.remove(save_position+content.split(" ")[0][1:]) diff --git a/draughts_engine.py b/draughts_engine.py index fcc4212..617b667 100755 --- a/draughts_engine.py +++ b/draughts_engine.py @@ -2,12 +2,11 @@ import re -def draw_checkerboard(status,space="▒",white_norm="h",white_knight="H",black_norm="b",black_knight="B",empty=" ",frstrow=" abcdefgh\n"): +def draw_checkerboard(status,space="▒",white_norm="h",white_knight="H",black_norm="b",black_knight="B",empty=" ",frstrow=" abcdefgh\n",column="12345678"): bstr = "" bstr += frstrow for row in range(0,len(status)): - bstr += str(row+1)+"" - + bstr += column[row] if row % 2 == 0: bstr += space for cell in range(0,int(len(status)/2)):