Add tags

Add tags to the following comment

とりあえず。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function lot($n, $m) {
  if ($n -ge $m) {
    $randomgenerator = New-Object Random
    $source = 1 .. $n
    $limit = $n
    $result = @()
    foreach ($i in 1 .. $m) {
      $limit -=  1
      $ii = $randomgenerator.Next($limit + 1)
      $result += $source[$ii]
      if ($ii -gt 0) {
        $srclow = $source[0 .. ($ii - 1)]
      } else {
        $srclow = @()
      }
      if ($ii -lt $limit) {
        $srchi = $source[($ii + 1) .. $limit]
      } else {
        $srchi = @()
      }
      $source = $srclow + $srchi
    }
  }
  return $result | sort
}

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...