Thread: Yahtzee C++

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    1

    Yahtzee C++

    I realize there has been topics on this regarding the creation of a working Yahtzee game before. I just need a little bit of constructive criticism regarding the code I've already written. I know some of it is incomplete still, and I'm not asking for you to do it for me, I just need you to tell me if I'm heading in the right direction. A few things that are stumping me right now and I could use a few pointers to figure out is how to format my die to make them horizontal rather than vertical. How to hold the value of a specific die rolled, but only being able to do that 3 times in one round. And finally, how to make my array go through 13 rounds of the game, in order to fill the final score card. I know that last one has to do with the 2-d array I created, my game allows up to four people to play. So I have an array that is holding the players in ROWS and the 13 required games in COLUMNS.
    Last edited by egochan90; 11-23-2010 at 05:12 PM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Every line of void Die::score_holder() is an array overrun error.

    > scoreplay_array[0][0+1+2+3+4+5+6+7+8+9+10+11+12+13]
    What this specifically does NOT do is output all 14 elements of the array.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Quote Originally Posted by Salem View Post
    Every line of void Die::score_holder() is an array overrun error.

    > scoreplay_array[0][0+1+2+3+4+5+6+7+8+9+10+11+12+13]
    What this specifically does NOT do is output all 14 elements of the array.
    And there are 29 other lines in the rest of the program with buffer overruns.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with Yahtzee Program
    By infuser21 in forum C++ Programming
    Replies: 4
    Last Post: 03-19-2009, 02:14 PM
  2. Yahtzee C++ programme help
    By kenneth_888 in forum C++ Programming
    Replies: 13
    Last Post: 09-05-2007, 02:14 PM
  3. input question
    By piyush_v in forum C Programming
    Replies: 9
    Last Post: 04-12-2007, 07:09 AM
  4. Yahtzee
    By CheesyMoo in forum Game Programming
    Replies: 3
    Last Post: 01-31-2003, 04:53 PM
  5. yahtzee
    By Unregistered in forum C++ Programming
    Replies: 6
    Last Post: 03-10-2002, 07:26 PM