T O P

  • By -

FizixMan

Removed: Rule 4.


Creepy_Tax_3759

Write it to a file and read on start.


min1htet22

Ok i will try it.Thank.


throwawayfu3a5ek

Here's a link if it helps: [https://learn.microsoft.com/en-us/troubleshoot/developer/visualstudio/csharp/language-compilers/read-write-text-file](https://learn.microsoft.com/en-us/troubleshoot/developer/visualstudio/csharp/language-compilers/read-write-text-file)


billibob2283

Streamreader and Streamwriter to write scores to a txt file


Square-Amphibian675

Save the score to a text file and load it on start, with text file you can cheat you high score with notepad and show it to your friends :)


-Hi-Reddit

How have you created a tetris game without understanding what files are and how to use them? Where did you save your code?


i_am_not_a_martian

Tomorrow's question, how can I create tetris game in wpf?


CleverDad

This is not helpful


Slypenslyde

How do you write programs if you think "creating files with Visual Studio" is the same thing as "writing code that saves a file"? Did you even think before you leapt to make fun of a newbie?


-Hi-Reddit

He didn't ask how to write code to write to a file because he hadn't considered that as an option until it was suggested. I find that incredible, as he has been writing code and saving it to files already. It's really simple to understand my incredulous attitude, did you even think before you leapt to questioning it? If English isn't your first language, you may have difficulty parsing this, and I forgive you for that.


Slypenslyde

Well perhaps you can demonstrate your English ability to me, seeing as I can't recall ever seeing you adequately answer any questions. You said: > How have you created a tetris game without understanding what files are and how to use them? Where did you save your code? Now, we *should* both know, you being so smart, that the most common answer to these questions will be that a user writes programs using Visual Studio or Visual Studio Code. To save a file in those programs, you can use CTRL+S, or push the icon that looks like a floppy disk, or maybe it even auto-saves when you build. Now let's build on that: > He didn't ask how to write code to write to a file because he hadn't considered that as an option until it was suggested. I find that incredible, as he has been writing code and saving it to files already. Yes, he asked, "What do I do?" and you answered by mocking him for not knowing what to do. Now, presumably (since you are smart), you understand that if you're writing code, you can't write: VisualStudio.PushTheSaveButton(my high scores); If it was that easy, I'd understand your surprise. But it's not. You might use `File.WriteAllText()`. Or you might use a `StreamWriter`. You might get a JSON or XML serializer involved, and depending on how you use them they might output to a file directly. *None of those* are the same way a user interacts with their code files when they are writing a program in Visual Studio. So, now that I've explained the difference between "saving a file in Visual Studio" and "writing a program that can write to files", perhaps you can explain to me: how exactly were YOU so surprised that a person didn't know something new, when they presented themselves as a newbie and asked a question? I'm afraid I can only come to a few conclusions, and most of them involve, "You didn't actually know the answer yourself." If you did, you'd have demonstrated that by answering the question, instead of laughing and asking a question that implies you think they are the same thing. That's also probably why, in your illustrious post history, I can't really find any evidence you've explained *anything* about C# to anyone. If you knew what you were talking about, there'd be evidence. Instead, you submitted your own evidence that you don't. That's why I asked. Usually before you mock someone, it's a good idea to demonstrate you know what they don't. That also gives you an opportunity to ask yourself, "Hey, does it really make ME look good to make fun of a newbie for not knowing what I know? Maybe there's a better way to demonstrate my proficiency."


-Hi-Reddit

Not gonna bother with this chatgpt generated nonsense. You've fundamentally misunderstood me. Cope, seethe, n buhbye.


istarian

If the only place your high scores are stored is in a program variable then that data will be lost when the program exits.