@@ -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 ):
@@ -513,6 +582,8 @@ def draw_o(ox, oy):
513582 v_draw .ellipse ([cx - 30 , cy - 30 , cx + 30 , cy + 30 ], outline = color_accent , width = 3 )
514583 v_draw .ellipse ([cx - 15 , cy - 15 , cx + 15 , cy + 15 ], outline = color_accent , width = 2 )
515584 v_draw .text ((cx , cy ), "AI" , fill = color_accent , anchor = "mm" )
585+ # Add "REVERSE" text
586+ v_draw .text ((400 , 280 ), "REVERSE" , fill = color_accent , anchor = "mm" , font = font_title )
516587 elif "unit converter" in n_lower :
517588 cx , cy = 400 , 225
518589
@@ -670,6 +741,37 @@ def draw_o(ox, oy):
670741 for x , y in [(430 , 160 ), (340 , 280 ), (460 , 280 )]:
671742 v_draw .line ([(x - 6 , y - 6 ), (x + 6 , y + 6 )], fill = color_accent_dim , width = 2 )
672743 v_draw .line ([(x + 6 , y - 6 ), (x - 6 , y + 6 )], fill = color_accent_dim , width = 2 )
744+ elif "sorting" in n_lower or "visualizer" in n_lower :
745+ # Sorting bars visualization
746+ cx , cy = 400 , 225
747+ # Draw sorting bars
748+ bar_values = [30 , 50 , 20 , 80 , 40 , 60 , 10 , 70 , 35 , 55 , 25 , 75 ]
749+ bar_width = 30
750+ total_width = len (bar_values ) * (bar_width + 6 )
751+ start_x = cx - total_width // 2
752+ for i , val in enumerate (bar_values ):
753+ x = start_x + i * (bar_width + 6 )
754+ height = val * 1.2
755+ y = cy + 60 - height
756+ # Different colors for different heights
757+ if val > 60 :
758+ color = (239 , 68 , 68 ) # Red for tall
759+ elif val > 35 :
760+ color = (245 , 158 , 11 ) # Yellow for medium
761+ else :
762+ color = (16 , 185 , 129 ) # Green for short
763+ v_draw .rounded_rectangle (
764+ [x , y , x + bar_width , cy + 60 ],
765+ radius = 4 ,
766+ fill = color ,
767+ outline = color_accent_dim ,
768+ width = 1
769+ )
770+ # Add sorting arrows
771+ v_draw .line ([(cx - 100 , cy - 80 ), (cx + 100 , cy - 80 )], fill = color_accent , width = 2 )
772+ v_draw .polygon ([(cx + 100 , cy - 85 ), (cx + 115 , cy - 80 ), (cx + 100 , cy - 75 )], fill = color_accent )
773+ # Text
774+ v_draw .text ((400 , 300 ), "SORTING" , fill = color_accent , anchor = "mm" , font = font_title )
673775 else :
674776 # Default nice abstract waves
675777 points = []
@@ -736,7 +838,7 @@ def draw_o(ox, oy):
736838 ("Chess Game" , "games" , "chess.webp" ),
737839 ("Number Sliding Puzzle" , "games" , "number-sliding-puzzle.webp" ),
738840 ("War Card Game" , "games" , "war-card-game.webp" ),
739- ("Minesweeper " , "games" , "minesweeper .webp" ),
841+ ("Queens Logic Puzzle " , "games" , "queens-logic-puzzle .webp" ),
740842
741843 # MATH
742844 ("AP/GP/AGP/HP Recognizer" , "math" , "progression-recognizer.webp" ),
0 commit comments