Welcome, Guest. Please login or register.

Author Topic: AmigaBasic revisited  (Read 5024 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline MarkTime

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 901
    • Show all replies
    • http://www.tanooshka.com
Re: AmigaBasic revisited
« on: February 18, 2003, 07:11:59 PM »
well, as someone already stated, that LineLen routine just doesn't do anything useful.

But I think this can be accomplished in one line, using modulo division, just divide y by 25, and if the "remainder" (from hand calculated long division)
is zero then you have a multiple of 25, and its time to go to the next line.

I do not know how to write that in Amiga basic, but here is some pseudo code:

after printing x, then just check:

if x%25=0 then print;


EDITED......
oh crud, just saw someone already gave the answer, well, let me say I agree!!!

 ;-)  ;-)  ;-)
 

Offline MarkTime

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 901
    • Show all replies
    • http://www.tanooshka.com
Re: AmigaBasic revisited
« Reply #1 on: February 18, 2003, 08:24:00 PM »
If you want speed, just unravel the loops....

I mean

print chr$(33)
print chr$(34)
print chr$(35)
etc...etc....
print chr$(50)
print chr$(13)
print chr$(51)

this is a legitimate practice, unraveling loops!

<--everyone stares at me in horror -->

also you could probably have a 'DATA' field doing the same thing, which would look a little cleaner

psuedo code:

for x = 33 to 264
print read data
next x

DATA 33,34,35, etc.etc.etc., 50,13,51

sure C is faster, so is machine code...and btw, this would be faster if he had all the codes memorized and didn't need to read them. :-D  :-D  :-D