To all Java Text-Based game makers!
Hello! I am planning to make a text-based game this year in the Ludum Dare, and I realized how lazy I am…so lazy that I find it hard to keep typing “System.out.println(“walri rock!”)”, so I thought of this:
In the beginning of your main class, make 2 methods, a “say” method and a “take” method, these will work as the cin and count in C++, the say method would be the following:
public static void say(String message){
System.out.println(say);
}
And make the take method the following:
public static void take(String takeTo){
Scanner sc = new Scanner(System.in);
takeTo = sc.nextLine();
}
And TA-DA!!! I am stating now though, that I have NOT tested the take method…Anyhow, you would use the code like this:
//This is a simple intake/output thingy majogger
String input = "";
say("Say something!");
take(input);
say("You said: " + input + "!");
Fell free to use any of this code, and Good Luck to all!!!!!