This is supposed to be a field that's filled with dots. I want to add my player to it by changing one of the elements to 'X'.
However, no matter how much I've tried changing, my console keeps spitting out ONLY dots.
I greatly appreciate any help!
#Overwriting a single element of a 2D Array after having it filled with chars
14 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @clear peak! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
do you reprint the matrix after changing the char?
because on screen you don't call felderMalen() again after setting new value
@clear peak
Absolutely beautiful, I've written a new method that prints out the matrix again but instead filling it with dots again, it only fills that specific element.
Is there maybe a way to only have the field printed out once? Filled with dots, except that one element. Just from the back of your head, since that's what I've been trying and I'm curious. This way works too tho. Thank you so much
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Im not sure I got you right. Are you trying to create a console game, that draws "world" with dots and player is X (for example)?
I guess for redrawing the world in same area (without drawing below previous print) you should use ansi codes, that will do the magic.
I will look into that, thank you so much!
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.