NEED HELP! =(

Pages: 12
When ever i try to run it, it is saying no such file in directory.


this is my new code. and once again, it will not print out the slot machine

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#include <stdio.h>
#include <time.h>
#include <math.h>

//DECLARATIONS
void GetStartAmount (int* StartA);
void GetBet (int* bet, int StartA);
void Calculations(int* WinAm, int* NewAm,int StartA, int bet, int s1, int s2, int s3);
void randSlotNum(int* s1, int* s2, int* s3);
void PrintSlot ( int s1, int s2, int s3);


int main (void)
{
    //VARIABLES
    int StartA;
    int bet;
    int NewAm;
    int s1;
    int s2;
    int s3;
    int WinAm;


        printf("COP 2220 Project 3 - absslsdlasla\n\n");
        printf("Let's play Crazy Eights!\n\n");


    GetStartAmount (&StartA);
    GetBet (&bet, StartA);
    randSlotNum(&s1, &s2, &s3);
    PrintSlot (s1, s2, s3);
    Calculations(&WinAm, &NewAm, StartA, bet, s1, s2, s3);
    return;
}





void GetStartAmount (int* StartA)
    {
         printf("How many dollars do you want to start with (0 to quit)? ");
         scanf("%d", StartA);
         do{
            if(* StartA == 0)
            {
                printf("What's the matter? You scared punk?\n\n");
                exit (1);
            }
            if(*StartA < 1)
            {
                printf("ERROR: Enter at least one dollar or zero to cash out.\n\n");
                exit(2);
            }
         }while(*StartA <= 1);
        return;
    }






void GetBet (int* bet, int StartA)
    {
        do{
            printf("How many dollars do you want to bet (enter 0 to cash out)? ");
            scanf("%d", &bet);
            if(*bet == 0)
            {
                printf("You're no fun.\n\n");
                exit(3);
            }
            if(*bet > StartA)
            {
                printf("Sorry, you don't have that much left.\n\n");
            }
        }while(*bet >= StartA);
        return;
    }







void randSlotNum(int* s1, int* s2, int* s3)
    {
        srand(time(NULL));
        *s1 = rand()%8+1;
        *s2 = rand()%8+1;
        *s3 = rand()%8+1;
        return;
    }





void Calculations(int* WinAm, int* NewAm,int StartA, int bet, int s1, int s2, int s3)
    {
          if(s1 == 8 && s2 == 8 && s3 == 8)
          {
              *WinAm = bet * 80;
          }

        else if(s1 == s2 && s2 == s3)
        {
            *WinAm = bet * 25;

        }

        else if(s1 == s2 || s2 == s3 || s1 == s3)
        {
            *WinAm = bet * 2;
        }

        else if(s1 == 8 || s2 == 8 || s3 == 8)
        {
            WinAm = bet * 1;
        }

        else
        {
            WinAm = 0;
        }



    *NewAm = StartA - (*WinAm + bet);

    if( s1==s2==s3==8)
    {
        printf("JACKPOT! cha-ching, you win $%d\n\n", *WinAm);
    }
    else if(s1 == s2 && s2 == s3)
    {
        printf("Match 3! You win $%d\n\n", *WinAm);
    }
    else if(s1 == s2 || s2 == s3 || s1 == s3)
    {
        printf("Match 2! You win $%d\n\n", *WinAm);
    }
    else if(s1==8 || s2==8 || s3==8)
    {
        printf("Crazy Eight! You win $%d\n\n", *WinAm);
    }
    else
    {
        printf("Sorry, no winning combination.\n\n");
    }

    printf("Your current amount is $%d\n\n", *NewAm);
        if(NewAm < 1)
            printf("Thank you for playing, better luck next time.\n\n");
        return;
    }








    void PrintSlot ( int s1, int s2, int s3)
    {
            printf("       _____      \n");
            printf("_____/ 888 \\_____\n");
            printf("/  Crazy Eights   \\ \n");
            printf("|=================|  __\n");
            printf("| 888     80x Bet | (  )\n");
            printf("| Match 3 25x Bet |  ||\n");
            printf("| Match 2  2x Bet |  ||\n");
            printf("| Eight    1x Bet |  ||\n");
            printf("|-----+-----+-----|  ||\n");
            printf("| %d  | %d  | %d  |  ||\n", s1, s2, s3);
            printf("|-----+-----+-----|  ||\n");
            if(s1==s2==s3==8 || s1==s2==s3 || s1==8 || s2==8 || s3==8 || s1==s2 || s2==s3 || s1==s3)
    {
        printf("| WIN!  WIN!  WIN! |__||\n");
    }
    else
    {
        printf("|       SORRY      |__||\n");
    }
    if(s1==s2==s3 == 8)
    {
        printf("|     JACKPOT!     |---'\n");
    }
    else if(s1==s2==s3)
    {
        printf("|     Match 3!     |---'\n");
    }
    else if(s1==s2 || s2==s3 ||s1==s3)
    {
        printf("|     Match 2!     |---'\n");
    }
    else if(s1==8 || s2==8 || s3==8)
    {
        printf("|   Crazy eight    |---'\n");
    }
    else
    {
        printf("|    Try Again     |---'\n");
    }
            printf("|     _______     |\n");
            printf("|____/ o o   \\____|\n");
            printf("\\     o oo o      /\n");
            printf(" \\_______________/\n");
            printf("  U             U\n\n");
        return;
    }
never mind, i saved the file as .cpp and it compiled. the thing is that it still doesn't print the slot-machine itself. i don't know what the hell is going on with printing this stupid thing
Topic archived. No new replies allowed.
Pages: 12