Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 30th, 2004, 11:43 PM   #1
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,667
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
ok here is the code i have so far
#include <iostream>
#include <string>
#include "DiceGameDice.h"
#include "Dice.h"

using namespace DiceNameSpace;
using namespace std;

DiceGameDice::DiceGameDice() : public Dice(6)
{
    total = 0;
}

int DiceGameDice::GetDiceValue(Die aDie)
{
    return aDie.Value();

int DiceGameDice::Total(Dice theDice)
{
    int dcount = DieCount();
    for(int i = 0; i < dcount; i++)
        total = total + GetDiceValue(*theDice.Select(i));
    return total;
}

and this is the error i am recieving

DiceGameDice.cpp:18: error: syntax error before `::' token
DiceGameDice.cpp:23: error: syntax error before `::' token
DiceGameDice.cpp:27: error: syntax error before `::' token
DiceGameDice.cpp:30: error: `dcount' was not declared in this scope
DiceGameDice.cpp:30: error: parse error before `;' token
DiceGameDice.cpp:30: error: syntax error before `++' token
make: *** [DiceGameDice.o] Error 1

any help would be great. perferably tonight
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old Sep 30th, 2004, 11:48 PM   #2
Ashcroft
Programmer
 
Join Date: Sep 2004
Posts: 38
Rep Power: 0 Ashcroft is on a distinguished road
DiceGameDice::GetDiceValue is missing a closing '}'

Once you have an error invloving missing a scope closing you will get a huge number of meaningless errors - only that first one really points you at where the problem is.
Ashcroft is offline   Reply With Quote
Old Sep 30th, 2004, 11:54 PM   #3
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
Yup. Just that one closing brace is probably giving you all that.
__________________
&quot;Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children.&quot; - Dwight D. Eisenhower
Mjordan2nd is offline   Reply With Quote
Old Sep 30th, 2004, 11:56 PM   #4
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,667
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
ok i added that and got the same error and then noticed i was missing a namespace
but here is my new error

DiceGameDice.cpp: In constructor `
  DiceGameDiceNameSpace::DiceGameDice::DiceGameDice()':
DiceGameDice.cpp:19: error: parse error before `public'
DiceGameDice.cpp: At global scope:
DiceGameDice.cpp:30: error: no `int
  DiceGameDiceNameSpace::DiceGameDice::Total(DiceNameSpace::Dice)' member
  function declared in class `DiceGameDiceNameSpace::DiceGameDice'
make: *** [DiceGameDice.o] Error 1
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old Oct 1st, 2004, 12:03 AM   #5
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,667
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
fixed everything
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old Oct 1st, 2004, 12:34 AM   #6
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
i always miss all of the fun
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Oct 1st, 2004, 12:40 AM   #7
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,667
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
if your still around and will be for alittle while i mite have some more stuff i need help with. like what would be the way to make the system pause and state. "press any key to continue" in linux using c++
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old Oct 1st, 2004, 12:51 AM   #8
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
#include <stdlib.h>

system("PAUSE");
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Oct 1st, 2004, 12:55 AM   #9
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,667
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
o and im having problems with my random number generator. both the user and the computer then the same dice on every roll no matter what. im thinking that some how its not actually re-rolling the dice. if you want i could post the code but not exactly sure what code i should post as i have 12 files of code lol
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old Oct 1st, 2004, 1:11 AM   #10
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
seed the random number generator with the time, and reseed it prior to each roll for both player and computer.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:37 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC