C program - The game of craps

If the first roll is 2 or 12 the player loses. No create a craps game 3 files main cpp. In general, here's how to call std:: I think you need to explain in much more detail what you're confused about. Sign up using Facebook.

Your Answer

Craps for Beginners

Craps game rules and code Ask Question. RubberDuck 27k 4 54 NinjaDeveloper 1 4 The shooter loses his turn if a 7 is rolled after there is a point. In general, here's how to call std:: This is preferred because It'll help you keep track of it, especially if it'll need to be removed at some point.

If called repeatedly, you'll receive the "same random number" each time. Here, dice1 and dice2 can be initialized in the while -loop: The bool -checking can be shortened: Good points, but two nit picks: The parameters to main have nothing to do with if you're compiling from the command line, but rather how you're running creating it.

Doesn't matter for a basic card game program, but CR brings out my inner pedant: I'll put those in with my current edits. Also, I had no idea about std:: I did happen to come across std:: Would this be a valid solution for here? You would use a std:: A full conviently dice oriented example is here: It appears to work with my old compiler, too. Looks like I can toss out rand from my own stuff. In addition to what Jamal said… The singular for "dice" is "die", so name your variables accordingly.

Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Post Your Answer Discard By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service , privacy policy and cookie policy , and that your continued use of the website is subject to these policies. My problem still remains. How can i do that? There's nothing worse than someone stealing your code for their homework.

Edited 6 Years Ago by WaltP. I am having problems with this program. It assembles but will not run. If you have a counter that gets incremented through multiple functions, is it better to use a global counter or pointer counter? They both work just curious which is better I think you need to explain in much more detail what you're confused about. I can't post code! I solved the exercise, thanks for any help anyway.

This topic has been dead for over six months. Start a new discussion instead. Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules. Code Inline Code Link. Hello, I have a questions in TCP client to server communication: This is what is require me to do:

Craps Tools

Leave a Reply