While I was browsing through the forum threads long ago, i saw a thread about one assignment given toits poster.
Since i am learning myself(1 month left to enter university), I decided to try writing d program . Please, you are free to correct me if I am wrong anywhere...

#include<iostream>
#include<fstream>
#include<string>
#include<ctime>
#include<cstdlib>
#include<vector>
using namespace std;
void wait(int seconds){
clock_t endwait;
endwait=clock()+seconds*CLOCKS_PER_SEC;
while(clock()<endwait){}
}

int main()
{
 int a=0;int b=0;int c=0;
 int accum=0;
 int con=0;
 int thr=0;
 int score=0;
 cout<<"Welcome to the workable version of Delano, a dice game"<<endl;
 cout<<"Checking for savedata.."<<endl;
 wait(3);
 ifstream fin("savedata.tkud");
 if(!fin){
 cout<<"No savedata was found in memory!!"<<endl;
 cout<<"Create savedata ?(1)Yes,(2)No";
 cin>>con;
 if(con!=1){}
 if(con==1){
 ofstream fout("savedata.tkud");
 fout<<score<<endl;
 cout<<"Savedata successfully created!!"<<endl;
 }
 }
 if(fin){
 cout<<"Savedata found!!"<<endl;
 fin>>score;
 cout<<"g "<<score<<endl;
 }
 cout<<"Loading...."<<endl;
 wait(5);
 cout<<"Here are the rules.."<<endl;
 cout<<"The die is from 1 to 5.."<<endl<<"A player throws three dice consecutively.."<<endl;
 cout<<"If,at the end of the game, the player's score is divisible by 5, 1000 pts. are awarded to the player.."<<endl;
 cout<<"500 pts. are awarded if all 3 throws are identical.."<<endl;
 cout<<"If only 2 match, 300 pts. are awarded.."<<endl<<"200 pts. are removed if none match"<<endl<<endl;
 cout<<"Do you wish to continue( (0)Quit,(1)Continue )?";
 cin>>con;
 if(con!=1){
 cout<<"Thank you all the same!!"<<endl;
 return 1;
 }
 cout<<"Good luck!!"<<endl;
 while(con==1){
 //Game begins!!
 cout<<"To roll a die, press any number and then hit enter.."<<endl;
 cin>>thr;
 cout<<"Rolling..."<<endl;
 wait(3);
 srand(time(NULL));
 a=rand()%6;//Between 0 and 5
 cout<<"You threw a "<<a<<"!!"<<endl;
 cout<<"Throw another..";
 cin>>thr;
 cout<<"Rolling.."<<endl;
 wait(3);
 b=rand()%6;
 cout<<"You threw a "<<b<<"!!"<<endl;
 cout<<"Throw another..";
 cin>>thr;
 cout<<"Rolling..";
 wait(3);
 c=rand()%6;
 cout<<"You threw a "<<c<<"!!"<<endl<<endl;
 wait(2);
 cout<<"*****************************PLAYER STATS*************************************"<<endl;
 cout<<"Initial score: "<<score<<endl;
 cout<<"Dice results..."<<endl;
 cout<<"Throw 1: "<<a<<endl<<"Throw 2: "<<b<<endl<<"Throw 3: "<<c<<endl<<endl;
 accum=a+b+c;
 cout<<"A"<<accum<<endl; 
 cout<<"Total: "<<accum<<endl;
 //Time for score processing!!
 if(accum%5==0)
 score=score+1000;
 
 else if(a==b==c)
 score=score+500;
 
 
 else if(a==b|a==c|b==c)
 score=score+300;
 
  
 else if(a!=b&a!=c&b!=c)
 score=score-200;
 cout<<"New score: "<<score<<endl;
 cout<<"*******************************************************************************"<<endl;
 cout<<"Do you want to save yor game progress((1)Yes,(2)No)?";
 cin>>con;
 if(con!=1){}
 if(con==1){
 ofstream fout("savedata.tkud");
 fout<<score<<endl;
 cout<<"Savedata successfully created!!"<<endl;
 }
 cout<<"Do you wish to continue?(1)Yes,(2)No";
 cin>>con;
 if(con!=1){
 cout<<"Thank you all the same!!"<<endl;
 return 1;
 }
 
 }//end of while
 
 cout<<"Thank you for using the workable versoin of Delano, a dice game"<<endl;
 return 0;
}

line #44:

cout<<"The die is from 1 to 5.."<<endl<<"A player throws three dice consecutively.."<<endl;

so you should roll for numbers in range <1,5>, but at line #62 you have:

a=rand()%6;//Between 0 and 5

The same goes for 'b' and 'c' variable.

can you explain,please?

Correct me, if I'm wrong, but you have numbers from 1 to 5 on die, right? On the other hand you roll numbers in range 0-5. That's strange for me.
IMO it should be the same range.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.