import random
from collections import Counter
# ---------------------------
# 1. SZIMULÁLT "HISTÓRIA"
# ---------------------------
def generate_draw():
return random.sample(range(1, 41), 7)
history = [generate_draw() for _ in range(500)]
# ---------------------------
# 2. GYAKORISÁG ELEMZÉS
# ---------------------------
all_numbers = [num for draw in history for num in draw]
freq = Counter(all_numbers)
# ---------------------------
# 3. "OKOS" SZÁMGENERÁLÁS
# ---------------------------
def weighted_pick():
numbers = list(range(1, 41))
weights = [freq[n] + 1 for n in numbers] # +1 hogy ne legyen 0
chosen = set()
while len(chosen) < 7:
pick = random.choices(numbers, weights=weights)[0]
chosen.add(pick)
return sorted(list(chosen))
# ---------------------------
# 4. FUTTATÁS
# ---------------------------
print("🎰 Pyroom kompatibilis 'AI' lottó szelvények:\n")
for i in range(5):
print(weighted_pick())
Pyroom kompatibilis 'AI' lottó szelvények:
[9, 17, 21, 22, 23, 38, 40]
[3, 5, 17, 18, 24, 26, 27]
[6, 7, 14, 15, 19, 22, 34]
[6, 7, 13, 19, 30, 31, 32]
[7, 16, 18, 26, 28, 29, 34]
Futttás; https://play.pyroom.app/playground---------------
Nincsenek megjegyzések:
Megjegyzés küldése