11-11-2012, 04:05 PM
This program was posted on the WOS forums:
And if run as is, takes about 9 seconds in Basic, I think.
As ZX Basic:
It takes 53 seconds!
Code:
For x=-100 To 100
For y=-100 To 100
If (x/2-25)*(x/2-25)+(y-50)*(y-50)<200 Or (x/2+25)*(x/2+25)+(y-50)*(y-50)<200 then plot x+100,96-y
Next y
Next x
And if run as is, takes about 9 seconds in Basic, I think.
As ZX Basic:
Code:
FUNCTION t() as uLong
asm
DI
LD DE,(23674)
LD D,0
LD HL,(23672)
EI
end asm
end function
DIM x,y as integer
DIM time as uLONG
time=t()
For x=-100 To 100
For y=-100 To 100
If (x/2-25)*(x/2-25)+(y-50)*(y-50)<200 Or (x/2+25)*(x/2+25)+(y-50)*(y-50)<200 then plot x+100,96-y
END IF
Next y
Next x
time=t()-time
print CAST(float,time)/50
It takes 53 seconds!