1
0
Fork 0
mirror of https://gitlab.com/oloturia/damastodon.git synced 2025-01-08 22:47:14 +01:00

alignment not good

This commit is contained in:
oloturia 2021-10-30 03:05:01 +02:00
parent 14eb5e9d19
commit d7a77b73c9
2 changed files with 3 additions and 5 deletions

View file

@ -7,7 +7,6 @@ import pickle
import random import random
import os import os
import time import time
import re
import sys import sys
api_url = sys.argv[1] api_url = sys.argv[1]
@ -62,7 +61,7 @@ def check_message(notification):
pickle.dump("@"+challenger,f) pickle.dump("@"+challenger,f)
pickle.dump(False,f) pickle.dump(False,f)
pickle.dump(board,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 return
elif content.split(" ")[1].lower() == "no": elif content.split(" ")[1].lower() == "no":
os.remove(save_position+content.split(" ")[0][1:]) os.remove(save_position+content.split(" ")[0][1:])

View file

@ -2,12 +2,11 @@
import re 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 = ""
bstr += frstrow bstr += frstrow
for row in range(0,len(status)): for row in range(0,len(status)):
bstr += str(row+1)+"" bstr += column[row]
if row % 2 == 0: if row % 2 == 0:
bstr += space bstr += space
for cell in range(0,int(len(status)/2)): for cell in range(0,int(len(status)/2)):