8-Bit Software Online Conversion

Palindromic Numbers 2 - Listing

10REM PalinCu 20REM Program to find Palindromic num bers with Palindromic squares/cubes 30REM (C) Daniel G. Shimmin 1994 40REM For all BBC BASIC systems 50* 60MODE6 70TIME=0 80I%=10: REM first number 90REPEAT: REM main search loop 100I%=I%+1 110IF FNcheckpal(I%) THEN IF FNcheckpa l(I%*I%) THEN PRINT I%;" x ";I%;" = ";I% *I% 120IF FNcheckpal(I%) THEN IF FNcheckpa l(I%*I%*I%) THEN PRINT I%;" x ";I%;" x " ;I%;" = ";I%*I%*I% 130UNTIL INKEY(-99) 140END 150* 160DEFFNcheckpal(B%) 170A$=STR$ B% 180C%=LEN A$ 190IF FNleft=FNright THEN =TRUE ELSE = FALSE 200* 210DEFFNleft 220=LEFT$(A$,C%/2) 230* 240DEFFNright 250B$="" 260FOR D%=1 TO C%/2 270B$=B$+MID$(A$,C%-D%+1,1) 280NEXT 290=LEFT$(B$,C%/2) 300*