新規登録

ウィジェット » Connect 4

Connect 4 V1.0 2006/06/13 20:37:49

the classic 2 player game connect 4.
play against opera.
try to get a row of 4 stones of the same color, horizontaly, vertacily or diagonaly.
have fun !


コメント 17 通

ページのトップからログインしコメントする

1 - 17 中 17

Very nice. Like playing against someone. I had draw at the first game.

in the beggining takes a little bit of ime to process the game.

発言者 yeeliberto, # 2007/07/18 17:57:23

I like it! Not too easy, but not impossible, either, like many Connect 4 programs online.

発言者 Lawmune, # 2006/10/10 20:57:25

I would prefer if the holes were not transparent. As it is now the game just gets hidden behind another application as soon as you by mistake click in a hole. It also looks more confusing depending on the background. At least an option to turn off this transparency would be nice.

発言者 Cygnus, # 2006/08/31 23:29:10

If you want a quich way to start a new game then a way to restart any widget is to right click on it and select "Restart".

発言者 sabrown100, # 2006/08/03 19:38:05

Hmm, have you considered making a Checkers widget, or better yet, a Chinese Checkers widget? =D



Fun stuff, but way too easy...

Played thrice, won thrice. Every time, I set the computer up such that if it drops a piece in a certain column or two, I can drop one on top and win. (my habitual strategy in Connect 4 =) So eventually, after stacking up the other columns (and sometimes having to drop one of my own in an empty spot since it's trying to avoid the set-up column(s), at least it's kinda smart that way), that column or two is it's only move choice, and I win by default. Maybe you could implement a strategy (or anti-strategy) similar to that in the AI, perhaps with a little randomization?

At the very least, an option to increase the search depth for those of us with faster computers would be nice. (though it only takes 4secs of 'thinking' max per turn here, and I've got a pretty crappy laptop, heh)



Hmm, on a side note, being able to change piece/board colors would be a big plus as well. (like red/black pieces, yellow board)

Also, do you think it would be possible to connect to someone else running this widget for a little 2P? =]



Definitely looking forward to the

発言者 Ejrech, # 2006/07/15 17:34:38

Slow... Computer takes too much time thinking... Looks like it is doing some brute-force algorithm (mini-max?). This also means it is predicable, it will redo the same movements everytime.

Ah, I also accept donations for a faster computer.

発言者 CrazyTerabyte, # 2006/07/12 21:44:21

Everyone forgets about those of us who have a slower system that makes certain widgets very choppy. I'll gladly take donations for a faster computer.

発言者 bgfunk76, # 2006/07/06 2:56:33

Fun, but I wish there was a way to let the computer go first sometimes.

発言者 FlipTX, # 2006/06/29 15:10:53

very nice, thank you.

発言者 miagoff, # 2006/06/21 15:14:22

Im not sure how you implemented your search algorithm or whether the logic of the game would allow it, but perhaps you could utilise some kind of memory to store search results so that they could be reused? In any case, I know its not a simple problem and your widget is still great fun

発言者 Stoen, # 2006/06/16 21:19:15

hi Stoen

i guess it would be possible, but virtually not playable. right now there are no more than 7 moves possible in one position, i'm searching with depth 6 thats 7^6 = 117,649 position for the first move.
A grid with the same size but without gravity would mean 42 possible moves in the first position, thats 42*41*40*39*38*37 = 3,776,965,920. to crunch this, not only a real programming language and a fast computer would be enough,
you would need a much more sophisticated search algo.

so implemeting your ideas would be too much, at least for me :-(
but great idea anyways.
cheers
Holger

発言者 Holger Will, # 2006/06/16 17:27:15

This is a great widget :smile:

Could you consider having options for the user to change the size of the grid, the number of stones in a row required to win as well as toggling gravity (so the stones dont drop, but rather stay in whatever grid position you select).

Obviously this would increase the complexity of the widget and the required processing time of the graph search algorithm but it would be really cool, I remember playing hour long games of connect 5 on A4 sized grids during expecially boring university lectures

発言者 Stoen, # 2006/06/16 13:55:18

These kind of games always confuse me.

発言者 olsen350, # 2006/06/15 22:43:36

hi yadavankur,
yes i will add an option to select different levels. its allready in there, but there is no User Interface for it, yet.

発言者 Holger Will, # 2006/06/15 16:17:12

I loved this game, my neighbour had it (same colors too). BTW, could you use two algorithms and allow levels - easy, hard.

発言者 yadavankur, # 2006/06/14 21:06:28

Yes, the UI is not quite ready yet, i plan to add options to
-set playing strength
-restart the game
-let the computer begin

i also like the idea with the opening book ! i could have an array with all position of depth 4 and implement some kind of learning algorithm so it learns openings when you play.

>>why does it still go through the loading bar procedure when there is an obvious move such as an instant win?<<

i use a simple alphabeta search with fixed depth, so the search returns with the best move in a position after searching all moves. i could add a break condition if a winning move is found, or before performing the full search do a search with depth 1 and only search more if the game is not won. i slightly favor the depth 1 search solution, but i have to think about this a bit more.

発言者 Holger Will, # 2006/06/14 17:48:06

Great! I like it, managed to beat it after about 8 tries. The loading bar is a good idea and appears to be quite accurate. My only problem is that there is no restart button or a way to play with two players.

I am curious about your algorithm, why does it still go through the loading bar procedure when there is an obvious move such as an instant win? Did you make it appear to keep going purposely or does it not have a pre-search for moves like that? Also, I think you should generate a table of moves for at least the first two moves, there is no reason it should have to think that early in the game.

発言者 Benjamin Joffe, # 2006/06/14 16:44:09

Copyright © 2001 - 2008 Opera Software. All rights reserved. About | Contact | Privacy | Disclaimer |