fork download
  1. import random
  2.  
  3. # Server Seed
  4. server_seed_hash = "d48ff61045503ba1a66d90ebc460508565cad3c4b1c0f7070ba882a868fab1f1"
  5.  
  6. # Set the seed for reproducibility
  7. random.seed(server_seed_hash)
  8.  
  9. # Parameters for the board
  10. total_cells = 25 # 5x5 grid
  11. mines_count = 14 # Number of mines
  12.  
  13. # Generate mine positions
  14. mine_positions = random.sample(range(total_cells), mines_count)
  15.  
  16. # Build the 5x5 board
  17. board = []
  18. for i in range(total_cells):
  19. if i in mine_positions:
  20. board.append("💣") # Mine
  21. else:
  22. board.append("⬜") # Safe spot
  23.  
  24. # Convert to 5x5 grid for output
  25. board_5x5 = [board[i:i+5] for i in range(0, total_cells, 5)]
  26.  
  27. # Return the formatted board
  28. board_5x5
  29.  
Success #stdin #stdout 0.01s 9728KB
stdin
Standard input is empty
stdout
Standard output is empty