![]() |
graphing in bash
I have to make a graph using bash and i have a weird thing going on. If i set the x and y indexes to 0 it will graph the first point, however, if i try to increment them or change them to a different number it doesn't graph anything. The way i have it set up is a while loop that goes through the rows or y values and then a while loop inside of that goes through the x values. It is a 40 by 80 grid so those numbers are set. Here is the function that graphs. If anyone sees any errors as to why it would graph the first point ok, but then not any others, I would appreciate it. I know i am not incrementing the indexes anywhere because if i try that it doesn't graph anything. So i thought it was not graphing all the points because i wasnt incrementing the indexes right, but even if i set the indexes to 1 instead of 0 it won't graph the second point. Anyone see what i'm doing wrong?
:
function graph |
i got it, the comparisons were wrong change them to -le for less than or equal to and make it 80 and then change it to -ge for greater than or equal to and make it 0. This will graph any point i put in. So if i make the indexes 1 then it will print the point at x array is 1 and y array is 1. Now i just have to figure out where to increment the indexes.
|
got it you just have to increment the xIndex and yIndex inside of the if statement when a value is found
|
| All times are GMT -5. The time now is 3:04 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC