✅ rock paper scissors game
I'm getting an error with the if statement, says that && is invalid
12 Replies
oof
thx il try this now
the whole expression needs to be wrapper in parens
oh
ok
when writing the if else statements to decide who has won the round, do you know if there is a faster way than writing a bunch of if else statements?
so instead of repeating this over and over again for paper and scissors
@Cyberrex
are you familiar with methods?
yes
oh yeah
you could write a method that returns who won
instead of having that in Main
ahh ok
what you can also do instead of a million else ifs
is for each choice to check all other possible choices and return who won
ok
wait so would i have all the else ifs in the method or separate else if for each choice?
inside the method that returns the winner
il use switch case instead