دنبال کننده ها

۱۳۹۶ دی ۱۰, یکشنبه

expression - rock paper cizor java method

[ad_1]



I'm fairly new at coding. I've been exercising, trying out a Rock-Paper-Cizor java code.



Although, i'm blocked and i can't figure out why i have so many error within my method, and why each of my int k is wrong.
I know there's probably an easier way to code this but keep in mind i'm new at all this ;)



Thanks :)



import java.util.Scanner;
import java.util.Random;



public class chifoumi



public static void main(String[] args) 


System.out.println("Bienvenu à CHIFOUMI...");

Scanner sc = new Scanner(System.in);

System.out.println("Pierre, feuille, ciseaux?");
System.out.println("Tape 0, 1 où 2"); // 0 : Pierre
int joueur = sc.nextInt(); // 1 : Feuille
// 2 : Ciseaux

int V = jeu(joueur);

if (V == 1)

System.out.println("Vous avez gagné !");

else

if (V == 0)

System.out.println("Vous avez perdu... ");

else

if (V == 2)

System.out.println("Egalité ! Recommencez ;)");




 public static int jeu(int x) ordi == 2)

int k = 1;

return k;



if (x == 1


Apparently, within my method, all of my int k = ... are wrong... can't figure out why




[ad_2]

لینک منبع