Skip to content

Commit 6198315

Browse files
committed
Constant for cube sizes
1 parent 4af6bc0 commit 6198315

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

term_timer/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@
2323
DNF = 'DNF'
2424

2525
PLUS_TWO = '+2'
26+
27+
CUBE_SIZES = list(range(2, 8))

term_timer/scrambler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from random import choices
33
from random import randint
44

5+
from term_timer.constants import CUBE_SIZES
56
from term_timer.constants import MOVES
67
from term_timer.magic_cube import FACES_ORDER
78
from term_timer.magic_cube import Cube
@@ -65,7 +66,7 @@ def build_cube_moves(cube_size: int) -> list[str]:
6566

6667
MOVES_BY_CUBE = {
6768
i: build_cube_moves(i)
68-
for i in range(2, 8)
69+
for i in CUBE_SIZES
6970
}
7071

7172
ITERATIONS_BY_CUBE = {

term_timer/scripts/timer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from term_timer.argparser import ArgumentParser
77
from term_timer.console import console
8+
from term_timer.constants import CUBE_SIZES
89
from term_timer.in_out import load_solves
910
from term_timer.in_out import save_solves
1011
from term_timer.list import Listing
@@ -34,7 +35,7 @@ def get_arguments() -> Any:
3435
config.add_argument(
3536
'-c', '--cube',
3637
type=int,
37-
choices=range(2, 8),
38+
choices=CUBE_SIZES,
3839
default=3,
3940
metavar='CUBE',
4041
help=(

0 commit comments

Comments
 (0)