it’s raining outside
Explore posts from serverscode builds but hangs while running
code: https://paste.pythondiscord.com/KTVQ
when i build it in release, everything works fine. but when i run in release, it just hangs and does nothing, even though all i'm doing is this:
203 replies
"Object reference not set to an instance of an object"
code: https://github.com/axololly/chess/tree/main/Board.cs#L1073
not sure why this is happening. i changed the
Board
from a class
to a struct
so it's no longer heap allocated (used in an engine, so these things matter) and now it's raising weird errors like this59 replies
✅ how do i publish my .NET project?
so i made this chess thingy (do check it out, i spent a month on it) and I want to publish it online so i can primarily use it in my other projects.
how exactly do i go about this? i'm using vscode btw - vs runs like shit and doesn't correct my code properly. command line would be preferred.
74 replies
✅ impossible error
so i'm using a
Stack<Move>
for my chess board's move history. it somehow managed to raise an out-of-bounds error with the line being directly correlated to this line:
i have zero fucking clue what this is caused by. here's the rest of my code: https://mystb.in/4b14af70b18dc60777 (line 225-250)18 replies
null check raising errors
i come from python and my first interpretation was that they can work like decorators, but that's clearly not the case.
my question is how do i modify class data with an attribute?
like how in python you can decorate a class like this:
how would i do this in C#?
112 replies
✅ while loop on cpu
is there a type of while loop that doesn't hammer the cpu with checks? like when i type a character, THATS when it updates, instead of as many times as it possibly can, because it slows down my pc and i dont get these issues with other CLI tools (eg. python repl)
37 replies
✅ when programming a CLI in C#...
1. how can i open my own CLI window like how starting the python repl works?
2. how can i take input with a string predecessor? i want to do
>>> ...
but there isnt a way to get an input on the same line as text, as far as ive seen23 replies
how do i rotate part of a multidimensional matrix?
i have a 2D matrix representing a rubik's cube (figured that a 3D matrix would be both quite difficult and a massive overhead) and i want to rotate just one of the inner 1D matrices to rotate just one face of the side. how would i do this?
45 replies
✅ how do i override built-in methods?
i come from python where you can override methods in a class to work a certain way. for example, for use in the
==
operator, you can override a class to modify the behaviour of the __eq__
method which checks if two objects are equal.
if i wanted to do an XOR on a class that holds an internal value, how can i override it so it works on the internal value instead of the class itself?20 replies