Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2007-04-10 12:21:54

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,534

Four In A Line Flash Version

I have spent Easter taking the current Javascript Version of Four In A Line and developing this New Flash version of Four In A Line

Play with it ... see if you like it, tell me if it misbehaves.

(I might make a 3D version!)


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#2 2007-04-10 18:36:51

Devantè
Real Member
Registered: 2006-07-14
Posts: 6,400

Re: Four In A Line Flash Version

Very good, the controls are smoother and the thinking time for the CPU is realistic.

I was going to say that you need to decrease the thinking time, but now I've changed my mind. smile

Offline

#3 2007-04-10 19:01:38

justlookingforthemoment
Moderator
Registered: 2005-05-26
Posts: 2,161

Re: Four In A Line Flash Version

It's really nice. I especially like the smoothness of the falling counters.

For 'Games Won', could the blue player's number be blue instead of pink?

Offline

#4 2007-04-10 19:26:49

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,534

Re: Four In A Line Flash Version

Changed the pink! Also subtly changed the board.


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#5 2007-04-10 19:34:18

justlookingforthemoment
Moderator
Registered: 2005-05-26
Posts: 2,161

Re: Four In A Line Flash Version

Good, there's no pixelated white ring around the counters any more!
                                                                                                                       
I think. Unless it was all my imagination in the first place. big_smile

Offline

#6 2007-04-10 20:15:16

Zhylliolom
Real Member
Registered: 2005-09-05
Posts: 412

Re: Four In A Line Flash Version

This shouldn't be an issue if you play the game normally, but if you click "new game" when a piece is falling sometimes it will freeze in the slot it is in and float in midair. When you try to put a piece in that column the next game your piece will go where that old one is hovering. I've only gotten it to do this a couple times though, it doesn't happen every single time. You can use this bug to give the computer an extra turn at the start, but it doesn't really make the game harder.

Offline

#7 2007-04-10 23:06:41

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,534

Re: Four In A Line Flash Version

jl: you are right!

zhy: I better look at that, thanks.


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#8 2007-04-11 04:04:26

espeon
Real Member
Registered: 2006-02-05
Posts: 2,586

Re: Four In A Line Flash Version

I think it was good. Um when you click on new match and you've already put a few counters down, the counters stay there until you click on new game


Presenting the Prinny dance.
Take this dood! Huh doood!!! HUH DOOOOD!?!? DOOD HUH!!!!!! DOOOOOOOOOOOOOOOOOOOOOOOOOD!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Offline

#9 2007-04-13 16:18:09

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,534

Re: Four In A Line Flash Version

Yes, New Match just resets counters, maybe it should also start a New Game.

Anyway, I have now created two new versions:

Three In A Line

Five In A Line

What do you think? I can change number of rows and columns if needed.


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#10 2007-04-13 16:50:48

Zhylliolom
Real Member
Registered: 2005-09-05
Posts: 412

Re: Four In A Line Flash Version

The computer seems to think really hard on five in a line. I was listening to music on my computer and his thinking would make it pause for a second, every time. Maybe it's just my computer.

Offline

#11 2007-04-13 17:28:20

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,534

Re: Four In A Line Flash Version

You are distracting the computer by playing music? Isn't that cheating? big_smile

(The computer has to test a lot more possibilities coz the board is bigger ... it speeds up when the board is nearly full, too!)


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#12 2007-04-13 17:30:35

Zhylliolom
Real Member
Registered: 2005-09-05
Posts: 412

Re: Four In A Line Flash Version

No, this is cheating! mad

connect4cheater.jpg

Look at all those pieces he put in before me!

Offline

#13 2007-04-13 18:28:58

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,534

Re: Four In A Line Flash Version

Oh no ... faint

(So how did you manage that, then? Hmm?)


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#14 2007-04-13 18:39:33

Zhylliolom
Real Member
Registered: 2005-09-05
Posts: 412

Re: Four In A Line Flash Version

Zhylliolom wrote:

This shouldn't be an issue if you play the game normally, but if you click "new game" when a piece is falling sometimes it will freeze in the slot it is in and float in midair. When you try to put a piece in that column the next game your piece will go where that old one is hovering. I've only gotten it to do this a couple times though, it doesn't happen every single time. You can use this bug to give the computer an extra turn at the start, but it doesn't really make the game harder.

I just used this... clicked new game at a special time while the computer's piece was falling.

Offline

#15 2007-04-13 19:42:49

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,534

Re: Four In A Line Flash Version

OK, you got me!


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#16 2007-04-13 20:03:18

justlookingforthemoment
Moderator
Registered: 2005-05-26
Posts: 2,161

Re: Four In A Line Flash Version

Zhylliolom wrote:

The computer seems to think really hard on five in a line.

Zhy, my computer does that too. It takes about six or seven minutes to think. I was also listening to music at the time ... but I've stopped that now and it's still doing it. The cursor even changes to the 'thinking' hourglass sometimes.

Next: three dimensions! wink

Offline

#17 2007-04-13 20:39:57

Zhylliolom
Real Member
Registered: 2005-09-05
Posts: 412

Re: Four In A Line Flash Version

Are you exaggerating on that 6 to 7 minutes? It would pause noticeably for some seconds for me, but definitely not over a minute or even half a minute. That's outrageous.

Offline

#18 2007-04-13 20:42:52

justlookingforthemoment
Moderator
Registered: 2005-05-26
Posts: 2,161

Re: Four In A Line Flash Version

Seconds, I meant seconds!                                                                                     
                                                                                                                             
Oops! big_smile

Offline

#19 2007-04-13 20:47:17

Zhylliolom
Real Member
Registered: 2005-09-05
Posts: 412

Re: Four In A Line Flash Version

Ok good *high five*

(my shortest post ever sad )

Offline

#20 2007-04-13 21:40:25

JaneFairfax
Member
Registered: 2007-02-23
Posts: 6,868

Re: Four In A Line Flash Version

I encountered Zhylliolom’s problem as well after accidentally double-clicking on the New Game button. neutral

And the three-in-a-row game is no game at all, is it? The player that goes first always wins (just like tic-tac-toe)! tongue

PS: Actually, worse than tic-tac-toe. In TTT the person going first never loses, but can still be forced into a draw. In TIAR, the person going first wins – all the time. roll

Last edited by JaneFairfax (2007-04-13 21:43:36)


Q: Who wrote the novels Mrs Dalloway and To the Lighthouse?

A: Click here for answer.

Offline

#21 2007-04-13 23:04:08

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,534

Re: Four In A Line Flash Version

Yes ... I wonder what can be done with it to make it more interesting? Less/more rows/columns?


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#22 2007-04-13 23:34:34

JaneFairfax
Member
Registered: 2007-02-23
Posts: 6,868

Re: Four In A Line Flash Version

Try fewer columns then. Four columns already makes the game absolutely unlosable to the starting player; more columns will make the job of winning even easier for the guaranteed victor. smile


Q: Who wrote the novels Mrs Dalloway and To the Lighthouse?

A: Click here for answer.

Offline

#23 2007-04-13 23:35:15

mathsyperson
Moderator
Registered: 2005-06-22
Posts: 4,900

Re: Four In A Line Flash Version

JaneFairfax wrote:

In TIAR, the person going first wins – all the time. roll

Are you sure? It seems like it should be possible to always force a draw, although maybe that's just because the computer isn't playing well enough.


Why did the vector cross the road?
It wanted to be normal.

Offline

#24 2007-04-14 00:08:03

JaneFairfax
Member
Registered: 2007-02-23
Posts: 6,868

Re: Four In A Line Flash Version

For 4 columns
Drop your 1st coin in columns 2 or 3, say column 2. (Column 3 makes no difference; it would just be looking at the same game from the opposite side of the table.) Your opponent can drop in any of colmns 1, 2, 3, 4. If 2, drop your 2nd coin in column 3 and you’ve won. Anywhere else, drop your 2nd coin on top of your 1st one. Then your opponent is forced to drop their 2nd coin on top of your 2nd coin to block you. Your 3rd drop is invariably in column 3. If your opponent had dropped their 1st coin in columns 1 or 4, they would now have to drop in columns 4 or 1 (respectively) to block you; then drop your 4th coin on top of your 3rd coin, and you’ve won.

This leaves the following the scenario where your opponent had dropped their 1st coin in column 3. Your 3rd coin is on top of that coin. It is in line with your 2nd coin, so your opponent can’t drop their 3rd coin in columns 1 or 4. They have to drop on top of your 3rd coin in column 3. Now drop your 4th coin in column 4. After your opponent drops in the same column to block you, drop your last coin again in that column – and you should have completed a diagonal line of three.

For > 4 columns
Drop your 1st coin at least two spaces clear of each corner. If your opponent drops on top of your coin, or anywhere except adjacent to your coin, drop your 2nd coin next to your 1st coin and you’ve won. Otherwise drop your 2nd coin on top of your 1st coin, forcing your opponent to drop their 2nd coin in the same column to block you. Now drop your 3rd coin next to your 1st coin. After your opponent has dropped next to your 3rd coin to block you, drop your 4th coin on top of your 3rd coin, and you’ve won.

Last edited by JaneFairfax (2007-04-14 00:09:14)


Q: Who wrote the novels Mrs Dalloway and To the Lighthouse?

A: Click here for answer.

Offline

#25 2007-04-14 00:36:30

JaneFairfax
Member
Registered: 2007-02-23
Posts: 6,868

Re: Four In A Line Flash Version

Right, let me illustrate the 4-column case with LaTeX. tongue

Drop your first coin in column 2 (your coin is ●, opponent’s coin is ○):

There follow four cases:

Case 1:

Reply:

And you win.

Case 2:

Reply:

Again you win.

Case 3:

Reply: Follow the same steps as in Case 2. It will lead to the same result.

Last edited by JaneFairfax (2007-04-14 00:59:36)


Q: Who wrote the novels Mrs Dalloway and To the Lighthouse?

A: Click here for answer.

Offline

Board footer

Powered by FluxBB