RosettaCodeData/Task/Leonardo-numbers/BASIC256/leonardo-numbers.basic
2024-10-16 18:07:41 -07:00

22 lines
426 B
Text

call leonardo(1,1,1,"Leonardo")
call leonardo(0,1,0,"Fibonacci")
end
subroutine leonardo(L0, L1, suma, texto)
print "Numeros de " + texto + " (" + L0 + "," + L1 + "," + suma + "):"
for i = 1 to 25
if i = 1 then
print L0 + " ";
else
if i = 2 then
print L1 + " ";
else
print L0 + L1 + suma + " ";
tmp = L0
L0 = L1
L1 = tmp + L1 + suma
end if
end if
next i
print chr(10)
end subroutine