Text on screen

New to FreeBASIC? Post your questions here.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Text on screen

Post by dodicat »

Go back to the 80's or thereabouts, maybe late 70's

Code: Select all

'rem prime factors
#lang "qb"

1 lowers%=9900
2 uppers%=10000

10 For counts% = lowers% To uppers%
20 number% = counts%
30 
40 Print number%;"= ";
50 divisor% = 2
60 While divisor% <= number%
70 Gosub 490
80 divisor% = divisor% + 1
90 Wend       
100 Print
101 Next counts%
102 Print

rem subroutine
490
500 If number% Mod divisor% = 0 Then
510 c$="x"
520 number% = number% / divisor%
530 If number% = 1 Then c$=""
540 Print divisor%;c$;
550 Goto 490
560 End If
570 If counts%<=uppers% Then Return

580 Sleep 
Post Reply