+ 2
If I have 2 players and each get points. Ho would write a line of code to say, if playerA number is = b then don't add a point?
I have (blist[I] = alist [I] { Something}
12 Respostas
+ 3
Ok buddy.
This should be close to what you want. You can tweak it to suit your final shape & pretty up the output.
Its a very simple code using list slices, which will be covered in your python course.
Read up to understand how it works
https://code.sololearn.com/cyk0dmHIbpmM/?ref=app
+ 6
texas1234 you don't even need an else case here as nothing needs to be done when the corresponding entries are equal.
+ 4
In your pseudocode, you're using arrays. What are they arrays of?
+ 3
If you want both parties to get a point if scores are even,
Then
If A ==B:
aparty +=1
bparty +=1
This will assign a point each for a draw
+ 3
Please message me with your code attached as I don't understand what you are trying to achieve.
I will review when I next get a chance & see if I can help you resolve this.
+ 3
Thank you!
+ 2
int a = 10;
int b = 10;
if(a > b || b > a ){System.out.print(true);}
else{System.out.print(false);}
//output false
This would mean if
a == b false
b == a false
a > b true get points
b > a true get points
a < b true get points
b < a true get points
+ 2
UPDATE
My code:
( NUMBERS BEING COMPARED)
alist [] = { 3, 6,10};
blist [] = { 5,6, 7} ;
Int aScore=0;
Int bscore=0;
For ( int I=0; I <alist.length; I++)
{
If (alist [ I ] > blist [ I] ) {
aScore++;
}
else if ( blist [ I] > alist [ I ] ) {
bScore++;
}
Else ( blist is equal to alist neither get a point ( HOW DO I CODE THIS PART)
THE OUTPUT NEEDS TO BE 1 1 ( 1 POINT FOR EACH LIST THE EVEN SCORE NOONE GETS A POINT)
THANKS!
+ 2
See if the attached code helps
https://code.sololearn.com/cJiUP2295JWD/?ref=app
+ 2
Sonic is right.
If you don't refer to the inputs being equal, then the code will not create an output regarding that status.
+ 1
Ok so see but also I need the output to be 1 1. I'm currently getting
1 0
1 0
1 1
+ 1
The output is
1 0
10
1 1
I want just 1 1
it's not comparing it the way I want