Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,19 @@
|
|||
function execute
|
||||
# If the list is empty, don't do anything.
|
||||
test (count $argv) -ge 2; or return
|
||||
# If the list has only one element, return it
|
||||
if test (count $argv) -eq 2
|
||||
echo $argv[2]
|
||||
return
|
||||
end
|
||||
# Rotate prisoners
|
||||
for i in (seq 2 $argv[1])
|
||||
set argv $argv[1 3..-1 2]
|
||||
end
|
||||
# Mention killed prisoner
|
||||
echo $argv[2]
|
||||
# Kill rest recursively
|
||||
execute $argv[1 3..-1]
|
||||
end
|
||||
|
||||
echo Prisoner (execute 3 (seq 0 40))[-1] survived.
|
||||
|
|
@ -0,0 +1 @@
|
|||
echo Prisoners (execute 3 (seq 0 40))[-3..-1] survived.
|
||||
|
|
@ -0,0 +1 @@
|
|||
echo Prisoner (execute 2 Joe Jack William Averell Rantanplan)[-1] survived.
|
||||
Loading…
Add table
Add a link
Reference in a new issue