Palindromic primes: Difference between revisions

m
→‎{{header|REXX}}: changed how to find the maximum palindromic prime.
m (→‎{{header|REXX}}: changed comments.)
m (→‎{{header|REXX}}: changed how to find the maximum palindromic prime.)
Line 450:
if cols>0 then say '───────┼'center("" , 1 + cols*(w+1), '─')
finds= 0; idx= 1 /*define # of palindromic primes & idx.*/
$= /*a list of palindromic primes (so far). */
do j=1 for # hi /*search for palindromic primes. */
if @.j\==reverse(@!.j) then iterate /*NotIs this number a palindromic prime? Then skip. */
if j\==reverse(j) then iterate /*Not a palindromic prime? " " */
finds= finds + 1 /*bump the number of palindromic primes*/
if cols<0 then iterate /*Build the list (to be shown later)? */
$= $ right( commas(@.j), w) /*add a palindromic prime ──► $ list.*/
if finds//cols\==0 then iterate /*have we populated a line of output? */
say center(idx, 7)'│' substr($, 2); $= /*display what we have so far (cols). */