Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:f62cfa3a0fae1db586138e5c213033d8a534bbc9908612c33d0dfc99bd4972fc
User & Date: sarah 2018-05-18 22:01:57
Context
2018-05-18
22:21
cookie stuff check-in: 2c0c33b7ee user: zie tags: trunk
22:01
Update check-in: f62cfa3a0f user: sarah tags: trunk
19:42
for loop correct check-in: e7db9f3a92 user: sarah tags: trunk
Changes

Changes to finalproject/makefile.

1
2
3
4
5
6
7
8
run: finalproject
	./finalproject
finalproject: finalproject.cpp
	g++ -Werror $< -o $@
clean:
	rm finalproject.out
	rm finalproject
	rm pause


|





1
2
3
4
5
6
7
8
run: finalproject
	./finalproject
finalproject: cookie.cpp
	g++ -Werror $< -o $@
clean:
	rm finalproject.out
	rm finalproject
	rm pause

Changes to project6/project6.cpp.

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
..
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{
  system("/bin/stty raw");
  std::cout << "Press any key to continue...";
  getchar();
  system("/bin/stty cooked");
}


/********************************************************************************
  *  Class Name: Die, contains functions get, and roll
  *  Parameters: None
  *  Return Value: int
  *  Purpose: To calculate everything dealing with the dice, not including total. I.e. what was rolled.
  *******************************************************************************/

................................................................................
  //the rest is public
public:
  int get(void) //this is to retreave the number on the die
  {
    return DiceRoll;
  }

/********************************************************************************
  *   Function Name: one, two, three, four, five, six
  *  Parameters: None
  *  Return Value: int
  *  Purpose: These are functions containing cout statements so the player can see the dice
  *******************************************************************************/

void one() // This is to show roll one
{
  cout << "\n- - - - \n" // The '\n' is to show the dice on a new line
       << "|      |\n"
       << "|   0  |\n"
       << "|      |\n"
       << "- - - -\n";
}
void two() // This shows what a two will look like
{
  cout << "\n- - - - \n" // The '\n' is to show the dice on a new line
       << "|    O |\n"
       << "|      |\n"
       << "| O    |\n"
       << "- - - -\n";
}
void three() //If the player rolls a three
{
  cout << "\n- - - - \n" // The '\n' is to show the dice on a new line
       << "|    O |\n"
       << "|  O   |\n"
       << "| O    |\n"
       << "- - - -\n";
}
void four() //If the player rolls a four
{
  cout << "\n- - - - \n" // The '\n' is to show the dice on a new line
       << "| O  O |\n"
       << "|      |\n"
       << "| O  O |\n"
       << "- - - -\n";
}
void five() //If the player rolls a five
{
  cout << "\n- - - - \n" // The '\n' is to show the dice on a new line
       << "| O  O |\n"
       << "|   O  |\n"
       << "| O  O |\n"
       << "- - - -\n";
}
void six() //If the player rolls a six
{
  cout << "\n- - - - \n" // The '\n' is to show the dice on a new line
       << "| O  O |\n"
       << "| O  O |\n"
       << "| O  O |\n"
       << "- - - -\n";
}

  void roll() // calculates the roll. Randomly generated
  {
    DiceRoll = 1 + rand() % 6;

    switch (DiceRoll) //Switch statement using the DiceRoll outcome
    {







<







 







|






|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







21
22
23
24
25
26
27

28
29
30
31
32
33
34
..
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
  system("/bin/stty raw");
  std::cout << "Press any key to continue...";
  getchar();
  system("/bin/stty cooked");
}


/********************************************************************************
  *  Class Name: Die, contains functions get, and roll
  *  Parameters: None
  *  Return Value: int
  *  Purpose: To calculate everything dealing with the dice, not including total. I.e. what was rolled.
  *******************************************************************************/

................................................................................
  //the rest is public
public:
  int get(void) //this is to retreave the number on the die
  {
    return DiceRoll;
  }

  /********************************************************************************
  *   Function Name: one, two, three, four, five, six
  *  Parameters: None
  *  Return Value: int
  *  Purpose: These are functions containing cout statements so the player can see the dice
  *******************************************************************************/

  void one() // This is to show roll one
  {
    cout << "\n- - - - \n" // The '\n' is to show the dice on a new line
         << "|      |\n"
         << "|   0  |\n"
         << "|      |\n"
         << "- - - -\n";
  }
  void two() // This shows what a two will look like
  {
    cout << "\n- - - - \n" // The '\n' is to show the dice on a new line
         << "|    O |\n"
         << "|      |\n"
         << "| O    |\n"
         << "- - - -\n";
  }
  void three() //If the player rolls a three
  {
    cout << "\n- - - - \n" // The '\n' is to show the dice on a new line
         << "|    O |\n"
         << "|  O   |\n"
         << "| O    |\n"
         << "- - - -\n";
  }
  void four() //If the player rolls a four
  {
    cout << "\n- - - - \n" // The '\n' is to show the dice on a new line
         << "| O  O |\n"
         << "|      |\n"
         << "| O  O |\n"
         << "- - - -\n";
  }
  void five() //If the player rolls a five
  {
    cout << "\n- - - - \n" // The '\n' is to show the dice on a new line
         << "| O  O |\n"
         << "|   O  |\n"
         << "| O  O |\n"
         << "- - - -\n";
  }
  void six() //If the player rolls a six
  {
    cout << "\n- - - - \n" // The '\n' is to show the dice on a new line
         << "| O  O |\n"
         << "| O  O |\n"
         << "| O  O |\n"
         << "- - - -\n";
  }

  void roll() // calculates the roll. Randomly generated
  {
    DiceRoll = 1 + rand() % 6;

    switch (DiceRoll) //Switch statement using the DiceRoll outcome
    {