本文整理汇总了C#中Nodo.Select方法的典型用法代码示例。如果您正苦于以下问题:C# Nodo.Select方法的具体用法?C# Nodo.Select怎么用?C# Nodo.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nodo
的用法示例。
在下文中一共展示了Nodo.Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Mover
public static void Mover(Video[] video, Nodo[] lista) {
int act = 0, prev = -1, mov = 1;
Video aux = new Video();
bool[] ordenado = lista.Select(x => false).ToArray();
Console.WriteLine();
while(mov < lista.Length) {
Console.WriteLine(act.ToString() + " " + prev.ToString());
if(lista[act].origen == act) {
ordenado[act] = true;
act = Siguiente(ordenado);
} else {
if(prev == -1) {
aux = video[act];
video[act] = video[lista[act].origen];
ordenado[act] = true;
prev = act;
act = lista[act].origen;
} else if(lista[act].origen != prev) {
video[act] = video[lista[act].origen];
ordenado[act] = true;
act = lista[act].origen;
} else {
video[act] = aux;
ordenado[act] = true;
prev = -1;
act = Siguiente(ordenado);
}
}
mov++;
Console.WriteLine(act.ToString() + " " + prev.ToString());
Console.WriteLine("Video: " + video.Select(x => x.ToString())
.Aggregate((x, xs) => x + " " + xs));
}
Console.WriteLine(ordenado.Select(x => x.ToString()).Aggregate((x, xs) => x + " " + xs));
if(prev != -1) {
video[act] = aux;
}
}