I'm new to javascript and I have the following code:
<p id="demo"></p>
<script>
var text = "";
var x = 1;
var y = 1;
while(x < 9) {
text += "<br>" + x +"," + y;
x++;
}
document.getElementById("demo").innerHTML = text;
</script>
It prints out a list of coordinates:
1,1
2,1
3,1
4,1
5,1
6,1
7,1
8,1
The question is once it gets to 8,1 What would you use to get it to continue to:
1,2
2,2
3,2
4,2
5,2
6,2
7,2
8,2
then 1,3 and so on until it reaches 3,4 (this could be variable) then it stops.
In an ideal world I would be able to get it to go up to a maximum of 8,12.