Skip to content

Commit d4fdb9f

Browse files
committed
Better style in fib.bas
1 parent 936ccc0 commit d4fdb9f

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

NanoBASIC/Examples/fib.bas

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
REM Printing the Fibonacci numbers less than 100
2-
REM A is LAST
3-
20 LET A = 0
4-
REM B is NEXT
5-
30 LET B = 1
6-
31 PRINT A
7-
REM C is LAST + NEXT
8-
35 LET C = A + B
9-
40 LET A = B
10-
50 LET B = C
11-
60 IF B > 100 THEN GOTO 80
12-
70 GOTO 31
13-
80 PRINT A
2+
REM A is the last number
3+
10 LET A = 0
4+
REM B is the next number
5+
11 LET B = 1
6+
20 PRINT A
7+
21 PRINT B
8+
REM C is last + next
9+
30 LET C = A + B
10+
31 LET A = B
11+
32 LET B = C
12+
40 IF B < 100 THEN GOTO 21

0 commit comments

Comments
 (0)