Using for loops to create a "bridge" made out of hyphens
I need to create an algorithm that will create "a man on a bridge" in which the man is denoted by the * (asterisk), and the bridge width is denoted by - (hyphens).
I have no problem creating in creating the man moving such that :
The code for above is:
Give me some tips (not code) in the right direction please--I'm still slightly confused.
public class ForLoopsTest
public static void main(String args)
String r ="";
final int WIDTH = 4;
for (int i = 1; i <= WIDTH; i++)
r = r + "*";