Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
12
Task/Josephus-problem/Oforth/josephus-problem.oforth
Normal file
12
Task/Josephus-problem/Oforth/josephus-problem.oforth
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
: josephus(n, k)
|
||||
| prisoners killed i |
|
||||
n seq asListBuffer ->prisoners
|
||||
ListBuffer newSize(n) ->killed
|
||||
|
||||
0 n 1- loop: i [
|
||||
k 1- + prisoners size mod dup 1+ prisoners removeAt
|
||||
killed add
|
||||
] drop
|
||||
|
||||
System.Out "Killed : " << killed << "\nSurvivor : " << prisoners << cr
|
||||
;
|
||||
Loading…
Add table
Add a link
Reference in a new issue