Friday, November 15, 2002

Here is what a java networking program looks like, in case you were wondering.

// Matt Komanecky
// at.java ASCII Text Generator

import java.io.*;

public class at
{
public static void main(String[] args) throws IOException
{

File outputFile = new File("generator.txt");
FileOutputStream out = new FileOutputStream(outputFile);
int c; /* ASCII characters run from char 33 to char 126 */

// int min = 104;
// int max = 126;

/* Begin with the 33 ASCII character (the first for loop), then print out 72
sorted ascending ASCII characters (the second for loop), a line feed, and
a carraige return.
Repeat this process until the 55th ASCII charater.
*/
for (int i = 33; i < 56; i++ )
{

c = i;

for ( int j = 0; j < 72; j++)
{
out.write(c);
c++;
}



out.write(10); // ASCII Line feed character
out.write(13); // ASCII carraige return character

}

out.close();

// Display message to screen
System.out.println("Program finished. The file generator.txt is now available.");
}
}

No comments:

Castoreum

Animal scent markings are notorious for smelling terrible. But castoreum is different. It has a musky smell that some people describe as van...