β Hey I am a beginner coder and lf some tipps to write clean code.
I try to build a Chess. But my question is it's clean code? or how to change it that u can read it easyer and any Idea how I can build the next step I need the game peace(german: Spielfiguren) And I only learn the basics of loops and Arrays. I am not sure if i try to build a array... ty for all hints/advicesππ
6 Replies
that isn't really enough code/context for us to help much. Can you do what that code does in a smaller amount of code? yes, but you should probably have a model of a chess board and depending on how you make your model might change how you do this code. For example you may want to override the
ToString
method on a CheckersBoard
so you just call myCheckerBoard.ToString()
-----
also, rather than using coordinates, imo it is much more user friendly to use arrow keys
to select the chess piece and move
for example...here is an example of a console checkers game, and you use the arrow keys to move the
[ ]
cursor around
rather than having to type "A3" or "D5"
If you would like a link to that checkers example just ask π
there is the same content from the screenshot as text
----
in terms of your code, there are a bunch of ways to write it. here is another:
awwww awesome
I try to build this first
holy this look 1000 times better :0
uhhhh it's possibile if u push the arrows u can change the [ ] awww ok interesting. Now I need to learn how I can use this cause I don't know how I can programm if I push right curse jump to the right but first I build this
How this thing is called maybe A prototype?
as mentioned if you want examples of using arrow keys in the console just ask. i have lots of examples
Yeah first I build this output and then I program I think it called functions ???