I´ve been learning java for a week, yesterday while on bed, couldnt sleep i tought to myself, it would be a good excercise if i made a program where i would input the side of a square, then make the square representation.
Anyway i tought i would do this like in 10m, i spent 3hours till i got it right, feel a complete retard and my motivation is damm low right now.
import java.util.Scanner; public class quadrado { public static void main(String[] args) { Scanner input = new Scanner(System.in); int quadrado; System.out.println("Insert Square Size"); quadrado = input.nextInt(); int counter = 1; int total=1; while(counter<quadrado){ counter++; total++; System.out.print("O "); if(counter==quadrado){ System.out.println("O "); if((total)==(Math.pow(quadrado, 2))){break;} counter=1; total++; } } } }