home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
C64Educational
/
PRIME-V2.4
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
1KB
|
26 lines
0 GOTO200
1 IFA/X=INT(A/X)THEN100
2 IFX<BTHENX=X+TW:GOTO1
50 POKE53280,11:POKE53265,91:PRINTA" IS PRIME"
55 GOTO120
100 POKE53280,11:POKE53265,91:B=A/X:PRINTA;" EQUALS ";X;"*";B""
120 INPUT"YOUR NUMBER";A:GOTO250
200 PRINT"[158]":POKE53281,9:POKE53280,11
205 TW=2:POKE53265,91:POKE53283,0:POKE53282,1
207 PRINT"PROGRAM BY MIKE PHEBUS.":FORX=1TO500:NEXT:PRINT
210 PRINT"THIS IS A PROGRAM TO TEST FOR [144][208][210][201][205][197] [206][213][205][194][197][210][211][158]. YOU MAY SEE THE SCREEN";
212 PRINT" BLINK OREVEN GO BLANK. THAT'S OK.[146][158] THE COMPUTER IS 'STEALING' THE";
215 PRINT" SCREEN SO THAT IT CAN THINK FASTER!"
220 PRINT"ENTER '1' TO EXIT THE PROGRAM"
230 PRINT"ENTER A NUMBER, AND I'LL TELL YOU"
240 PRINT"IF IT'S PRIME. ";:INPUT"YOUR NUMBER ";A
250 IFA=1THEN:POKE53280,6:PRINT"THANK YOU. NUMBERS ARE FUN!":END
260 IFA<1THENGOTO120
270 IFA<>INT(A)THEN120
280 X=3:IFA<4ANDA>0THEN50
290 IFA/2<>INT(A/2)THENPOKE53280,00:POKE53265,11:B=SQR(A):GOTO1
300 PRINT:PRINT"ALL EVEN NUMBERS ARE DIVISABLE BY TWO.":GOTO220
310 REM BY MIKE PHEBUS OF LAFAYTTE IN
320 REM THIS PROGRAM WILL WORK WITH
330 REM NUMBERS FROM 2 TO 99,999,999.