Arch227A/D241/D141
Work in groups of two.
Ask questions to Yoshi (sunp@ucla.edu) or Kostas (kostas@ucla.edu)
Objective:
Write the source code (with comments) for an applet that will display a 256x256 image created through string “.” as shown in the code below. Fill in the c1, c2, and c3 variables using mathematical functions to create interesting patterns (for example c1 may look like: int c1 = (int)(255. * Math.sin(Math.PI/180. * i));. )
import java.applet.*;
import java.awt.*;
public class simple extends Applet{
//*****************************************
public void paint(Graphics g){
for(int i=0; i<255; i++)
for(int j=0; j<255; j++){
int c1 =
int c2 =
int c3 =
g.setColor(new Color(c1, c2, c3));
g.drawString(".", i, j);
}
}
}
Bonus:
Excessive creativity will be kindly appreciated and highly rewarded.
Deadline:
Monday October 30, 2000 12 midnight