Limit permutations to 1000 (#383)
limit permutations to 1000 Co-authored-by: jjanzen <jjanzen@jjanzen.ca>
This commit is contained in:
parent
02c64ef281
commit
211beb7b6a
1 changed files with 4 additions and 4 deletions
|
|
@ -7,7 +7,7 @@ import importlib.util
|
||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
import traceback
|
import traceback
|
||||||
from itertools import permutations
|
from itertools import permutations, islice
|
||||||
from math import ceil
|
from math import ceil
|
||||||
|
|
||||||
from . import termenv, neofetch_util, pride_month
|
from . import termenv, neofetch_util, pride_month
|
||||||
|
|
@ -251,7 +251,7 @@ def create_config() -> Config:
|
||||||
slots = list(set(map(int, re.findall('(?<=\\${c)[0-9](?=})', asc))))
|
slots = list(set(map(int, re.findall('(?<=\\${c)[0-9](?=})', asc))))
|
||||||
while len(pis) < len(slots):
|
while len(pis) < len(slots):
|
||||||
pis += pis
|
pis += pis
|
||||||
perm = {p[:len(slots)] for p in permutations(pis)}
|
perm = {p[:len(slots)] for p in islice(permutations(pis), 1000)}
|
||||||
random_count = max(0, ascii_per_row * ascii_rows - len(arrangements))
|
random_count = max(0, ascii_per_row * ascii_rows - len(arrangements))
|
||||||
if random_count > len(perm):
|
if random_count > len(perm):
|
||||||
choices = perm
|
choices = perm
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue