Ich bin heute auf mein Kniffelprogramm gestoßen und dachte mir, dass ich das was bisher entstanden ist hier hochladen könnte und dann den Rest hier aktualisiere was nicht allzulange dauern sollte
Display All

Java Source Code
- // Kniffel.java © Maurice Paschke
- // Version: v.-
- // Date of first release: --/--/--
- // Latest update: 07.12.13
- // Changelog:
- import java.io.*;
- public class Kniffel {
- public static double[] Würfel = {1,2,3,4,5,6};
- public static int Zähler = 0;
- /**
- * @param args, Spielregeln, ISR1, BR1
- * @throws Exception
- */
- public static void main(String[] args) throws Exception
- {
- String Spielregeln;
- System.out.println("\t\t\t\t\t========= KNIFFEL ========\n\n");
- // Spielregeln (Ja/Nein) - Internetverbindung vorrausgesetzt
- InputStreamReader ISR1 = new InputStreamReader(System.in);
- BufferedReader BR1 = new BufferedReader(ISR1);
- System.out.println("Spielregeln lesen [J/N] ?\nAchtung ! Internetverbindung benötigt:");
- Spielregeln = BR1.readLine();
- // Call Spielregeln
- if(Spielregeln.equals("J") || Spielregeln.equals("j"))
- {
- Kniffel Jump = new Kniffel();
- Jump.Regeln();
- System.out.println("Regeln gelesen ? Dann koennen wir ja starten.\n\n");
- }
- System.out.println("Spiel wird gestartet.");
- Kniffel Jump2 = new Kniffel();
- Jump2.Spielstart();
- // TODO: Start the Game
- // : Highscores
- // : Methoden für Spielregeln anlegen
- }
- // URL Aufruf mit Spielregeln
- public void Regeln() throws Exception
- {
- // Hat einen Temporären Gyazolink, dass muss geändert werden.
- System.out.println("Connecting ...");
- Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler " + "http://www.codeavengers.com/c/paschee/test.html");
- return;
- }
- // 1. Würfelwurf
- public void Spielstart()
- {
- StartendeWürfelberechnung();
- for(int i = 0; i < Würfel.length; i++)
- {
- Zähler++;
- System.out.println("Würfel " + Zähler + ": " + Würfel[i]);
- }
- System.out.println("\nWelche Würfel "halten" ?");
- // TODO: Switch-Case
- }
- // Berechnung der Würfel
- public static double[] StartendeWürfelberechnung()
- {
- for(int i = 0; i < Würfel.length; i++)
- {
- Würfel[i] = (int)(Math.random()*6+1);
- }
- return Würfel;
- }
- /*
- public static double[] FortführendeWürfelberechnung()
- {
- // TODO :Bekommt temporäres Array aus gehaltenen Würfeln aus Spielstart()
- // Berechnet gehaltene Würfel und schiebt sie zurück ins Array Würfel.
- }*/
- }
- Paschee
