September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -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.

View file

@ -0,0 +1 @@
echo Prisoners (execute 3 (seq 0 40))[-3..-1] survived.

View file

@ -0,0 +1 @@
echo Prisoner (execute 2 Joe Jack William Averell Rantanplan)[-1] survived.