Ask coding questions
Does anyone know a more efficient way to do my movement?
Yes, very very much more efficient.
first, you have an array:
char[][] pos = { {' ',' ',' '}, {' ','#',' '}, {' ','#',' '}, };
and then you can just draw it with loops instead of trying to do every single case (this scales exponentially!!!!!!)
@Coder100 Idk man, his method is O(1), whereas yours is O(n²) for a square board. Might wanna rethink your algorithm a little.
/s
alright finea flat array @SixBeeps
@Coder100 Uh, could you possibly explain in a little more detail?
foreach (char[] arr in pos) { foreach(char c in arr) { Console.Write(c); } Console.WriteLine(); }
@JacobMcPherson1
@Coder100 Thanks
np @JacobMcPherson1
Yes, very very much more efficient.
first, you have an array:
and then you can just draw it with loops instead of trying to do every single case (this scales exponentially!!!!!!)
@Coder100 Idk man, his method is O(1), whereas yours is O(n²) for a square board. Might wanna rethink your algorithm a little.
/s
alright fine
a flat array @SixBeeps
@Coder100 Uh, could you possibly explain in a little more detail?
@JacobMcPherson1
@Coder100 Thanks
np @JacobMcPherson1