HELP Trouble With Switch

Pages: 12
ughhhhh... I did that, and it works fine for the users numbers compared to the computers, but it's adding two random points for some reason when the computers random numbers are compared to the users (they're two parts.. first you "guess" the computers rands, then the second round the computer tries to "guess" your numbers... any ideas.


csr is computers second round rands, and sr is users second round numbers

or maybe I did what you told me to do wrong....
it's like off by 1 or 2 points. Sometimes it works though.

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
void calc11()
{
 if(csr1==sr1||csr1==sr2||csr1==sr3||csr1==sr4||csr1==sr5||csr1==sr6||csr1==sr7||csr1==sr8||csr1==sr9||csr1==sr10)
        x1=0+p1;

 if(csr2==sr1||csr2==sr2||csr2==sr3||csr2==sr4||csr2==sr5||csr2==sr6||csr2==sr7||csr2==sr8||csr2==sr9||csr2==sr10)
        x2=0+p1;

 if(csr3==sr1||csr3==sr2||csr3==sr3||csr3==sr4||csr3==sr5||csr3==sr6||csr3==sr7||csr3==sr8||csr3==sr9||csr3==sr10)
        x3=0+p1;

 if(csr4==sr1||csr4==sr2||csr4==sr3||csr4==sr4||csr4==sr5||csr4==sr6||csr4==sr7||csr4==sr8||csr4==sr9||csr4==sr10)
        x4=0+p1;

 if(csr5==sr1||csr5==sr2||csr5==sr3||csr5==sr4||csr5==sr5||csr5==sr6||csr5==sr7||csr5==sr8||csr5==sr9||csr5==sr10)
        x5=0+p1;

 if(csr6==sr1||csr6==sr2||csr6==sr3||csr6==sr4||csr6==sr5||csr6==sr6||csr6==sr7||csr6==sr8||csr6==sr9||csr6==sr10)
        x6=0+p1;

 if(csr7==sr1||csr7==sr2||csr7==sr3||csr7==sr4||csr7==sr5||csr7==sr6||csr7==sr7||csr7==sr8||csr7==sr9||csr7==sr10)
        x7=0+p1;

 if(csr8==sr1||csr8==sr2||csr8==sr3||csr8==sr4||csr8==sr5||csr8==sr6||csr8==sr7||csr8==sr8||csr8==sr9||csr8==sr10)
        x8=0+p1;

 if(csr9==sr1||csr9==sr2||csr9==sr3||csr9==sr4||csr9==sr5||csr9==sr6||csr9==sr7||csr9==sr8||csr9==sr9||csr9==sr10)
        x9=0+p1;

 if(csr10==sr1||csr10==sr2||csr10==sr3||csr10==sr4||csr10==sr5||csr10==sr6||csr10==sr7||csr10==sr8||csr10==sr9||csr10==sr10)
        x10=0+p1;

        finalcalc();
}
Last edited on
Nevermind... ignore the post above.. I figured that out. One more question, how do I make my program not crash when someone enters a character such as a,b,c etc. instead of a number?
Last edited on
Topic archived. No new replies allowed.
Pages: 12