jeudi 1 février 2018

returning to an if statement

I cant make the draw if statement to return to itself

I'm pretty sure i can do it, hopefully i make sense i generally know what im doing its just i cant remember how to do this.

    BlackJack bj=new BlackJack();
    System.out.println("Press draw to start");
    Scanner sc=new Scanner(System.in);
    String a=sc.nextLine();
    if(a.equals("draw")) {
        bj.playerCardValue();
        return;
    }
    if(a.equals("stay")) {
        bj.stay();
    }   
}

Aucun commentaire:

Enregistrer un commentaire