| View previous topic :: View next topic |
| Author |
Message |
spydude3d Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 972 Location: Canada
|
Posted: Sat Jun 09, 2007 5:22 pm Post subject: Help With A VB 6.0 program |
|
|
I wrote this game in Visual Basic 6.0. If anyone who knows VB 6.0 would like to help me debug the program, I would appreciate it greatly. The game is Mastermind, made after the actual game mastermind with the different colored pegs. I wrote the code and then tested it for many different faults, it has but one.
When you start the game, the computer randomly chooses one out of 9 colors for each of 10 pegs. It is up to the user to guess which colors belong in which peg. The game must allow the computer to have multiple pegs of the same color and the user must also be allowed to guess multiple pegs of the same color.
In any circumstance when the computer generates all 10 pegs with a different color, there are no bugs, the game works flawlessly. But, in any circumstance when the computer generates at least 2 or more of the same color, a logic error occurs. That is to say, the program counts the number of guesses you make that are right, and displays them on the form. And then the program counts the number of colors that are right, but in the wrong place.
For example, if there are two pegs, and each peg can be one of two colors, red or blue, and the computer chooses the pegs to be red and blue.
If you guess red/blue:
Correct guesses = 2
Correct colors = 2
If you guess red/red or blue/blue:
Correct guesses = 1
Correct colors = 1
If you guess blue/red:
Correct guesses = 0
Correct colors = 2
Now, in the case that the computer chooses the combination to be red/red
If you guess red/red:
Correct guesses = 2
Correct colors = 3
If you guess red/blue:
Correct guesses = 1
Correct colors = 2
If you guess blue/red:
Correct guesses = 1
Correct colors = 2
If you guess blue/blue:
Correct guesses = 0
Correct colors = 0
I have attached the program: Mastermind.frm And Mastermind.vbp And settings.frm in a .rar file.
Thank you ahead of time for anyone who can help me.
_________________
Ebcideceous Holleritheous
Grammar Guards-Watch your language! PM hawkfire234 to join.
Blarg I need an idea for a new siggy.
Last edited by spydude3d on Sat Jun 09, 2007 11:42 pm; edited 1 time in total |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sat Jun 09, 2007 5:26 pm Post subject: Re: Help Debugging A program |
|
|
| spydude3d wrote: | | I wrote this game in Visual Basic 6.0. |
|
|
| Back to top |
|
 |
spydude3d Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 972 Location: Canada
|
Posted: Sat Jun 09, 2007 5:36 pm Post subject: Re: Help Debugging A program |
|
|
| appalsap wrote: | | spydude3d wrote: | | I wrote this game in Visual Basic 6.0. |
 |
Lol, I know, I've read all over the forum about how shitty ass visual basic is, but I'm taking computer sciences in school because I need the courses in order to take computer sciences in university. And the only language they teach us in computer science in high school is visual basic 6.0 in grade 11 and visual basic .net in grade 12.
_________________
Ebcideceous Holleritheous
Grammar Guards-Watch your language! PM hawkfire234 to join.
Blarg I need an idea for a new siggy. |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sat Jun 09, 2007 6:06 pm Post subject: |
|
|
burn your school down to the ground
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Sat Jun 09, 2007 6:08 pm Post subject: |
|
|
i love your logic.
_________________
|
|
| Back to top |
|
 |
spydude3d Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 972 Location: Canada
|
Posted: Sat Jun 09, 2007 6:09 pm Post subject: |
|
|
Blarg...
_________________
Ebcideceous Holleritheous
Grammar Guards-Watch your language! PM hawkfire234 to join.
Blarg I need an idea for a new siggy. |
|
| Back to top |
|
 |
|