Count occurrences of a substring: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add Draco) |
(RPL: add section) |
||
Line 2,927: | Line 2,927: | ||
6 |
6 |
||
</pre> |
</pre> |
||
=={{header|RPL}}== |
|||
{{works with|Halcyon Calc|4.2.7}} |
|||
≪ DUP2 → s t |
|||
≪ SIZE SWAP SIZE |
|||
'''IF''' DUP2 * LAST ≤ AND '''THEN''' |
|||
SWAP - 1 + 0 R→C |
|||
'''WHILE''' DUP RE 0 > '''REPEAT''' |
|||
s OVER RE DUP t SIZE + 1 - SUB |
|||
'''IF''' t == '''THEN''' t SIZE -1 R→C - '''ELSE''' (1,0) - '''END''' |
|||
'''END''' |
|||
IM |
|||
'''ELSE''' DROP2 -1 '''END''' |
|||
≫ ≫ ''''CNTSUB'''' STO |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |