Josephus problem: Difference between revisions

Content deleted Content added
Petelomax (talk | contribs)
Updated to work with Nim 1.4: added missing parameter type and replaced ".. <" by "..<".
Line 2,630: Line 2,630:
{{trans|Python}}
{{trans|Python}}


<lang nim>import sequtils, strutils, future
<lang nim>import sequtils, strutils, sugar


proc j(n, k): string =
proc j(n, k: int): string =
var
var
p = toSeq(0 .. < n)
p = toSeq(0 ..< n)
i = 0
i = 0
s = newSeq[int]()
s = newSeq[int]()