Jiraknight3
Jiraknight3
CC#
Created by Jiraknight3 on 4/6/2025 in #help
Discrepancy between the console result and the expected result.
Thank you again. 😅 I will see if that help me tonight. Thanks again.
7 replies
CC#
Created by Jiraknight3 on 4/6/2025 in #help
Discrepancy between the console result and the expected result.
I found a solution for this. (This is because since there was no "exception error", it did not allow me to use the "arrow" but I found a solution. However, regarding the loops, is there a way to use the debogage for loop N°1, 2... etc.? (to check, for example, the value of x at the end of 3 loops, before the 4th for example? )
7 replies
CC#
Created by Jiraknight3 on 4/6/2025 in #help
Discrepancy between the console result and the expected result.
Sorry, I did not specify. Basically, in the text where there is data: Line 1: the size of the table. Line 2: The start coordinates of the character. Line 3: The maximum number of moves possible for the character. Line 4: The number of gold coins on the board. Line 5 to 5+(number in line 4): The coordinates of each gold coin. And the incoming text is the set of coordinates at each move of the hero, to grab gold coins. If the character sees a gold coin around him (north, northeast, etc...), he heads for it. If there is 0, it detects the coins that are in the 8 cardinal directions relative to it and advances one step towards the one where there are most of them. And if there are several rooms around him (for example, one to the north, and another to the south), he detects the number of rooms that there are in the North and South, and goes towards the one where there is more. (The order of priority is: North/Northeast/East/Southeast/- South/South West/West/North West). And at the end, the number of pieces collected.
7 replies
CC#
Created by Jiraknight3 on 3/30/2025 in #help
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
It worked ; that help me to understand where was the problem. Thank you very much.
33 replies
CC#
Created by Jiraknight3 on 3/30/2025 in #help
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
I had never heard of the debugger. Thank you very much, I will see it and hope that it helps me! Thank you very much! ❤️
33 replies
CC#
Created by Jiraknight3 on 3/30/2025 in #help
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
AH ! The error happened in line 81, but the core of the error is earlier ?
33 replies
CC#
Created by Jiraknight3 on 3/30/2025 in #help
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
Line 81'''if (XArrayCoordoninateCoins[numberGoldPiece] == x YArrayCoordoninateCoins[numberGoldPiece] == y) { Console.WriteLine("That exists."); } else { }''' Yes ; but right there with'''XArrayCoordoninateCoins[numberGoldPiece] == x YArrayCoordoninateCoins[numberGoldPiece] == y)''' I try to check each value contained in both array. Isn’t that how we do it?
33 replies
CC#
Created by Jiraknight3 on 3/30/2025 in #help
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
thanks.
33 replies
CC#
Created by Jiraknight3 on 3/30/2025 in #help
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
Where can I see this ? (Sorry, I'm very beginner with Visual Studio and C# in general). I'm not sure to understand ; where you see this ? (wich part of the code/number of line ?).
33 replies