import pygame as pyg
from collections import defaultdict

STEP = 5

DIMENSION = 95

BOARD_SIZE = 4

WINDOW_LENGTH = BOARD_SIZE*(DIMENSION + STEP) + STEP

WINDOW_SIZE = (WINDOW_LENGTH, WINDOW_LENGTH)

POS_VALUES = [STEP + j*(DIMENSION + STEP) for j in range(0, BOARD_SIZE)]

PLACEHOLDER_ARRAY = [[pyg.Rect(x, y, DIMENSION, DIMENSION) for y in POS_VALUES] for x in POS_VALUES]

NUMBER_LIST = [2**x for x in range(1, 20)]

NUMBER_COLOR_DICT = defaultdict(lambda: (0, 0, 0))

NUMBER_COLOR_DICT[NUMBER_LIST[ 0]] = (238, 228, 218)
NUMBER_COLOR_DICT[NUMBER_LIST[ 1]] = (237, 224, 200)
NUMBER_COLOR_DICT[NUMBER_LIST[ 2]] = (242, 177, 121)
NUMBER_COLOR_DICT[NUMBER_LIST[ 3]] = (245, 149,  99)
NUMBER_COLOR_DICT[NUMBER_LIST[ 4]] = (246, 124,  95)
NUMBER_COLOR_DICT[NUMBER_LIST[ 5]] = (246,  94,  59)
NUMBER_COLOR_DICT[NUMBER_LIST[ 6]] = (237, 207, 114)
NUMBER_COLOR_DICT[NUMBER_LIST[ 7]] = (237, 204,  97)
NUMBER_COLOR_DICT[NUMBER_LIST[ 8]] = (237, 200,  80)
NUMBER_COLOR_DICT[NUMBER_LIST[ 9]] = (237, 198,  65)
NUMBER_COLOR_DICT[NUMBER_LIST[10]] = (237, 194,  46)