Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ArrayList<Object> vijandenMaken(String aantal) {
- this.aantalVijandenLijst = new ArrayList<>();
- try {
- int invoer = Integer.parseInt(aantal);
- if (invoer < 1 || invoer > 10) {
- System.out.println("invoer moet tussen 1 en 10 liggen");
- } else {
- this.aantalVijanden = invoer;
- for (int i = 1; i <= this.aantalVijanden; i++) {
- this.aantalVijandenLijst.add(new Mus(4));
- }
- }
- } catch (NumberFormatException e) {
- System.out.println("foute invoer");
- }
- return aantalVijandenLijst;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement