jeudi 14 janvier 2021

Random Walk of Stars java

I am trying to write a program which will simulate a random walk using do-while loops. You start the path in the middle of the screen at about 40 spaces from the left. One star (*) per line. If it hits the left wall it must go right, if it hits the right wall (an imaginary wall) it must go left. How do I start this after printing the first star 40 spaces out?

    class Main 
{
  public static void main(String[] args) 
  {
    System.out.println("                                        *"); 
    do
    {
    //statements;
    //increments;  
    }while (); 
  }
}



Aucun commentaire:

Enregistrer un commentaire