Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Josephus-problem/REBOL/josephus-problem-1.rebol
Normal file
13
Task/Josephus-problem/REBOL/josephus-problem-1.rebol
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
Rebol []
|
||||
|
||||
execute: func [death-list [block!] kill [integer!]] [
|
||||
assert [not empty? death-list]
|
||||
until [
|
||||
loop kill - 1 [append death-list take death-list]
|
||||
(1 == length? remove death-list)
|
||||
]
|
||||
]
|
||||
|
||||
prisoner: [] for n 0 40 1 [append prisoner n]
|
||||
execute prisoner 3
|
||||
print ["Prisoner" prisoner "survived"]
|
||||
3
Task/Josephus-problem/REBOL/josephus-problem-2.rebol
Normal file
3
Task/Josephus-problem/REBOL/josephus-problem-2.rebol
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for-the-chop: [Joe Jack William Averell Rantanplan]
|
||||
execute for-the-chop 2
|
||||
print [for-the-chop "survived"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue