Find common directory path: Difference between revisions

Content added Content deleted
m (syntax highlighting fixup automation)
(Added Quackery.)
Line 2,268: Line 2,268:
'/home/user1/tmp'
'/home/user1/tmp'
>>> </syntaxhighlight>
>>> </syntaxhighlight>

=={{header|Quackery}}==

<syntaxhighlight lang="Quackery"> [ over size
over size min
dup dip unrot times
[ over i^ peek
over i^ peek
!= if
[ rot drop
i^ unrot
conclude ] ]
2drop ] is equalto ( $ $ --> n )

[ 0 unrot over size
times
[ over i peek
over = if
[ rot drop
i unrot
conclude ] ]
2drop ] is lastof ( $ c --> n )

[ swap behead swap
witheach
[ over equalto
split drop ]
dup rot lastof
split drop ] is cdp ( [ c --> n )

$ '/home/user1/tmp/coverage/test
/home/user1/tmp/covert/operator
/home/user1/tmp/coven/members' nest$
char / cdp echo$</syntaxhighlight>

{{out}}

<pre>/home/user1/tmp</pre>


=={{header|R}}==
=={{header|R}}==