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

Connect Four game #18

Open
colwem opened this issue Jul 26, 2012 · 3 comments
Open

Connect Four game #18

colwem opened this issue Jul 26, 2012 · 3 comments

Comments

@colwem
Copy link
Contributor

colwem commented Jul 26, 2012

I was inspired by LPMC's tic tac toe game and created a connect four game.

repo

It's not really connected to the bot yet. But you can play against the machine by runing irb and

ruby
require './connect_four.rb'
cf = ConnectFour.new
cf.next_step([column number indexed from zero of the move you want to make])


It is slow as hell.  It does a depth first search of all possible boards 4 moves away and does a board evaluation.  that's 7^4 or 2401 board evaluations and it doesn't do a good job either.  lots of room for improvement.
@yash3ahuja
Copy link

I don't think you committed anything. Additionally, are you using minimax? I don't imagine minimax would take so long that you would describe it as "slow as hell." It's slow, but not that slow.

@colwem
Copy link
Contributor Author

colwem commented Jul 27, 2012

Yeah I think that's what you call it. And no it shouldn't be that slow. Yet it is very slow so I'm messing something up. I'm pretty sure I know of a few places where I can improve it I'm just not that great at ruby so it would be nice if someone took a look.

Yeah I guess I didn't commit it. It's committed now

@colwem
Copy link
Contributor Author

colwem commented Jul 30, 2012

Well it's working pretty well now. Only missing feature is the tope of the game. there is no checking for hitting the top of the board. There are also no tests. But I don't think they make any sense anymore since I don't envision future development on it and I don't really know how to test that an AI plays well other than to play against it (It kicks my but right now).

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

No branches or pull requests

2 participants