From 53a7834beb418c6b490984413fc15e423840c708 Mon Sep 17 00:00:00 2001 From: Samuel-de-Oliveira Date: Wed, 22 Sep 2021 19:36:21 -0300 Subject: [PATCH] Version: 0.1.4.2 --- Main.py | 2 +- README.md | 5 +++-- lib/Shufflers.py | 12 ++++++++++++ lib/__init__.py | 11 ++++++----- winConf.py | 6 ------ 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/Main.py b/Main.py index f9620e7..77d3baa 100644 --- a/Main.py +++ b/Main.py @@ -27,7 +27,7 @@ settingManager() if console == 3: timesSave.clear() - window('The cube\'s times is cleared!') + window('The cube\'s times is cleared!', 'double_line') if console == 4: window('Credits to:', 'double_line') print('The creator: Samuel de Oliveira') diff --git a/README.md b/README.md index 3c125b0..631b577 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,8 @@ lot :wink:. ## Release notes (0.1.4.2) 🗒️ - Setting manager added; -- New modalities added; +- timer's completion more accurated; +- New modality added (4x4x4 Cube); - Bug fixes. --- @@ -37,7 +38,7 @@ lot :wink:. --- ## Some warnings! ⚠️ -- This is the terminal version without grafical interface; +- This is the terminal version, without grafical interface; - This program is tested only in Linux and Windows, and not in other else; - this is a BETA version, it's not done yet; - If you found bugs please report to fast fixing. diff --git a/lib/Shufflers.py b/lib/Shufflers.py index 7842038..5edfdd3 100644 --- a/lib/Shufflers.py +++ b/lib/Shufflers.py @@ -146,4 +146,16 @@ def Lucia(size): old = m moves.append('B') break + for letter in range(0, size): + x = randint(1, 3) + if moves[letter] in 'RFU': + if x == 1: moves[letter] = f'{moves[letter]}w' + if x == 2: moves[letter] = f'{moves[letter]}w2' + if x == 3: pass # do nothing "\_(シ)_/" + + x = randint(1, 3) + if x == 1: moves[letter] = f'{moves[letter]}\'' # add apostrophe + if x == 2: moves[letter] = f'2{moves[letter]}' # add two + if x == 3: pass # do nothing "\_(シ)_/" + return moves diff --git a/lib/__init__.py b/lib/__init__.py index 81ad366..44c07f4 100644 --- a/lib/__init__.py +++ b/lib/__init__.py @@ -48,7 +48,7 @@ def askP2(): if setting['ask+2']: setting['ask+2'] = False else: setting['ask+2'] = True with open('lib/setting.json', 'w+') as f: f.write(json.dumps(setting, indent=True)) - window(f'ask +2 now is: {setting["ask+2"]}', 'double_line') + window(f'ask +2 now is: {setting["ask+2"]}', 'double_line') def settingManager(): while True: @@ -67,7 +67,7 @@ def settingManager(): break def defModality(modality): - modals = ['3x3', '2x2', '4x4', 'pyra'] + modals = ('3x3', '2x2', '4x4', 'pyra') print('All modalities:', end='') for m in modals: print(f' {m}', end=' ') @@ -105,16 +105,17 @@ def startTimer(modality): totalTime = time() - timer if is_pressed('space'): break consoleClear() - window(timeFormat(totalTime), 'double_line') + window(timeFormat(totalTime)) + if is_pressed('space'): break if setting['ask+2']: consoleClear() - window(f'Time: {timeFormat(totalTime)}') + window(f'Time: {timeFormat(totalTime)}') plustwo = str(input('Is this a +2? [Y/n]')).replace(' ', '') if plustwo in 'yY': totalTime = float(totalTime) + 2 consoleClear() - window(f'Time: {timeFormat(totalTime)}', 'double_line') + window(f'Time: {timeFormat(totalTime)}', 'double_line') timesSave.append(totalTime) print('_-_-_-_-_-_- Times -_-_-_-_-_-_') for n, t in enumerate(timesSave): print(f'{n+1} - {timeFormat(t)}') diff --git a/winConf.py b/winConf.py index e09e421..eaccfa4 100644 --- a/winConf.py +++ b/winConf.py @@ -1,12 +1,6 @@ -# To edit borders you need to edit settings.json file. - def line(size=40, style='basic'): if style == 'basic': print('-' * size) elif style == 'double_line': print('=' * size) - elif style == 'hashtag': print('#' * size) - elif style == 'zigzag': print('V' * size) - elif style == 'zagzig': print('W' * size) - else: raise NameError(f'The style \'{style}\' doesn\'t exist.') def window(msg='[Null]', style='basic'): line(len(msg) + 10, style)