Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. while (true){
  2. arvaus = arvaa(arvauksia);
  3.  
  4. System.out.print("Syötä h tai t: ");
  5. String pelaaja = lukija.nextLine();
  6. System.out.println("Syötit " + pelaaja + ", arvasin " + arvaus + ".");
  7. arvauksia.add(pelaaja);
  8. if(pelaaja.equals(arvaus)){
  9. kvoitot++;
  10. } else {
  11. pvoitot++;
  12. }
  13. System.out.println("Tietokoneen voitot: " + kvoitot);
  14. System.out.println("Pelaajan voitot: " + pvoitot);
  15. System.out.println("");
  16. if (lukija.in.hasNextLine() == False) {
  17. break;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement