Created
April 18, 2015 10:13
-
-
Save Tjorriemorrie/08289c2a82a422c1500f to your computer and use it in GitHub Desktop.
Does not work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import random | |
from os import path | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser(description='Entelect Challenge Python Bot Player', epilog='Good luck!') | |
parser.add_argument('output_path', help='the output path where files will be saved') | |
args = parser.parse_args() | |
if not path.exists(args.output_path): | |
raise Exception('Output folder {0} does not exist.'.format(args.output_path)) | |
output_file = path.join(args.output_path, 'move.txt') | |
with open(output_file, 'w') as f: | |
f.write('{0}\r\n'.format(random.choice([ | |
'Nothing', | |
'MoveLeft', | |
'MoveRight', | |
'Shoot', | |
'BuildAlienFactory', | |
'BuildMissileController', | |
'BuildShield' | |
]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment