User talk:Retroburrowers: Difference between revisions

sorry can´t test. out of memory
No edit summary
(sorry can´t test. out of memory)
Line 72:
Please remember that the ZX Spectrum is 38 years old and it was not designed for this kind of tasks, it was a cheap and simple computer.
--[[User:Frisian|Frisian]] ([[User talk:Frisian|talk]]) 15:15, 30 April 2020 (UTC)
 
<lang zxbasic>
5 DIM p(249): DIM q(249): DIM r(249,249)
10 FOR i=1 TO 249: LET q(i)=5*LN i: LET p(i)=q(i)/2: NEXT i
15 FOR j=1 TO 249: FOR k=1 TO 249: LET r(j,k)=EXP(q(j)-p(k)): NEXT k: NEXT j
20 FOR w=7 TO 245 STEP 7: FOR x=5 TO 245 STEP 5: FOR y=3 TO 246 STEP 3: FOR z=2 TO 248 STEP 2
25 FOR m=8 TO 249
30 LET sum=r(w,m)+ r(x,m) + r(y,m) + r(z,m)
35 LET lnsum=LN sum
50 IF lnsum=p(m) THEN PRINT w;"^5+";x;"^5+";y;"^5+";z;"^5=";m;"^5": STOP
55 IF lnsum>p(m) THEN NEXT m
60 NEXT z: NEXT y: NEXT x: NEXT w
</lang>
 
This code will not run on ZX Spectrum nor on Fuse. In line 5 the last dim statement uses to much memory 249*249*5 = 310005 Bytes, this is even more then the total amount of memory for a ZX Spectrum 128. Therefore it´s not a ZX Spectrum program.
Also it has the same flaw as the other version it will not find the solution.
 
Please check [[//rosettacode.org/wiki/Category:ZX_Spectrum_Basic ZX Spectrum page]]
--[[User:Frisian|Frisian]] ([[User talk:Frisian|talk]]) 17:44, 30 April 2020 (UTC)
457

edits