Wednesday, February 18, 2015

Banner java in pgm



Banner.java
import java.awt.Font;

public class Banner
{

    public static void main(String[] args)
{
        String s = args[0];

        StdDraw.setXscale(1.0/22.0, 21.0/22.0);
        StdDraw.setYscale(1.0/22.0, 21.0/22.0);
        Font f = new Font("Arial", Font.BOLD, 60);
        StdDraw.setFont(f);
        StdDraw.setPenColor(StdDraw.WHITE);

        for (double i = 0.0; true; i += 0.01)
       {
            StdDraw.clear(StdDraw.BLACK);
            StdDraw.text((i % 1.0),       0.5, s);
            StdDraw.text((i % 1.0) - 1.0, 0.5, s);
            StdDraw.text((i % 1.0) + 1.0, 0.5, s);
            StdDraw.show(60);
        }

    }
}

No comments:

Post a Comment