Cleaner Code
This commit is contained in:
parent
626e0b6502
commit
e2e7901195
|
@ -64,8 +64,8 @@ namespace day05
|
|||
{
|
||||
for (int i = 0; i < instruc.Ammont; i++)
|
||||
{
|
||||
stacks[instruc.Destination - 1].Add(stacks[instruc.Source - 1].Last());
|
||||
stacks[instruc.Source - 1].RemoveAt(stacks[instruc.Source - 1].Count - 1);
|
||||
stacks[instruc.Destination].Add(stacks[instruc.Source].Last());
|
||||
stacks[instruc.Source].RemoveAt(stacks[instruc.Source].Count - 1);
|
||||
}
|
||||
}
|
||||
// Print Results
|
||||
|
@ -81,8 +81,8 @@ namespace day05
|
|||
public Instruction(int ammont, int source, int destination)
|
||||
{
|
||||
Ammont = ammont;
|
||||
Source = source;
|
||||
Destination = destination;
|
||||
Source = source - 1;
|
||||
Destination = destination - 1;
|
||||
}
|
||||
|
||||
public int Ammont {get;}
|
||||
|
|
Loading…
Reference in a new issue