Vampire number: Difference between revisions
Content added Content deleted
(added RPL) |
m (→{{header|RPL}}: tweaked the code) |
||
Line 3,402: | Line 3,402: | ||
DUP « →STR » MAP ∑LIST STR→ <span style="color:blue">DIGCNT</span> digc ≠ '''THEN''' DROP '''END''' |
DUP « →STR » MAP ∑LIST STR→ <span style="color:blue">DIGCNT</span> digc ≠ '''THEN''' DROP '''END''' |
||
DUP 2 GET 'divs' STO+ |
DUP 2 GET 'divs' STO+ |
||
LIST→ DROP R→C |
|||
'result' STO+ |
'result' STO+ |
||
'''END''' |
'''END''' |
||
Line 3,413: | Line 3,412: | ||
1 PICK3 SIZE '''FOR''' j |
1 PICK3 SIZE '''FOR''' j |
||
" = " + |
" = " + |
||
OVER j GET |
OVER j GET + |
||
"*" + OVER j |
"*" + OVER j 1 + GET + |
||
''' |
2 '''STEP''' NIP |
||
'''ELSE''' DROP2 "Not vampiric" '''END''' |
'''ELSE''' DROP2 "Not vampiric" '''END''' |
||
» '<span style="color:blue">V→STR</span>' STO <span style="color:grey">@ ''( { (d1,d2) } n → "n = d1*d2" )''</span> |
» '<span style="color:blue">V→STR</span>' STO <span style="color:grey">@ ''( { (d1,d2) } n → "n = d1*d2" )''</span> |