07-17-2005, 03:17 AM
I can... lol,. but so far, my line routine is finally looking solider,. I made a code to run it 3D, it goes all the way around w/o freezing, tho.. it seems it like to shift awkwardly at places... whether its the integer set up with LOCATE, or maybe some mis-calcs, not really sure... here is mine:
I took out REMed experiment code that didn't work, and a REMed debugger.. If it doesn't work like the current lib, I might have deleted something important in the process, tho I doubt it.. :wink: ..
You'll need to set the MAXX01 and MAXY01 variables to your max X, Y text screen output, otherwise it will cut the whole line thinking its off screen.. :wink:
Code:
SUB ASCII_LINE(X01, Y01, X02, Y02, ASCII)
IF X02 > X01 THEN XR01 = X02 - X01
IF X02 < X01 THEN XR01 = X01 - X02
IF Y02 > Y01 THEN YR01 = Y02 - Y01
IF Y02 < Y01 THEN YR01 = Y01 - Y02
RAD! = ATN(YR01 / XR01)
ANG! = (RAD! / 3.1415926535897932384626433832795 * 180)
XR02! = (1 * COS(ANG! * 3.1415926535897932384626433832795 / 180))
YR02! = (1 * SIN(ANG! * 3.1415926535897932384626433832795 / 180))
Hyp01! = ((YR01)^2 + (XR01)^2)^.5
X00! = X01
Y00! = Y01
CONT01 = 0
DO
CONT01 += 1
IF (Y00! > 0 AND Y00! < MAXY01) AND (X00! > 0 AND X00! < MAXX01) THEN
LOCATE INT(Y00!), INT(X00!): PRINT CHR$(ASCII);
END IF
IF (Hyp01! < CONT01) THEN EXIT DO
IF Y02 > Y01 THEN Y00! += YR02!
IF X02 > X01 THEN X00! += XR02!
IF Y02 < Y01 THEN Y00! -= YR02!
IF X02 < X01 THEN X00! -= XR02!
LOOP
END SUB
I took out REMed experiment code that didn't work, and a REMed debugger.. If it doesn't work like the current lib, I might have deleted something important in the process, tho I doubt it.. :wink: ..
You'll need to set the MAXX01 and MAXY01 variables to your max X, Y text screen output, otherwise it will cut the whole line thinking its off screen.. :wink: