Add-ons › Widgets › Fun and Games

Connect 4

by Holger Will ·

Description

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 !

Screenshots

Connect 4

Comments (17 on the original page, latest shown)

  • Benjamin JoffeJun 14, 2006
    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.
  • Holger WillJun 14, 2006
    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.
  • yadavankurJun 14, 2006
    I loved this game, my neighbour had it (same colors too). BTW, could you use two algorithms and allow levels - easy, hard.
  • Holger WillJun 15, 2006
    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.
  • olsen350Jun 15, 2006
    These kind of games always confuse me.
  • StoenJun 16, 2006
    This is a great widget 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
  • Holger WillJun 16, 2006
    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
  • StoenJun 16, 2006
    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
  • miagoffJun 21, 2006
    very nice, thank you.
  • FlipTXJun 29, 2006
    Fun, but I wish there was a way to let the computer go first sometimes.
  • bgfunk76Jul 6, 2006
    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.
  • CrazyTerabyteJul 12, 2006
    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.
  • EjrechJul 15, 2006
    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 new version if you implement a more difficult setting. ;]
  • sabrown100Aug 3, 2006
    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".
  • CygnusAug 31, 2006
    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.
  • LawmuneOct 10, 2006
    I like it! Not too easy, but not impossible, either, like many Connect 4 programs online.
  • yeelibertoJul 18, 2007
    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.

Download

This file has not been recovered yet. Do you have a copy? Tell us.

About this widget

Downloads63,834
CategoryFun and Games
Version1.0
Size57KB
Last updateJune 13, 2006
Devicesdesktop
Original pageInternet Archive