Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.39 KB | None | 0 0
  1.  
  2. public class Minions_Game {
  3.  
  4.     public static void main(String[] args) {
  5.         // Variablen Deklaration
  6.         char minions[]= new char [11];
  7.         char linksrechts;
  8.         int norbertsPlatz, norbertsPlatzKorrekt, ersterZug, mLinks, mRechts, anzahlMinions;
  9.         boolean norbertGezogen = false, deinZug = true;
  10.         //Norbertsplatz und dessen korrekter Versatz
  11.         norbertsPlatz = (int)(Math.random() * 10 )+ 1;
  12.         norbertsPlatzKorrekt = norbertsPlatz + 1;
  13.         ersterZug=(int)(Math.random() * 10 )+ 1;
  14.         mLinks = norbertsPlatz;
  15.         mRechts = 11-norbertsPlatz;
  16.        
  17.        
  18.         //Startscreen
  19.         System.out.println("\n Das Minion-Game ziehe deine Minions in dein Team, "
  20.                 + "aber bloß nicht Norbert! \n Norbert hat den Platz Nummer: " + norbertsPlatzKorrekt);
  21.    
  22.         for(int x=0;x<=10;x++) {
  23.             System.out.print(minions[x]='M');
  24.             minions[norbertsPlatz] = 'O';
  25.             }
  26.         //Das Spiel
  27.         while(!norbertGezogen) {
  28.             int abgezogenLinks = 1, abgezogenRechts = 11, abzugLinks, abzugRechts;
  29.             while(deinZug == true) {
  30.                
  31.                 System.out.println("\n Möchtest du Links oder Rechts abziehen? (L) / (R)");
  32.                 linksrechts = StaticScanner.nextChar();
  33.                
  34.                 if(linksrechts == 'L') {
  35.                
  36.                     System.out.println("\n Ziehe 1-3 Minions von Links ab: ");
  37.                     abzugLinks = StaticScanner.nextInt();
  38.                     mLinks= mLinks - abzugLinks;
  39.                    
  40.                     for(int a=0; a<=mLinks; a++) {
  41.                         System.out.print(minions[a]='-');
  42.  
  43.                     }
  44.                     for(int i=mLinks; i <= norbertsPlatz; i++) {
  45.                         System.out.print(minions[i]='M');
  46.                     }
  47.                     System.out.print(minions[norbertsPlatz]='O');
  48.                     for(int x=norbertsPlatz; x<mRechts;x++) {
  49.                         System.out.print(minions[x]='M');
  50.  
  51.                     }
  52.                     for(int b=mRechts; b<11;b++) {
  53.                         System.out.print(minions[b]='-');
  54.  
  55.                     }
  56.                    
  57.                     // Print M
  58.                 /*  for(int i=abgezogenLinks; i<abgezogenRechts;i++) {
  59.                         System.out.print(minions[i]='M');
  60.                     }
  61.                     System.out.print(minions[norbertsPlatz]);
  62.                     //Print --- links
  63.                     for(int x=0; x<=abgezogenLinks;x++) {
  64.                         System.out.print(minions[x]='-');
  65.                        
  66.                     }
  67.                     //Print --- rechts
  68.                     for(int z=abgezogenRechts; z<=10;z++) {
  69.                         System.out.print(minions[z]='-');
  70.  
  71.                     }*/
  72.                    
  73.                         System.out.println("\n Du hast " + abzugLinks + " Minions abgezogen...");
  74.                 }else if(linksrechts == 'R') {
  75.                     System.out.println("\n Ziehe 1-3 Minions von Rechts ab: ");
  76.                     abzugRechts = StaticScanner.nextInt();
  77.                    
  78.                 }
  79.             }
  80.         }
  81.        
  82.     }
  83.  
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement