Cleaner Code

This commit is contained in:
Nikurasu 2023-04-11 10:53:45 +02:00
parent 626e0b6502
commit e2e7901195
No known key found for this signature in database

View file

@ -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;}