Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As @TJ. Crowder told you, need to understand the ´AND´ (´&amp;&amp;´) operation and ´OR´ (´||´)</p> <p>This is a compiling approach to your solution, but you need to improve the code to get it working. Hope you have a good time learning Java.</p> <pre><code>import java.util.Scanner; public class RockPaperScissorsTest { public static void main(String[] args) throws Exception { Scanner input = new Scanner(System. in ); int P1 = 0; int P2 = 0; do { System.out.println("Player 1, choose 1 for rock, 2 for paper, or 3 for scissors."); P1 = input.nextInt(); } while (P1 != 1 &amp;&amp; P1 != 2 &amp;&amp; P1 != 3); System.out.println(""); System.out.println(""); System.out.println(""); do { System.out.println("Player 2, choose 1 for rock, 2 for paper, or 3 for scissors."); P2 = input.nextInt(); } while (P2 != 1 &amp;&amp; P2 != 2 &amp;&amp; P2 != 3); if (P1 == 1 &amp;&amp; P2 == 1) System.out.println("It's a tie!"); if (P1 == 1 &amp;&amp; P2 == 2) System.out.println("Player 2 wins!"); if (P1 == 1 &amp;&amp; P2 == 3) System.out.println("Player 1 wins!"); if (P1 == 2 &amp;&amp; P2 == 1) System.out.println("Player 1 wins!"); if (P1 == 2 &amp;&amp; P2 == 2) System.out.println("It's a tie!"); if (P1 == 2 &amp;&amp; P2 == 3) System.out.println("Player 2 wins!"); if (P1 == 3 &amp;&amp; P2 == 1) System.out.println("Player 2 wins!"); if (P1 == 3 &amp;&amp; P2 == 2) System.out.println("Player 1 wins"); if (P1 == 3 &amp;&amp; P2 == 3) System.out.println("It's a tie!"); } </code></pre> <p>}</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload