From 42e004f0a92e1f42370fd6a553db2b6aff9fc017 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Tue, 11 Jan 2022 10:18:58 +0100 Subject: [PATCH] Refactor Fieldtype declarations --- src/main/java/Gameboard.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/Gameboard.java b/src/main/java/Gameboard.java index c4c6212..81f54f6 100644 --- a/src/main/java/Gameboard.java +++ b/src/main/java/Gameboard.java @@ -6,14 +6,14 @@ public class Gameboard { } public void initGameboard (){ - board[0] = 1; - board[10] = 1; - board[20] = 1; - board[30] = 1; - board[9] = 2; - board[19] = 2; - board[29] = 2; - board[39] = 2; + for(int i = 0; i < 40; i++) { + if ( i % 10 == 0) { + board[i] = 1; + } + if( i % 10 == 9) { + board[i] = 2; + } + } for (int i = 40; i < board.length; i++) { board[i] = 3; }