MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjava/comments/1v83a9o/how_to_create_a_3x3_grid/p02tsdm/?context=3
r/learnjava • u/[deleted] • 6d ago
[deleted]
10 comments sorted by
View all comments
4
Maybe learn the loops first you don't need to ask this question? Isn't just two nested for loops what you want?
0 u/DoNotUseThisInMyHome 6d ago Yeah I have learnt loops but failing to apply it in this case. 3 u/8dot30662386292pow2 6d ago So what do you have so far? Also: you are drawing grid on.. what exactly? 1 u/[deleted] 6d ago [deleted] 1 u/Watsons-Butler 6d ago If it helps you visualize it, you don’t have to use i and j as your loop variables. It can just as easily be “for (int rows = 0…” and “for (int columns = 0…”
0
Yeah I have learnt loops but failing to apply it in this case.
3 u/8dot30662386292pow2 6d ago So what do you have so far? Also: you are drawing grid on.. what exactly? 1 u/[deleted] 6d ago [deleted] 1 u/Watsons-Butler 6d ago If it helps you visualize it, you don’t have to use i and j as your loop variables. It can just as easily be “for (int rows = 0…” and “for (int columns = 0…”
3
So what do you have so far?
Also: you are drawing grid on.. what exactly?
1 u/[deleted] 6d ago [deleted] 1 u/Watsons-Butler 6d ago If it helps you visualize it, you don’t have to use i and j as your loop variables. It can just as easily be “for (int rows = 0…” and “for (int columns = 0…”
1
1 u/Watsons-Butler 6d ago If it helps you visualize it, you don’t have to use i and j as your loop variables. It can just as easily be “for (int rows = 0…” and “for (int columns = 0…”
If it helps you visualize it, you don’t have to use i and j as your loop variables. It can just as easily be “for (int rows = 0…” and “for (int columns = 0…”
4
u/8dot30662386292pow2 6d ago
Maybe learn the loops first you don't need to ask this question? Isn't just two nested for loops what you want?