Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
CharOrder can now be randomized depending on if RANDOMIZE_CHARS=(0|1).
  • Loading branch information
Jigsy1 authored Feb 11, 2023
1 parent 8e5046d commit 22c47f8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions py3/keyShuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
IDEO_INI = "Ideo.ini"
OUTPUT_FILE = "Ideo_{}.ini".format(TIMESTAMP)

RANDOMIZE_CHARS = 1
# `-> Randomize the CharOrder. 1 = Yes; 0 = No.


# Function(s):

Expand Down Expand Up @@ -52,6 +55,18 @@ def main():
while char < len(chars):
SHUFFLE.append(chars[char])
char += 1
if RANDOMIZE_CHARS == 1:
PRE_ORDER = list(CHAR_ORDER)
NEW_ORDER = []
ORDER_COUNT = len(PRE_ORDER)
while ORDER_COUNT > 0:
randomChar = secrets.choice(range(0, len(PRE_ORDER)))
NEW_ORDER.append(PRE_ORDER[randomChar])
del PRE_ORDER[randomChar]
ORDER_COUNT -= 1
CHAR_ORDER = ""
CHAR_ORDER = "".join(NEW_ORDER)
del PRE_ORDER
# ,-> Shuffle the list randomly at least once.
KEY_COUNT = len(SHUFFLE)
PRE_SHUFFLE = []
Expand Down

0 comments on commit 22c47f8

Please sign in to comment.