Live data from Hacker News

Can You Beat This Game?

news.ycombinator.com

11–15 of 15 posts

Re: Can You Beat This Game?

#11

Earlier quoted context omitted.

Thanks a ton! I will tighten it up! Hopefully, you will pull the next release and try to beat it again. I do hope it was not a complete pushover.....

Ok!!! Round 2! Any challengers?

I couldn't resist... Well done. This version appears to be unbeatable.

Re: Can You Beat This Game?

#12
post #10

Earlier quoted context omitted.

That is not a bug. It is there because these locations are just not initialized. How did you manage to beat the cpu? Can you remember the last state of the game board which led to your victory? Thanks.

It was unexpected by me so I consider it a bug. You're encoding the game state as a giant switch statement. This is not the best approach. The size of your code will increase exponentially with the complexity of the game. The only reason it works at all is because tic-tac-toe is very simple. You should read up on representing this as a game tree: http://en.wikipedia.org/wiki/Game_tree http://en.wikipedia.org/wiki/Ext…

You are correct about the representation, but I went for the most low-scale approach since the search space is so small. The next version will learn how to build its own rules, but that is for another day. Thanks for all of your help though. I really appreciate it.

Re: Can You Beat This Game?

#15
post #13

Also you neglected to mention the most interesting part of this: http://github.com/RichardBronosky/Tic-Tac-Toe The forked network for this project is interesting. Is this for a class or something?

Sorry that I did not mention that part: This was actually for a job interview. So, it had to be completed in a short amount of time.
Post reply on HN