Ask coding questions

← Back to all posts
Why is this breaking?
ArulMoorthy (0)

I made a 2D ASCII thing and I wanted to experiment with terrain generation. I tried to make a basic system to randomly assign materials, and now the system is broken. Please help bruh. AND YES, I KNOW ABOUT PERLIN NOISE.

Edit: If you look in the code you can see that I have a player icon that isn't showing up either.

MocaCDeveloper (563)

Line 133, you automatically clear the terminal.
So, in this instance, do this:


That way the terminal refreshes the old feed thereafter getting the users input.

ArulMoorthy (0)

@MocaCDeveloper nah this isn't a good method, I don't wanna clear the board before processing the player's input. Plus, there is no advantage to refreshing the old feed before processing the new input.

MocaCDeveloper (563)


You're going to have to try and figure out how to print it after the terminal is cleared then..perhaps returning the value you want to print via the function call, then printing it to the console after the terminal is cleared?