# The PHATstar Society (www.phatstar.net)
# Bulletin Board System Modification
# ANSI Selector From Random List
# Made With PYTHON for LINUX
# Released 2021-01-07 YMD
# Version 1.0 by Cr1mson and Version 2.0 by MeaTLoTioN
# society@phatstar.org


import random, os.path
from shutil import copyfile

def RND() :
  # generate a random number and return it
  return random.randint(1,99)

# set some global variables
target = 'displayme.ans'
found = False
x = 0

while (not found) and (x <= 100) :
  x += 1 # increment each try
  test = 'display'+str(RND())+'.ans' # set filename to test

  if os.path.isfile(test) : # if test filename exists copy it
    # print("Copying "+test+" to "+target)
    copyfile(test, target)
    found = True

if x > 100 : # if testfile doesn't exist abort
  pass # abort as no files to copy
  # print("Aborted with no files to copy")
