Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import static gdi.MakeItSimple.*;
- public class RPG {
- /** 0 = Stärke
- * 1 = Konstitution
- * 2 = Geschicklichkeit
- * 3 = Intelligenz
- * 4 = Willenskraft
- * 5 = Klasse
- * 6 = Geschlecht
- **/
- public int[] stat = new int[7];
- public void charakterErstellung(){
- //Geschlechtabfrage
- println("Bist du eine Frau, ein Mann oder ein Hermaphrodit?");
- String temp = readLine();
- while(stat[6]!= 0 || stat[6]!= 1 || stat[6]!= 2 ){
- if(temp.equals("Frau")){
- stat[6]=1;
- }else if(temp.equals("Mann")){
- stat[6]=0;
- }else if(temp.equals("Hermaphrodit")){
- stat[6]=2;
- }else {
- println("Kein gültige Eingabe");
- println("Bist du eine Frau, ein Mann oder ein Hermaphrodit?");
- temp = readLine();
- }
- }
- //Klassenabfrage
- stat[5]= 6;
- println("Wähle eine Klasse: Krieger, Bogenschütze, Magier");
- temp = readLine();
- while(stat[5]== 6){
- if(temp.equals("Krieger")){
- stat[5]=0;
- }else if(temp.equals("Bogenschütze")){
- stat[5]=1;
- }else if(temp.equals("Magier")){
- stat[5]=2;
- }else {
- println("Kein gültige Eingabe");
- println("Wähle eine Klasse: Krieger");
- temp = readLine();
- }
- }
- }
- public static void main(String[] args) {
- RPG rpg = new RPG();
- rpg.charakterErstellung();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement