@@ -427,6 +427,75 @@ def draw_die(ox, oy):
427427 x = gx_min + r * 80 + 40
428428 y = gy_min + c * 80 + 40
429429 v_draw .text ((x , y ), d , fill = color_accent , anchor = "mm" )
430+ elif "queens" in n_lower or "logic" in n_lower :
431+ # Draw colored irregular regions with queens - matching the reference design
432+ cx , cy = 400 , 225
433+
434+ # Region colors inspired by the reference image (matching glassmorphism theme)
435+ region_colors_queens = [
436+ (219 , 112 , 147 ), # Pink/Magenta
437+ (70 , 130 , 180 ), # Steel Blue
438+ (144 , 238 , 144 ), # Light Green
439+ (255 , 215 , 0 ), # Gold/Yellow
440+ (186 , 85 , 211 ), # Medium Orchid
441+ (135 , 206 , 250 ) # Light Sky Blue
442+ ]
443+
444+ # Define irregular regions (6 regions, roughly 6 cells each)
445+ # Each region is a list of (row, col) coordinates
446+ regions_map = {
447+ 0 : [(0 , 0 ), (0 , 1 ), (0 , 2 ), (1 , 0 ), (1 , 1 ), (1 , 2 )], # Pink - top-left
448+ 1 : [(0 , 3 ), (0 , 4 ), (0 , 5 ), (1 , 3 ), (1 , 4 ), (1 , 5 )], # Blue - top-right
449+ 2 : [(2 , 0 ), (2 , 1 ), (3 , 0 ), (3 , 1 ), (4 , 0 ), (4 , 1 )], # Green - left
450+ 3 : [(2 , 2 ), (2 , 3 ), (3 , 2 ), (3 , 3 ), (4 , 2 ), (4 , 3 )], # Gold - center
451+ 4 : [(2 , 4 ), (2 , 5 ), (3 , 4 ), (3 , 5 ), (4 , 4 ), (4 , 5 )], # Purple - right
452+ 5 : [(5 , 0 ), (5 , 1 ), (5 , 2 ), (5 , 3 ), (5 , 4 ), (5 , 5 )] # Light Blue - bottom
453+ }
454+
455+ grid_size = 6
456+ cell_w = 50
457+ cell_h = 50
458+ grid_x = cx - (grid_size * cell_w ) // 2
459+ grid_y = cy - (grid_size * cell_h ) // 2 + 20
460+
461+ # Draw each cell with region background
462+ for region_id , cells in regions_map .items ():
463+ region_col = region_colors_queens [region_id ]
464+ for r , c in cells :
465+ x = grid_x + c * cell_w
466+ y = grid_y + r * cell_h
467+
468+ # Draw filled cell with semi-transparent region color
469+ v_draw .rectangle (
470+ [x + 1 , y + 1 , x + cell_w - 1 , y + cell_h - 1 ],
471+ fill = (* region_col , 100 ),
472+ outline = (* region_col , 150 ),
473+ width = 2
474+ )
475+
476+ # Draw grid borders
477+ for r in range (grid_size + 1 ):
478+ v_draw .line ([(grid_x , grid_y + r * cell_h ), (grid_x + grid_size * cell_w , grid_y + r * cell_h )],
479+ fill = (255 , 255 , 255 , 80 ), width = 1 )
480+ for c in range (grid_size + 1 ):
481+ v_draw .line ([(grid_x + c * cell_w , grid_y ), (grid_x + c * cell_w , grid_y + grid_size * cell_h )],
482+ fill = (255 , 255 , 255 , 80 ), width = 1 )
483+
484+ # Place queens on some cells (solution-like pattern)
485+ queen_positions = [
486+ (0 , 1 , 0 ), # Region 0 (Pink)
487+ (1 , 4 , 1 ), # Region 1 (Blue)
488+ (2 , 1 , 2 ), # Region 2 (Green)
489+ (3 , 3 , 3 ), # Region 3 (Gold)
490+ (4 , 4 , 4 ), # Region 4 (Purple)
491+ (5 , 2 , 5 ) # Region 5 (Light Blue)
492+ ]
493+
494+ for region_id , c , r in queen_positions :
495+ x = grid_x + c * cell_w + cell_w // 2
496+ y = grid_y + r * cell_h + cell_h // 2
497+ # Draw glowing queen crown emoji
498+ v_draw .text ((x , y ), "👑" , fill = (255 , 255 , 255 , 255 ), anchor = "mm" , font = font_subtitle )
430499 elif "blackjack" in n_lower :
431500 # Playing cards
432501 def draw_card (x , y , val ):
@@ -683,6 +752,7 @@ def draw_o(ox, oy):
683752 ("Chess Game" , "games" , "chess.webp" ),
684753 ("Number Sliding Puzzle" , "games" , "number-sliding-puzzle.webp" ),
685754 ("War Card Game" , "games" , "war-card-game.webp" ),
755+ ("Queens Logic Puzzle" , "games" , "queens-logic-puzzle.webp" ),
686756
687757 # MATH
688758 ("AP/GP/AGP/HP Recognizer" , "math" , "progression-recognizer.webp" ),
0 commit comments