Hi, I have a project for University which involves making a basic version of the game Futoshiki. This game is a lot like Sudoku except you can only use the numbers 1 to 5 and there are arithmic operators between the boxes.

I have already completed most of the program, the problem I am having is the print puzzle method which should print the whole puzzle in character format.

So far, the whole program works and it does print the puzzle. My problem is that I need to also print the arithmic operators and I am kind of confused how to do this without a mass amount of loops which I don't think I'm supposed to do.

public class FutoshikiPuzzle
{
        int[][] grid = new int[5][5];
        String[][] rowConstraints = new String[5][4];
        String[][] columnConstraints = new String[5][4];
        Random generator = new Random();
 
    public FutoshikiPuzzle()
    {    
        for(int i = 0; i < 5; i++)
            for(int j = 0; j < 4; j++)
                rowConstraints[ i ][ j ] = " ";
 
        for(int i = 0; i < 5; i++)
            for(int j = 0; j < 4; j++)
                columnConstraints[ i ][ j ] = " ";
    }
 
    public void setSquare()
    {
        int num = generator.nextInt(5) + 1;
        int i = generator.nextInt(5);
        int j = generator.nextInt(5);
 
        grid[i][j] = num;
    }
 
    public void setRowConstraint()
    {
        int i = generator.nextInt(5);
        int j = generator.nextInt(4);
        String[] chars = new String[]{">","<"};
        int rndChar = generator.nextInt(chars.length);
        String constraint = chars[rndChar];
 
        rowConstraints[i][j] = constraint;
    }
 
    public void setColumnConstraint()
    {
        int i = generator.nextInt(5);
        int j = generator.nextInt(4);
        String[] chars = new String[]{"^","v"};
        int rndChar = generator.nextInt(chars.length);
        String constraint = chars[rndChar];
 
        columnConstraints[i][j] = constraint;
    }
 
    public void fillPuzzle()
    {
        setSquare();
        setRowConstraint();
        setColumnConstraint();
    }
 
    public void printPuzzle()
    {
        int count = 1;
        for(int i = 0; i < grid.length; i++)
            for(int j = 0; j < grid.length; j++) //
 
                if (count < 5 ){
                System.out.print(" | " + grid[i][j] + " | " );
                count++;
                }
               else {
                System.out.println(" | " + grid[i][j] + " | ");
                count = 1;
            }
    }
}