Skip to content

Instantly share code, notes, and snippets.

@Tjorriemorrie
Created April 18, 2015 10:13
Show Gist options
  • Save Tjorriemorrie/08289c2a82a422c1500f to your computer and use it in GitHub Desktop.
Save Tjorriemorrie/08289c2a82a422c1500f to your computer and use it in GitHub Desktop.
Does not work
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