From d4fdb9f9dff4fd327db894a1f6ed500b670dcf63 Mon Sep 17 00:00:00 2001 From: David Kopec Date: Wed, 4 Dec 2024 05:42:32 -0500 Subject: [PATCH] Better style in fib.bas --- NanoBASIC/Examples/fib.bas | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/NanoBASIC/Examples/fib.bas b/NanoBASIC/Examples/fib.bas index cba3b0a..df80467 100644 --- a/NanoBASIC/Examples/fib.bas +++ b/NanoBASIC/Examples/fib.bas @@ -1,13 +1,12 @@ REM Printing the Fibonacci numbers less than 100 -REM A is LAST -20 LET A = 0 -REM B is NEXT -30 LET B = 1 -31 PRINT A -REM C is LAST + NEXT -35 LET C = A + B -40 LET A = B -50 LET B = C -60 IF B > 100 THEN GOTO 80 -70 GOTO 31 -80 PRINT A +REM A is the last number +10 LET A = 0 +REM B is the next number +11 LET B = 1 +20 PRINT A +21 PRINT B +REM C is last + next +30 LET C = A + B +31 LET A = B +32 LET B = C +40 IF B < 100 THEN GOTO 21