Call of Duty 4 Forums
Home UserCP Members Register Calendar FAQ Downloads Clans


Go Back   Call of Duty 4 Forums > Offtopic Forums > Software & Programming
Register FAQ Members List Calendar Downloads Search Today's Posts Mark Forums Read


Welcome to the Call of Duty 4 Forums! Please REGISTER!
Hey there!

It looks like you're enjoying Call of Duty 4 Forums but haven't created an account yet. Why not take a minute to register for your own free account now? As a member you get free access to all of our forums and posts plus the ability to post your own messages, communicate directly with other members and much more. You also have the chance to win great prizes just for posting! Register now!

Already a member? Login at the top of this page to stop seeing this message.

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 02-29-2008, 01:46 PM
Agent of Creed's Avatar
Private Private First Class II
 
Join Date: Feb 2008
Location: Florida
     PSN: Agent_of_Creed
Posts: 23
Agent of Creed is on a distinguished road
Send a message via MSN to Agent of Creed
Default Coding in Visual Basic

Alright, I'm doing a project where I have to make a Rock, Paper, Scissors game with Visual Basic Express 2008. Now I have my perfect interface down, I plan on having the player check what move they want, between Rock, Paper, or Scissors in checkboxs. Then where ever their choice is, their choice will be visible in a image control. I was just wondering how I would write that code, you don't have to give me the exact. Just a demo or any tutorials that you recommend me to read. Please take the consideration of not flaming, or trolling. Help if you can and if you can't help. That is okay.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post! Submit to N4G
Reply With Quote
Payin' The Bills (Register to get rid of this advertisement!)
  #2  
Old 02-29-2008, 04:44 PM
MnMs's Avatar
VIP
Prestige 1 Prestige 1
 
Join Date: Aug 2007
Clan Tag: [c4b]
Posts: 765
MnMs is an unknown quantity at this point
Default

I wouldn't the computer always win? (If the computer calculated it after recieving your "answer")

I've never messed around with VB so I can't write you the code but you could assign the rock paper and scissors a number (1,2,3).. then you would use VB's random number generation to select a random number from 1 to 3 which would select the computer's "weapon." Then you would need a set of conditionals that declare when each weapon would win. This is for random generation much like if you were to be playing with a real human.

You've probably already figured this out though
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post! Submit to N4G
Reply With Quote
  #3  
Old 03-01-2008, 11:28 PM
Agent of Creed's Avatar
Private Private First Class II
 
Join Date: Feb 2008
Location: Florida
     PSN: Agent_of_Creed
Posts: 23
Agent of Creed is on a distinguished road
Send a message via MSN to Agent of Creed
Default

Yes I sort of figured it out, I was thinking of not randomizing the computers choice. I was going to write the computer choice in "If" statements. Try to make the game more challenging like, if the player choses rock. The computer will choose rock. If the player choses scissors, the computer will chose rock. The only way the player would win is if he/she choses paper, then the computer choses rock. Know any good tutorials by the way? Visual basic is pretty confusing sometimes. I'd rather become a web designer....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post! Submit to N4G
Reply With Quote
  #4  
Old 03-02-2008, 12:43 PM
MnMs's Avatar
VIP
Prestige 1 Prestige 1
 
Join Date: Aug 2007
Clan Tag: [c4b]
Posts: 765
MnMs is an unknown quantity at this point
Default

Then it wouldn't really be rock paper scissors though. If the other person always knew what you were going to choose it would be boring. In a real game it's pretty much random. It would probably be easier to do random choices too
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post! Submit to N4G
Reply With Quote
  #5  
Old 03-04-2008, 01:57 PM
diablodominator's Avatar
Corporal Corporal II
 
Join Date: Mar 2008
Location: the red light district, amsterdam
     xfire: jigler
     XBL: blazikcan
Posts: 97
diablodominator is on a distinguished road
Default

work with urm i dont know what its called but u put in a certain code and then the computer just does what it wants i might come back on this subject its like the game with multiplayer map who keeps renewing without updating or something it just does it so u never ever ever get the same map u could use it with the program ur using but i need to find out more about it give me some time lol.xD
__________________
--Were Winning This Battle, Keep Up The Fire--
--enjuo prodimé carou tre menitó--
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post! Submit to N4G
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On






All times are GMT -6. The time now is 02:00 PM.

COD4boards.com is an Privacy Policy and Legal
Style designed by: vBSkinworks SEO by vBSEO 3.1.0 Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.