Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (true){
- arvaus = arvaa(arvauksia);
- System.out.print("Syötä h tai t: ");
- String pelaaja = lukija.nextLine();
- System.out.println("Syötit " + pelaaja + ", arvasin " + arvaus + ".");
- arvauksia.add(pelaaja);
- if(pelaaja.equals(arvaus)){
- kvoitot++;
- } else {
- pvoitot++;
- }
- System.out.println("Tietokoneen voitot: " + kvoitot);
- System.out.println("Pelaajan voitot: " + pvoitot);
- System.out.println("");
- if (lukija.in.hasNextLine() == False) {
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement