Skip to content

Commit

Permalink
display samples small
Browse files Browse the repository at this point in the history
  • Loading branch information
mzuenni committed Feb 23, 2024
1 parent aff8686 commit b248c39
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions bin/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from enum import Enum
from pathlib import Path
from colorama import Fore, Back, Style
from colorama import Fore, Style

import config

Expand Down Expand Up @@ -504,10 +504,7 @@ def __init__(
if t % 10 == 0:
verdicts.append([0, ''])
verdicts[-1][0] += 1
symbol = '-'
if testcase in self.samples:
symbol = '\033[48;5;237m' + symbol + Back.RESET
verdicts[-1][1] += symbol
verdicts[-1][1] += 's' if testcase in self.samples else '-'

printed = self.name_width + 1
for length, tmp in verdicts:
Expand Down Expand Up @@ -562,18 +559,15 @@ def clear(self, *, force=True):
self.last_printed = []

def _get_verdict(self, s, testcase):
back = '\033[48;5;237m' if testcase in self.samples else ''
res = Style.DIM + Fore.WHITE + '-' + Style.RESET_ALL
if s < len(self.results):
if testcase in self.results[s]:
v = self.results[s][testcase]
if v == 'ACCEPTED':
res = Fore.GREEN + 'A'
else:
res = Fore.RED + v[0]
res = Fore.GREEN if v == 'ACCEPTED' else Fore.RED
res += v[0].lower() if testcase in self.samples else v[0].upper()
elif s + 1 == len(self.results) and testcase in self.current_testcases:
res = Style.DIM + Fore.BLUE + '?'
return back + res + Style.RESET_ALL
return res + Style.RESET_ALL

def print(self, *, force=True, new_lines=2):
if force or self.print_without_force:
Expand Down

0 comments on commit b248c39

Please sign in to comment.