Also hab schon mal 3 Klassen: 1."Game" 2."Question" 3.Questionpool
1. hab ich noch nicht viel drin :
public class Game
{
easy= new QuestionPool();
medium =
hard
easy.populateEasy();
}
2.
public class Question
{
private String displayText;
private String answer1;
private String answer2;
private String answer3;
private String answer4;
private int correct; // between 1 and 4
public Question(String displayText, String answer1, String answer2, String answer3, String answer4, int correct) {
this.displayText = displayText;
this.answer1 = answer1;
this.answer2 = answer2;
this.answer3 = answer3;
this.answer4 = answer4;
this.correct = correct;
}
}
und die dritte Klasse 3.
import java.util.ArrayList;
import java.util.Random;
public class QuestionPool {
private ArrayList<Question> e;
public QuestionPool()
{
e = new ArrayList<Question>();
}
public void populateEasy()
{
e.add(new Question("BLA BLA ?","Bla","Bla", "", "", 3));
e.add(new Question("FA AD AS?","WDWAD","awdawdawdw", "", "", 4));
e.add(new Question("What is the colour of an green apple?","yellow","green","red","blue",2));
}
public void populateMedium()
{
e.add(new Question("BLA BLA ?","Bla","Bla", "", "", 3));
e.add(new Question("FA AD AS?","WDWAD","awdawdawdw", "", "", 4));
}
public void populateHard()
{
e.add(new Question("BLA BLA ?","Bla","Bla", "", "", 3));
e.add(new Question("FA AD AS?","WDWAD","awdawdawdw", "", "", 4));
}
public int sizeOfE() {
return e.size();
}
public Question getE(int i) {
return e.get(i);
}
}
......
Also ich bin kein ***** ich verstehe die Befehle größtenteils zu mindest.
Ich weiss nur nicht wo ich anfangen soll bzw. weiter machen soll. Also ist es sehr verwirrend.
:/
Mit freundlichen Grüßen
Diyatenim47