Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/String-matching/Phixmonti/string-matching-1.phixmonti
Normal file
11
Task/String-matching/Phixmonti/string-matching-1.phixmonti
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/# Rosetta Code problem: https://rosettacode.org/wiki/String_prepend
|
||||
by Galileo, 11/2022 #/
|
||||
|
||||
include ..\Utilitys.pmt
|
||||
|
||||
"the last thing the man said was the" "the" pstack
|
||||
len var l >ps
|
||||
1 l slice tps == if "Begins with keyword" ? endif
|
||||
0 l - l slice tps == if "Ends with keyword" ? endif
|
||||
tail ps> find dup if "Keyword appears first at " print 1 + print " position" ? else drop endif
|
||||
drop
|
||||
22
Task/String-matching/Phixmonti/string-matching-2.phixmonti
Normal file
22
Task/String-matching/Phixmonti/string-matching-2.phixmonti
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/# Rosetta Code problem: https://rosettacode.org/wiki/String_prepend
|
||||
by Galileo, 11/2022 #/
|
||||
|
||||
include ..\Utilitys.pmt
|
||||
|
||||
"the last thing the man said was the" "the" pstack
|
||||
( ) rot rot >ps
|
||||
|
||||
true while
|
||||
tps find dup >ps
|
||||
if swap tps 0 put swap 32 ps> set true else ps> endif
|
||||
endwhile
|
||||
|
||||
len ps> len nip - 1 + >ps drop
|
||||
|
||||
len for get
|
||||
dup 1 == if "Begins with keyword" ? drop else
|
||||
dup tps == if "Ends with keyword" ? drop else
|
||||
"Locate at position " print ?
|
||||
endif endif
|
||||
endfor
|
||||
ps> drop
|
||||
Loading…
Add table
Add a link
Reference in a new issue