AdiZ
AdiZ
CC#
Created by AdiZ on 12/6/2023 in #help
✅ Declaring a Dictionary as a Member Variable
Oops I forgot new()
2 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
Thanks 🙂
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
Onto part two - thank you for all the help and quick responses!
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
I won't fix what's not broken 😂
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
Come to think of it, when I was debugging, it said that nums was null, how did I not realize what that meant 🤦
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
I just don't get why it was crashing on the second word, which so clearly had numbers in it.
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
And it was correct! Amazing.
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
And it ran fine!
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
Changed it to this
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
if(nums.Count == 0)
{
continue;
}
int firstNumber = nums[0];
int lastNumber = nums[^1];
int fullNumber = firstNumber * 10 + lastNumber;
sum += fullNumber;
if(nums.Count == 0)
{
continue;
}
int firstNumber = nums[0];
int lastNumber = nums[^1];
int fullNumber = firstNumber * 10 + lastNumber;
sum += fullNumber;
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
Aha
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
A list of one element.
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
I thought that might have been the issue
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
Oh
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
Wait two secs
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
Then I don't think it would fail on the second line...
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
Right?
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
And Convert.ToInt32() would fail then, not the line that is failing right now.
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
The only conversion happening is on chars that have already been deemed to contain a digit
53 replies
CC#
Created by AdiZ on 12/3/2023 in #help
✅ Advent of Code Day 1 - Issue with Chars
Because I just don't get it
53 replies