Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
2

How can I make letter by letter output show in Java?

ZacPlayz
ZacPlayz

I want to make letter by letter output in my game "The War" to make it more nice and fancy, since I am considered a "beginner" in my coding lessons, but I do some self-taught, and so that's why I'm asking... :P so that I can gain some self-taught knowledge for my game. Please write in the comments what commands I should use, and please write the commands with the System.out.println(""); so that I can learn to use the command. Whoever answered me first and likes this post will get 5 cycles for the answer and a like on the comment itself, overall 6 cycles!! So be quick!! :P

3 years ago
You are viewing a single comment. View All
3
SixBeeps
SixBeeps

@ZacPlayz
No, you're supposed to call my method instead of using System.out.println for putting things to the screen.
Use this instead:

import java.lang.*; public class Main { public static void main(String[] args) throws InterruptedException { RollText("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); } public static void RollText(String msg) throws InterruptedException { for(int i = 0; i < msg.length(); i++) { System.out.print(msg.charAt(i)); Thread.sleep(50); } } }
3 years ago