so, for an assignment, I have to do this part, but the if parts are red and i don't understand why
if (int >=1 && int<=7){
Scanner sc = new Scanner(System.in);
String direction;
System.out.println("Enter your choice: ");
direction=sc.nextD();
if (direction = 'left'){
maze.push('left');
System.out.println("Pushed left to stack");
I realize I forgot part of it. updated code:
Stack maze = new Stack();
for(int x=1; x<=10; x++)
{
Random ran = new Random();
int a = ran.nextInt(10) + 1;
if (int a>=1 && int a<=7){
Scanner sc = new Scanner(System.in);
String direction;
System.out.println("Enter your choice: ");
direction=sc.nextLine();
if (direction.equals ("left") || direction.equals ("Left")){
maze.push("left");
the if (int a>=1 && int a<=7) part doesn't work. everything else is fine