SHARE
TWEET

RIO

a guest Oct 23rd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Gui {
  2.     public void printRio(boolean[] values){
  3.         StringBuilder st = new StringBuilder();
  4.         st.append("____RIO____\n");
  5.         st.append("|    "+zeichen(values[4])+"    |\n");
  6.         st.append("|    "+zeichen(values[3])+"    |\n");
  7.         st.append("|    "+zeichen(values[2])+"    |\n");
  8.         st.append("|    "+zeichen(values[1])+"    |\n");
  9.         st.append("|    "+zeichen(values[0])+"    |\n");
  10.         st.append("___________");
  11.         System.out.println(st.toString());
  12.     }
  13.     private String zeichen(boolean loch){
  14.         if (loch){
  15.             return "°";
  16.         }
  17.         else {
  18.             return "*";
  19.         }
  20.     }
  21.     public void printSpieler(Spieler[] spielers){
  22.         StringBuilder st = new StringBuilder();
  23.         for (Spieler spieler: spielers) {
  24.             st.append("Name: " + spieler.getName() + " Stäbchen: " + spieler.getAnzahlStaebchen());
  25.             st.append("\n");
  26.         }
  27.         System.out.println(st.toString());
  28.     }
  29.     public void printGewinner(Spieler[] spielers){
  30.         for (Spieler spieler:spielers
  31.              ) {
  32.             if(spieler.getAnzahlStaebchen()==0){
  33.                 System.out.println("Spieler: " + spieler.getName() + " Hat gewonnen");
  34.                 break;
  35.             }
  36.         }
  37.     }
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top