Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Human Regex #2

Open
oshlern opened this issue Dec 19, 2016 · 0 comments
Open

Human Regex #2

oshlern opened this issue Dec 19, 2016 · 0 comments

Comments

@oshlern
Copy link
Member

oshlern commented Dec 19, 2016

Current State

Right now, class Human(Agent) resides in main.py. It takes in an input through terminal of what move should be made. It currently splits the input string on commas and performs int() of what's in between. This throws errors that crash the program (unless in interactive mode) if anything but a string of the form int, int is inputted. This could stop testing or showing of our code in the middle of games or after much training (which would then be lost).

To Do

We should add regular expression (there's a commented out section which isn't great: re.sub probably doesn't retain the numbers right now, and it probably only works for a 2d board). Having more sophisticated parsing that disregards typos or weird characters or maybe asks the user to resubmit a move while indicating the proper format. That would make sure progress isn't lost because of small mistakes, and this would be a great opportunity to learn regex (which is super useful).

Also, maybe make it nicer. How do we want humans to give in input? What should the text say? Code as you please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant