Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-30-2004, 05:52 PM   PM User | #1
glammagod
New Coder

 
Join Date: Mar 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
glammagod is an unknown quantity at this point
VB help! making connect 4 game

I have to make a 2 player game of connect 4 using visual basic!
I have created the gui, and written the code to enter player names!
I keep confusing myself on how to get it to work
use a counter to count who's turn it is?? confused! can anyone help??
__________________
WEB IDIOT sorry!
glammagod is offline   Reply With Quote
Old 04-30-2004, 06:38 PM   PM User | #2
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,233
Thanks: 4
Thanked 81 Times in 80 Posts
Spookster will become famous soon enough
This is a homework assignment isn't it? I had to write a program in college to simulate the connect 4 game. It was in java though.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 04-30-2004, 07:09 PM   PM User | #3
glammagod
New Coder

 
Join Date: Mar 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
glammagod is an unknown quantity at this point
just part of a module! can you help?
__________________
WEB IDIOT sorry!
glammagod is offline   Reply With Quote
Old 04-30-2004, 08:21 PM   PM User | #4
sad69
Senior Coder

 
Join Date: Feb 2004
Posts: 1,206
Thanks: 0
Thanked 0 Times in 0 Posts
sad69 is an unknown quantity at this point
So how do you want us to help exactly? You could use a counter to keep track of whose turn it is using modulus. If there are 2 players, counter mod 2 will result in 0 if it's player 1 or 1 if it's player 2.

Is that all?

Check out planet-source-code, I wouldn't be surprised if this project is available for download. (Why re-invent the wheel? Unless this is a school project of course..)

Hope that helps,
Sadiq.
sad69 is offline   Reply With Quote
Old 05-01-2004, 07:47 AM   PM User | #5
shmoove
Regular Coder

 
Join Date: Dec 2003
Posts: 367
Thanks: 0
Thanked 0 Times in 0 Posts
shmoove is an unknown quantity at this point
A Boolean is better for a token in a two player game:

Code:
Dim Turn1P as Boolean

Sub SwitchTurns()
  Turn1P = Not Turn1P
  ' now add extra code to handle turn switching according to Turn1P
End Sub
shmoove
shmoove is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:06 AM.


Advertisement
Log in to turn off these ads.