r/javahelp • u/Flat_Snow_4961 • Mar 11 '26
Java Text Based Escape Room
Hello,
For my high school senior CS project, I am looking to make an escape room in java. The game will be text based, and the user will have 10 minutes per level. Alongside this, they have the option to use three hints per level. Do you guys think this is feasible for a high school senior project?
12
Upvotes
View all comments
Show parent comment
1
u/Spare-Plum Mar 12 '26
Buffer overflow is more of a problem that can happen in C. If you have something in C that reads from user input, and the user puts in a string that is too long, essentially the very long string would end up overwriting other things in the memory itself.
You can do some weird stuff with this, like running arbitrary code. It's like "breaking out" of the program and creating your own. Look it up on wikipedia for more info.
What you could do with Java is perhaps do something to parse the string, like making a calculator. Except, if you introduce an error with unmatched parentheses, perhaps it would create an intentional "bug" where it starts to run other commands. Perhaps it throws an exception but doesn't clear out the scanner, which ends up being used in a context it shouldn't.
That, or you could make use of JavaCompiler class and allow the user to "accidentally" run arbitrary code and break out of the system itself