Liberty BASIC Community Forum
« Pure coding challenge - Connect 4 AI »

Welcome Guest. Please Login or Register.
Oct 23rd, 2017, 5:33pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1 2 3  Notify Send Topic Print
 veryhotthread  Author  Topic: Pure coding challenge - Connect 4 AI  (Read 2254 times)
Janet
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 4111
xx Re: Pure coding challenge - Connect 4 AI
« Reply #15 on: May 30th, 2004, 11:50am »

Quote:
Is your program with correct variable naming on its way, Janet? Give me a shout if you want the old one deleted.

I'm inbetween family gatherings right now. My ac adaptor to my laptop has quit making a connection, so I've been unable to do much away from home this weekend. You can delete the other post, though, if you like. I should have something by midweek.
Janet
User IP Logged

Windows 7 Professional, SP1, 64 bit Intel Core i5-4200U CPU @ 1.60 GHz 2.30 GHz 6.00 GB

"I am very busy finding out what people mean by what they say." -
Janet
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 4111
xx Re: Pure coding challenge - Connect 4 AI
« Reply #16 on: May 31st, 2004, 12:52am »

I've now posted code that works in the framework, but doesn't work as well in the framework as it does in the original program. Perhaps I've missed a variable. undecided
Janet
User IP Logged

Windows 7 Professional, SP1, 64 bit Intel Core i5-4200U CPU @ 1.60 GHz 2.30 GHz 6.00 GB

"I am very busy finding out what people mean by what they say." -
Callum
Junior Member
ImageImage


member is offline

Avatar

Where there's a what there's Callum's Code.


Homepage PM

Gender: Male
Posts: 93
xx Re: Pure coding challenge - Connect 4 AI
« Reply #17 on: May 31st, 2004, 04:08am »

Quote:
I am interested that you seem to give higher priority to blocking the other player than winning yourself. Is there a reason for this, because you know that once you have won, the other player has lost anyway


Good point. My strategy has always been to block and hope I win, so my AI function reflects that. I have written a new version that plays a less defensive game, I'd upload it but I'm not sure if I'm allowed as I've already uploaded my other AI funtion.
User IP Logged

Callum
theblazingicicle
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 410
xx Re: Pure coding challenge - Connect 4 AI
« Reply #18 on: May 31st, 2004, 05:02am »

Janet, I love your program's gui. It's really well polished. smiley

Would it work to put someone else's function in your program for when i judge them, because its so much prettier.

Callum, you're welcome to post an amended entry, just tell me if you want the old one deleted.
User IP Logged

Inaliable rights:
Life, liberty and the pursuit of BASIC
Janet
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 4111
xx Re: Pure coding challenge - Connect 4 AI
« Reply #19 on: May 31st, 2004, 09:24am »

Quote:
Would it work to put someone else's function in your program for when i judge them, because its so much prettier.

Well, it would certainly work for me as, for some reason, my function doesn't follow through well in the original framework. wink Sure, I'd be pleased. Just be sure to test the entrant's AI in your framework first to catch any possible glitches.
Janet
User IP Logged

Windows 7 Professional, SP1, 64 bit Intel Core i5-4200U CPU @ 1.60 GHz 2.30 GHz 6.00 GB

"I am very busy finding out what people mean by what they say." -
kaboomer13
Senior Member
ImageImageImageImage


member is offline

Avatar

There are 10 types of people in this world: Those who know Binary and those who don't!


Homepage PM

Gender: Male
Posts: 404
xx Re: Pure coding challenge - Connect 4 AI
« Reply #20 on: May 31st, 2004, 09:30am »

Janet, I copied your entire proram code into my LB and ran it I think that you might want to know that the computer's first move was in position -1, that is too far left to make it on to your board.

Thought you might want to know that...

Ben Scott
User IP Logged

LBfully Yours,
Ben J Scott
Don't forget to check out DLL4LB!
Janet
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 4111
xx Re: Pure coding challenge - Connect 4 AI
« Reply #21 on: May 31st, 2004, 10:31am »

Ben,
I thought I had fixed that. It never happened until I changed the variables. There is obviously some incompatibility with the new variables, else why would it block with the old variables but fail to block with the new (and place in column 0 when that shouldn't be a choice). Thanks, Ben. I'll scrutinize the printout and see if I can figure it out. So far, it's taken me almost as much time to try to work in the same variables as it did to write the original program and I'm not sure how much more time I can devote to this. I think one of the problems is, I can't figure out how the willWin function is supposed to fit in. I think my GetNextMoveAi function accounts for a willWin for the human and a willWin for the computer so that function confuses me. (It's always hard to get two people to agree on one logical algorithm.) I just ignored the willWin function, but maybe I need to look at that more closely to see if that's where the glitch is. Thanks for the feedback, Ben.
Janet
User IP Logged

Windows 7 Professional, SP1, 64 bit Intel Core i5-4200U CPU @ 1.60 GHz 2.30 GHz 6.00 GB

"I am very busy finding out what people mean by what they say." -
theblazingicicle
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 410
xx Re: Pure coding challenge - Connect 4 AI
« Reply #22 on: May 31st, 2004, 10:46am »

If you don't need the willwin function, you dont have to write one. I wrote one when I originally did the connect four challenge, and I was really surprised that I managed to get it to work first time. I use it in the framework to test for a win and will use it in my AI (when i get round to writing it), but if you dont need to, I will just stick mine in when I try out your entries.

I just thought it would be giving the game ( grin ) away to provide the willwin function.
User IP Logged

Inaliable rights:
Life, liberty and the pursuit of BASIC
Janet
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 4111
xx Re: Pure coding challenge - Connect 4 AI
« Reply #23 on: May 31st, 2004, 8:03pm »

If patience is a virtue, then you've all been plenty viruous with me! My final entry is in. The problem was row 7 in the framework being filled with -1's and I had used 3's. As for the computer choosing column 0 (rather than 1-7), I set up loop to run 500 times and column 0 was never chosen. I suspect that the glitch is based upon more than one condition being met and Ben found that unique series. I'll just have to live with it and hope the unique conditions don't present themselves during the challenge! embarassed
Janet
User IP Logged

Windows 7 Professional, SP1, 64 bit Intel Core i5-4200U CPU @ 1.60 GHz 2.30 GHz 6.00 GB

"I am very busy finding out what people mean by what they say." -
Callum
Junior Member
ImageImage


member is offline

Avatar

Where there's a what there's Callum's Code.


Homepage PM

Gender: Male
Posts: 93
xx Re: Pure coding challenge - Connect 4 AI
« Reply #24 on: Jun 1st, 2004, 05:39am »

I've posted my new AI function. Please remove my old one. Thanks.
User IP Logged

Callum
theblazingicicle
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 410
xx Re: Pure coding challenge - Connect 4 AI
« Reply #25 on: Jun 6th, 2004, 11:34am »

I have found time to do an AI myself today. It is a logical predictable one with no randomness, but quite advanced logic. It is posted.

I set it against both your functions.

Janet, unfortunately, your function appears to work sometimes, but it always seems to want to drop a counter in column 0 at some point, so it was impossible to tell which one would win.

Callum, your AI is stable. When my AI started the game, they were very evenly matched. There were roughly equal numbers of wins for each side. Mine won in situations that required a little extra logic, while yours won in inspired artistic "wherever you go i win" moves. Maybe the random generator in LB is actually a connect 4 genius.

Both functions beat any human players hands down, so we can't really complain! grin
« Last Edit: Jun 6th, 2004, 11:39am by theblazingicicle » User IP Logged

Inaliable rights:
Life, liberty and the pursuit of BASIC
Ken Lewis, Sr.
Team Liberty BASIC


member is offline

Avatar

can't = _never_tried


Homepage PM

Gender: Male
Posts: 282
xx Re: Pure coding challenge - Connect 4 AI
« Reply #26 on: Jun 9th, 2004, 11:05am »

When will this contest end? I have had very little time to work on this. But would like to enter. It may take me awhile.

Ken
User IP Logged

what I do for a living
http://www.oldsouthforge.com/

My LB site
http://libertyforge.oldsouthforge.com/
Stefan Pendl
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Computers are like babies, you must teach them what you like them to do ...


Homepage PM

Gender: Male
Posts: 5297
thumbup Re: Pure coding challenge - Connect 4 AI
« Reply #27 on: Jun 9th, 2004, 4:27pm »

on May 20th, 2004, 04:47am, theblazingicicle wrote:
Post entries (just the GetNextMoveAi function) at http://www.eccentrix.com/members/arro/wwwboard/55.html .

The closing date will be around 17th June.

Reply #0 has all info you need shocked
User IP Logged

Stefan

Make sure to read and follow the Forum Guidelines

Liberty BASIC Pro 4.04, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
theblazingicicle
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 410
xx Re: Pure coding challenge - Connect 4 AI
« Reply #28 on: Jun 10th, 2004, 07:57am »

Yes, carry on. If I know there is another program inthe pipeline, I will postpone the ending.
User IP Logged

Inaliable rights:
Life, liberty and the pursuit of BASIC
theblazingicicle
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 410
xx Re: Pure coding challenge - Connect 4 AI
« Reply #29 on: Jun 18th, 2004, 1:44pm »

Is anyone still working on a program? The original deadline has passed, so I will end the challenge unless anyone speaks up in the next few days.
User IP Logged

Inaliable rights:
Life, liberty and the pursuit of BASIC
Pages: 1 2 3  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls