Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Connect Four

Contestant Info:

Dr. Keith Hekman

School of Engineering

California Baptist University

 

UserGroup Affiliation:

Orange County LabVIEW User Group

Location:

 

Winsoft Corporation
  Alton Deere Plaza
  1932 E. Deere Plaza, Suite 110
  Santa Ana, CA 92705

 

Contact:

 

Peter Lamb
  peter.lamb@ni.com
  949.230.3326

 

Meeting Details:

 

Monthly meetings, last Thursday of   every month from 6:30-8:00  pm

 

User Group Website:

 

n/a

 

Summary:

This VI simulates the classicvertical checkers game connect four Build a row offour checkers in any direction while blocking your opponent to win.

Function:

The programming uses statemachine architecture.  It also demonstrateshow to use different array functions.

Steps to execute code:

  1. Open Project
  2. Run connectfour.vi
  3. Press arrows to choose column drop piece. Choose     between computer and person for each color..

  Screenshots:

Main Front Panel:


Main Block Diagram:

block diagram.jpg

VI Snippet:

_visnip.png'

VIattached below

Download All
Comments
G-Money
NI Employee (retired)
on

Nice! We have seen other Connect Four games in LabVIEW with AI but this is a cleaner rendition. If you would, please change the image of your drop position.vi to a VI Snipper (Highlight code that you want on the block diagram and then go to Edit>>Create VI Snippet from selection). Users can drop the VI Snippets directly into a clean block diagram and LabVIEW will automatically add the code and they can edit it right away. Pretty cool feature so you don't have to look at an image and try to recreate the code yourself. Great code again!!

hekdude
Member
Member
on

Any VI snipped I create is larger than 500KB, so I cannot insert it into the document.

Some of my students found other connect four programs, but they couldn't follow them, so I wrote this one.

Snamprogetti
Active Participant
Active Participant
on

Hello, my version of Connect 4 (http://decibel.ni.com/content/docs/DOC-4541) has a simple plugin system to let different AIs compete with each other. How about setting up a "challenge" of your AI and mine?

hekdude
Member
Member
on

Snamprogetti

your game was the starting point for my game .   It was hard for me to follow the code (I think it was in italian), so I wrote my own.

It is finals week here at CBU.  If you remind me later this summer, I would like to try it out.

Keith

Snamprogetti
Active Participant
Active Participant
on

Sure. All we need is a wrapper VI for your AI, there is an example in english in my package

Snamprogetti
Active Participant
Active Participant
on

Hello again, I've successfully edited your code and isolated the AI

part, with "Look Ahead" set to maximum (smarter but slower). Now your

AI is available as a downloadable opponent on http://decibel.ni.com/content/docs/DOC-4541
I let it compete with my AI thousands of times and rates of victory are

approximately:
- 82% Snamprogetti
- 15% Hekdude
- 3% draw
muhuhahaha...