Hi I need help with this java code, I need the program to run until user enters -1 instead of 0 or 1
[code]
public static void main(String args[])
{
Scanner input = new Scanner(System.in); //New scanner for input
System.out.println("Ange längde på de 2 lika långa sidorna (Avsluta med -1)");
int length = input.nextInt(); //variable length with the users input
System.out.println("Ska de räta vinkeln vara nedåt (0) eller uppåt (1)");
int side = input.nextInt();
if(side == 0) // if user enter 0 this loop is running
for(int i = 1; i<=length; i++)
{
for(int j = 1; j<=i; j++){
System.out.print("*");
}
System.out.println();
}
if(side == 1) // if user enter 1 this loop is running
for(int i = length; i>=0; i--)
{
for(int j = 0; j<i; j++){
System.out.print("*"); // prints * on the same line depends on loop
}
System.out.println(); // new line
}
}// end main
[code]