AdiZ
✅ Advent of Code Day 1 - Issue with Chars
For this problem, you essentially have to find the first and last digit contained in each line, so for a line
271lonepxp2flbmbz
the first digit would be 2
and the last digit 2
as well. Put 'em together, you get 22
. Now you have to find that value for each of the 1000 lines provided and add them all together.
This is my code. However, I just keep getting an Index Out of Range
error on the line that says
int firstNumber = nums[0];
and I just don't get why. I originally had the code a lot more condensed but I expanded it to debug and that appears to be where the issue is. Naturally I initially thought that nothing was being added to the array, but so far I can't figure out why that would be. I'm going to go and Console.WriteLine
nums
right now to see if it actually contains anything, but either way I'd appreciate it if someone could help me see what I did wrong here.53 replies
✅ Calculating Remaining Processing Time?
Let's say I'm running a bunch of loops and searching long arrays - essentially some task that will take, let's say, 10 seconds on average. How can I calculate the amount of time remaining to complete the calculation to show to the user of the app?
12 replies
In VSCode, SDK not Recognized on ChromeOS
Hi. I just installed the .NET SDK and the Runtime by following the instructions for Ubuntu on the Microsoft Docs website. This is what I get when I run
dotnet --info
in the Linux terminal:
And this is the error I get when I launch VSCode (or try to create a new C# project):
Does anyone know how to fix this?7 replies
✅ Quick - Unity "using" directive
Really quick question guys, when trying to use methods from other scripts in Unity, let's say the other script's name (and therefore the other script's class name) is
Decoders
, do I do using Decoders;
or using static Decoders;
?8 replies
✅ .Split() Returning Spaces Between Words in String[]
Hi. I have an string array
string[] strArr
of words in format [word1, word2]
and so on - just a basic format.. I got that by performing .Split()
on another string, let's say string x
. x
was in format
and so on, for 30,000 lines. Now that I've converted this all to an array, how can I print the array such that the Console output would be ["word1", "word2"] etc.? I want to initialize strArr instead of performing .Split()
everytime my app starts.91 replies