Search a list: Difference between revisions

Content added Content deleted
m (Fix Perl 6 -> Raku links)
Line 2,640: Line 2,640:
endif
endif
drop</lang>
drop</lang>

Other solution with syntactic sugar for list construction.

<lang Phixmonti>include Utilitys.pmt

0 var acum
0 var p
"Zag" var word

def search
word find var p p
enddef

( "Zig" "Zag" "Wally" "Ronald" "Bush" "Krusty" "Charlie" "Bush" "Boz" "Zag" )

dup print nl nl

search
while
p acum + var acum
word print " located in position " print acum print nl
len p - p 1 + swap slice nip
search
endwhile
</lang>


=={{header|PHP}}==
=={{header|PHP}}==