I am facing a problem that my brains cant handle!
I need to make loop that creates pattern like this:
1 1 1 1 1
1 2 2 2 1
1 2 3 2 1
1 2 2 2 1
1 1 1 1 1
so the inner the number is the bigger its but I just can’t figure how could i create such loop
I need this for my AI so i can create interest areas for entities, so this is no school assigment and what i have tried so far
for(int i = 0; i < rows; i++){
for(int j = 0; j < cols; j++){
System.out.print("?");
}
System.out.println();
}
I really cant think of a way to get the number that represent which level is it on!
I’ve been trying to visualize this to myself etc. to figure out how would be the best way to create this or create this at all.. Please help me and my brains from getting headache! 🙂 what i want is simple pseudo code or code in any language that is easy to understand (such as java, c++, c…)
You could do it this way: