May 18th, 2004

Mega Man Party!

(no subject)

import tio.*;
import java.util.*;

class Birth2 {

public static void main(String[] args) {
Random random = initializePeople(args);
int trueTrials, numTrials, numSharing, maxPeople;
trueTrials = 0;
System.out.println("What is maxpeople:");
maxPeople = Console.in.readInt();
System.out.println("What is numSharing:");
numSharing = Console.in.readInt();
System.out.println("What is numTrials:");
numTrials = Console.in.readInt();
//trial(maxPeople, args);
System.out.println();
System.out.println( "That was hella rockin!");

for (int i = 1; i <= numTrials; i++) //this runs the trials
{
trueTrials = (trial(maxPeople, args, numSharing)) + trueTrials;
}

}



static int trial(int maxPeople, String[] args, int numSharing)
{
Random random = initializePeople(args);
int[] theYear = new int[365];
for(int mp = 0; mp < maxPeople; mp++)
{
int oneGuy = random.nextInt(365);
theYear[oneGuy] = theYear[oneGuy] + 1;
}

for(int i = 0; i < theYear.length; i++)
{
System.out.print( theYear[i]);
if (theYear[i] >= numSharing)
{
System.out.println();
System.out.println("greater than numSharing!");
return 1;
}
}

for(int i = 0; i < theYear.length; i++)
{
System.out.print( theYear[i]);
if (theYear[i] > 1)
{
System.out.println();
}
}
System.out.println("end of trial. fail.");
return 0;
}






static Random initializePeople(String[] args) {
if (args.length == 0) {
return new Random();
}
else {
return new Random(Integer.parseInt(args[0]));
}
}
}
dan

Slightly less annoying than the previous post

(x) I HAVE BEEN DRUNK
(x) I HAVE SMOKED POT
(x) I HAVE KISSED A MEMBER OF THE OPPOSITE SEX
(x) I HAVE KISSED A MEMBER OF THE SAME SEX
( ) I CRASHED A FRIEND'S CAR
(x) I HAVE BEEN TO JAPAN
(x) I RODE IN A TAXI
(x) I HAVE BEEN IN LOVE
(x) I HAD SEX
(x) I HAVE HAD SEX IN PUBLIC
(x) I HAVE BEEN DUMPED
(x) I SHOPLIFTED
( ) I HAVE BEEN FIRED
(x) I BEEN IN A FIST FIGHT
(x) I HAD A THREESOME
(x) I HAVE SNUCK OUT OF MY PARENT'S HOUSE
(x) I HAVE BEEN TIED UP (SEXUALLY)
(x) I HAVE BEEN TIED UP (NON-SEXUALLY)
(x) I HAVE BEEN CAUGHT MASTURBATING
(x) I PISSED ON MYSELF
(x) I HAD SEX WITH A MEMBER OF THE SAME SEX
(x) I HAD SEX WITH A MEMBER OF THE OPPOSITE SEX
( ) I HAVE BEEN ARRESTED
( ) I MADE OUT WITH A STRANGER
(x) I STOLE SOMETHING FROM MY JOB [it's not like I havent also used my own money for them...]
( ) I CELEBRATED NEW YEARS IN TIME SQUARE
(x) I WENT ON A BLIND DATE
(x) I LIED TO A FRIEND
( ) I HAD A CRUSH ON A TEACHER
( ) I CELEBRATED MARDI-GRAS IN NEW ORLEANS
(x) I HAVE TRAVELED TO EUROPE
(x) I SKIPPED SCHOOL
(x) I SLEPT WITH A CO-WORKER
(x) I HAVE WANTED TO SLEEP WITH A CO-WORKER
(x) I HAVE BEEN FISTED AND/OR HAVE FISTED SOMEONE
(x) I HAVE THROWN UP IN A BAR
( ) I HAVE BEEN TO JAMAICA
(x) I REJECTED SOMEONE WHO ASKED ME OUT
(x) I BOUGHT A SEX TOY FOR MYSELF
(x) I HAVE USED DRUGS
(x) I LIKE CATS
that's strange I thought there were more things here that I hadn't done. that's lame. I added the last thing too.

please comment because then my mail program will talk at me when I get comments.
  • Current Music
    nothing
Mega Man Party!

(no subject)

you know what was awesome?
the jordan homework hotline.
you know what was even better?
When I figured out how to hack it! ahahahahahah that toally rocked!

Stefan!
  • Current Mood
    sick sick
Mega Man Party!

(no subject)

I did hella hair matinence today. All over my body. It'll be cool by this weekend I imagine.
My nuttsack is hella smoth now, and so is my shaft!
Shirt day

(no subject)

Parsing Numeric Command-Line Arguments

If your program needs to support a numeric command-line argument, it must convert a String argument that represents a number, such as "34", to a number. Here's a code snippet that converts a command-line argument to an int:
int firstArg;
if (args.length > 0)
firstArg = Integer.parseInt(args[0]);

parseInt throws a NumberFormatException if the format of args[0] isn't valid. All of the Number classes--Integer, Float, Double, and so on--have parseXXX methods that convert a String representing a number to an object of their type.

http://java.sun.com/docs/books/tutorial/essential/attributes/cmdLineArgs.html
  • Current Music
    nothing