C++ How do I include these functions into my main function and prototypes. Also how do I set the parameters

Here is my code, it is for the game Farkle. I need help integrating the functions and setting their parameters.
#include <iostream>
#include <string>
#include <fstream>
#include <istream>
#include <cmath>
#include <cstdlib>
using namespace std;
int Pips[6]; //Array for the dice pips shown on the top of dice
bool Used[6]; //Whether the dice had been used by the scoring system or not
// Number of dice being rolls
int rollNumber = 0; //First roll? Second roll?
int number = 0

WriteResults(ostream&outs);
int main()
{
ifstream rolls("dice.txt"); // Input "dice.txt"
string num, pip;
if (!rolls) // Checking to make sure there is a file. If no file, Program breaks.
{
cout << "Unable to open" << endl;
return -1;
}

cout << "hi" << endl;

int number;
rolls >> number;
while (number != 0){//Initial while loop that will stop once the file reads a 0 in the text

for (int i = 0; i < number; i++ ){//This second loop will run the loop that takes the scores and number of pips and turns them into
rolls >> Pips[i];
}
CalculateScore();
WriteResults();






rolls >> number;
}

// Input first line of code which will be the getline fucntion
// It will get the first number which will be a 6. This 6 will be stored in var number
// Get the second line which include the number pips shown. (var number)


return 0;
}


// number: number of dice to score
void CalculateScore(int Pips[] , int Pairs, int points, int ScoringChart) //Function for calculating score from dice roll
{
int points = 0;
int ScoringChart[7][7] =
{
{ 0 , 0 , 0 , 0 , 0 , 0, 0 }, // 0's first line
{ 0 , 100 , 200 , 1000 , 2000 , 4000, 8000 }, //1's scoring row
{ 0 , 0 , 0 , 200 , 400 , 800 , 1600 }, // 2's scoring row
{ 0 , 0 , 0 , 300 , 600 , 1200 , 2400 }, // 3's scoring row
{ 0 , 0 , 0 , 400 , 800 , 1600 , 3200 }, // 4's scoring row
{ 50 , 100 , 500 , 1000 , 2000 , 4000 }, // 5's scoring row
{ 0 , 0 , 0 , 600 , 1200 , 2400 , 4800 }, // 6's scoring row

};
// next part is going to check for a straight
if (Pips[1] == 1 && Pips[2] == 1 && Pips[3] == 1 && Pips[4] == 1 && Pips [5] == 1 && Pips[6] ==1)
{
points = 1000;
}
else
{
for (int k = 1, k < 7, k++)
{
points += ScoringChart[k][Pips[k]];
}
}
return points;
// if it doesnt work have it check the score chart
// for the score
}
void WriteResults(ostream & outs, int number, int count, int Pips[]) // Function that will write the results
{
for (i = 0, i < number, i++)
outs << "Roll " << number << ": ";
for (k = 0, k < count, k++;)
outs << " -" << Pips[i] << "- ";
outs << endl;
}
Topic archived. No new replies allowed.