Hi all,

I just got into java. At the moment I'm coding little games and loops trying to increase my skill level and this has been puzzling me for a few hours. I'm sure it's something small but I cannot find what is wrong with the code below. I'm starting to program a simple snake game from scratch. I can print the board just fine but am having trouble printing the head of the snakes initial position. Also if anyone has any tips or tricks for what I've already done or might encounter please share!

I want it to output something like this...
***************
*             *
*             *
*             *
*             *
***************

With an "o" in the center, being the head. The code is a bit messy, and am well aware that I will have to make changes to formatting. Once I get this thing to print I will take care of the rest. Any help would be awesome! Thanks!

package snake.game;

public class Game {
 
	public boolean running = false;
	public static boolean newGame = true;
	public static final int boardX = 40;
	public static final int boardY = 20;
 
 
 
 
	private static void Game()
	{
		updateBoard();
	}
 
	public static void updateBoard() {
		int xPos = 0, yPos = 1;
		int[] playerPos = new int[2];
 
		playerPos = updatePlayer();
		System.out.println("X: " + playerPos[xPos] + "Y: " + playerPos[yPos] );
 
 
		for (int y = 0; y < boardY; y++)
		{
			for (int x = 0; x < boardX; x++)
			{
				if (x == 0 || x == boardX - 1 || y == 0 || y == boardY -1)
				{
					if (y == playerPos[yPos] && x == playerPos[xPos)
						System.out.print("O");
 
					else
						System.out.print("*");
 
				}
				else
					System.out.print(" ");
			}
 
			System.out.println(" ");
		}
 
 
	}
 
	public static int[] updatePlayer() 
	{
		int[] startPosition = new int[2];
		int[] position = new int[2];
 
		startPosition[0] = boardX / 2;
		startPosition[1] = boardY / 2;
 
		if (newGame)
			for (int i = 0; i < 2; i++)
			{
				position[i] = startPosition[i];
				newGame = false;
			}
 
		return position;
 
	}
 
        public static void main(String[] args) 
	{
 
		Game();
 
	}
 
 
}

EDIT: Solved it while reading my own post haha. Still any tips?