2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -0,0 +1,9 @@
|
|||
function order($as,$bs) {
|
||||
if($as -and $bs) {
|
||||
$a, $as = $as
|
||||
$b, $bs = $bs
|
||||
if($a -eq $b) {order $as $bs}
|
||||
else{$a -lt $b}
|
||||
} elseif ($bs) {$true} else {$false}
|
||||
}
|
||||
"$(order @(1,2,1,3,2) @(1,2,0,4,4,0,0,0))"
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
function Test-Order ([int[]]$ReferenceArray, [int[]]$DifferenceArray)
|
||||
{
|
||||
for ($i = 0; $i -lt $ReferenceArray.Count; $i++)
|
||||
{
|
||||
if ($ReferenceArray[$i] -lt $DifferenceArray[$i])
|
||||
{
|
||||
return $true
|
||||
}
|
||||
elseif ($ReferenceArray[$i] -gt $DifferenceArray[$i])
|
||||
{
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
return ($ReferenceArray.Count -lt $DifferenceArray.Count) -or (Compare-Object $ReferenceArray $DifferenceArray) -eq $null
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Test-Order -ReferenceArray 1, 2, 1, 3, 2 -DifferenceArray 1, 2, 0, 4, 4, 0, 0, 0
|
||||
Test-Order -ReferenceArray 1, 2, 1, 3, 2 -DifferenceArray 1, 2, 2, 4, 4, 0, 0, 0
|
||||
Test-Order -ReferenceArray 1, 2, 3 -DifferenceArray 1, 2
|
||||
Test-Order -ReferenceArray 1, 2 -DifferenceArray 1, 2, 3
|
||||
Test-Order -ReferenceArray 1, 2 -DifferenceArray 1, 2
|
||||
Loading…
Add table
Add a link
Reference in a new issue