Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Minions_Game {
- public static void main(String[] args) {
- // Variablen Deklaration
- char minions[]= new char [11];
- char linksrechts;
- int norbertsPlatz, norbertsPlatzKorrekt, ersterZug, mLinks, mRechts, anzahlMinions;
- boolean norbertGezogen = false, deinZug = true;
- //Norbertsplatz und dessen korrekter Versatz
- norbertsPlatz = (int)(Math.random() * 10 )+ 1;
- norbertsPlatzKorrekt = norbertsPlatz + 1;
- ersterZug=(int)(Math.random() * 10 )+ 1;
- mLinks = norbertsPlatz;
- mRechts = 11-norbertsPlatz;
- //Startscreen
- System.out.println("\n Das Minion-Game ziehe deine Minions in dein Team, "
- + "aber bloß nicht Norbert! \n Norbert hat den Platz Nummer: " + norbertsPlatzKorrekt);
- for(int x=0;x<=10;x++) {
- System.out.print(minions[x]='M');
- minions[norbertsPlatz] = 'O';
- }
- //Das Spiel
- while(!norbertGezogen) {
- int abgezogenLinks = 1, abgezogenRechts = 11, abzugLinks, abzugRechts;
- while(deinZug == true) {
- System.out.println("\n Möchtest du Links oder Rechts abziehen? (L) / (R)");
- linksrechts = StaticScanner.nextChar();
- if(linksrechts == 'L') {
- System.out.println("\n Ziehe 1-3 Minions von Links ab: ");
- abzugLinks = StaticScanner.nextInt();
- mLinks= mLinks - abzugLinks;
- for(int a=0; a<=mLinks; a++) {
- System.out.print(minions[a]='-');
- }
- for(int i=mLinks; i <= norbertsPlatz; i++) {
- System.out.print(minions[i]='M');
- }
- System.out.print(minions[norbertsPlatz]='O');
- for(int x=norbertsPlatz; x<mRechts;x++) {
- System.out.print(minions[x]='M');
- }
- for(int b=mRechts; b<11;b++) {
- System.out.print(minions[b]='-');
- }
- // Print M
- /* for(int i=abgezogenLinks; i<abgezogenRechts;i++) {
- System.out.print(minions[i]='M');
- }
- System.out.print(minions[norbertsPlatz]);
- //Print --- links
- for(int x=0; x<=abgezogenLinks;x++) {
- System.out.print(minions[x]='-');
- }
- //Print --- rechts
- for(int z=abgezogenRechts; z<=10;z++) {
- System.out.print(minions[z]='-');
- }*/
- System.out.println("\n Du hast " + abzugLinks + " Minions abgezogen...");
- }else if(linksrechts == 'R') {
- System.out.println("\n Ziehe 1-3 Minions von Rechts ab: ");
- abzugRechts = StaticScanner.nextInt();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement