An exercise in benchmark "optimising"...

Let's talk about anything related to the 6502 microprocessor.
Post Reply
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: An exercise in benchmark "optimising"...

Post by BigEd »

Oh dear, a tiny bit more... 354.92 now.

Code: Select all

190L%=LEN(C$)+1
300FORY%=0TOH%:R%=(U*Y%+T)*S%:V%=(S-J)*S%:FORX%=0TOW%:V%=V%+J*S%:D%=0:E%=0:A%=B%:REPEATIFA%<L% J%=D%*D%DIVS%:K%=E%*E%DIVS%:IFJ%+K%<M% Z%=J%-K%+V%:E%=(D%+D%)*E%DIVS%+R%:D%=Z%:A%=A%+1:UNTILFALSE
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: An exercise in benchmark "optimising"...

Post by drogon »

BigEd wrote:
Oh dear, a tiny bit more...

Code: Select all

190L%=LEN(C$)+1
300FORY%=0TOH%:R%=(U*Y%+T)*S%:V%=(S-J)*S%:FORX%=0TOW%:V%=V%+J*S%:D%=0:E%=0:A%=B%:REPEATIFA%<L% J%=D%*D%DIVS%:K%=E%*E%DIVS%:IFJ%+K%<M% Z%=J%-K%+V%:E%=(D%+D%)*E%DIVS%+R%:D%=Z%:A%=A%+1:UNTILFALSE
Nice :)

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
Post Reply