Can Some Compile Something For Me...?

I need someone to compile something for me as my sysadmin still has not installed the JDK on the UNIX machine.  Anyone who has the JDK either email me here:

aslan@yeat.ml.org

Or leave you answer as an answer on here.  Also can someone improve on this game I have, the one that needs to be compiled?  Like make it keep score, choose which di you want to keep and roll the other one; also turn it into Java 1.1?  Here is the code below:

import java.awt.*;
import java.awt.event.*;

/*
 *
 * This script was coded by Michael Lauzon, (C) 1998.
 * And not to be used without the express written
 * consent of its author: ce940@freenet.toronto.on.ca
 *
 */

public class Craps extends java.applet.Applet implements ActionListener {
  Die die1 = new Die();
  Die die2 = new Die();
  int wins = 0;
  int losses = 0;
  int point = 0;
  final String WINNER = "Winner!";
  final String LOSER = "Craps!";
  String resultText = "";
  Button rollButton = new Button("Roll Dice");

  public void init() {
    setBackground(Color.green);
    rollButton.addActionListener(this);
    add(rollButton);
  }

  public void paint(Graphics screen) {
    die1.drawDie(screen, 5, 50);
    die2.drawDie(screen, 175, 50);
    screen.setColor(Color.black);
    Font f = new Font("Times New Roman", Font.BOLD, 15);
    screen.setFont(f);
    if (point != 0) {
      screen.drawString(point + " wins and 7 craps out.", 5, 200);
    } else {
      screen.drawString("7 or 11 win; 2, 3, or 12 crap out.", 5, 200);
    }
    screen.drawString("Number of wins: " + wins, 5, 220);
    screen.drawString("Number of losses: " + losses, 5, 240);
    if (resultText != "") {
      f = new Font("Times New Roman", Font.BOLD, 30);
      screen.setFont(f);
      screen.drawString(resultText, 85, 110);
      resultText = "";
    }
  }

  public void actionPerformed(ActionEvent event) {
    die1.rollValue(6);
    die2.rollValue(6);
    checkResult(die1, die2);
    repaint();
  }

  public void checkResult(Die d1, Die d2) {
    if (point == 0) {
      point = d1.value + d2.value;
      if ( (point == 7) | (point == 11) ) {
        resultText = WINNER;
      }
      if ( (point < 4) | (point == 12) ) {
        resultText = LOSER;
      } else {
        if (d1.value + d2.value == point) {
          resultText = WINNER;
        }
        if (d1.value + d2.value == 7) {
          resultText = LOSER;
        }
      }
      if (resultText == WINNER) {
        wins++;
        point = 0;
      }
      if (resultText == LOSER) {
        losses++;
        point = 0;
      }
    }
  }
}


Thanks for any help you can give me.
CyberMageAsked:
Who is Participating?
 
fontaineConnect With a Mentor Commented:
No need to wait for your sysadmin waking up ;-).
Go here, this is an on-line compiling service:

http://www.innovation.ch/java/java_compile.html
0
 
java_kevinCommented:
I think yours is similar or same as
http://homer.pacific.net.sg/~thheugene/craps.html

maybe u can just obtain the class form here?
0
 
java_kevinCommented:
I think yours is similar or same as
http://homer.pacific.net.sg/~thheugene/craps.html

maybe u can just obtain the class form here?

Otherwise, u need to include the source for Die class too. Else, we have to make those lines into comments
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
CyberMageAuthor Commented:
Well, if it is the same...God only knows why; is there anyway you  can make it keep score and stuff (make it more flavourable)?
0
 
java_kevinCommented:
Maybe someone infringed the copyright laws... hehe

I can make it keep scores. They will be kept according to your requirements. And the results can be shown in some special/nice way. Bars, graph...etc

But to compile them properly, I need the Die class too. Else there'll be compile errors. Mind sending them to determined@mariah-carey.com ? The .java

Pls send them ASAP to compile. If after compilation, u have any problems, free to ask mi.

Although I started applet only this yr, I'll try to help.

Anyway, if u want, u can down JDK from www.javasoft.com and kawa (IDE for java) www.tek-tools.com . Pay attention to kawa's compatibility for jdk's version.
0
 
java_kevinCommented:
I noticed that you didn't import java.applet.Applet.

i use jdk 1.1.5

You need to send me the .java of Die class ASAP to get everything right. I noticed that you have some syntax errors.
How long have u been doing java?
0
 
CyberMageAuthor Commented:
I haven't been doing Java long, and I can't use the JDK...as the sysadmin has yet to install it; once he figures out how.  I'll send you the Craps.java as soon as I can.
0
 
evijayCommented:
No.

0
 
java_kevinCommented:
How? Found the craps and die.java?
Been a long time already...
0
 
CyberMageAuthor Commented:
Craps.java is the whole Java program, there is nothing else to
it...WYSIWYG.
0
 
java_kevinCommented:
Sorry, I actually mean the die.java...
I didn't receive the die.java yet...

If no die.java, errors will be many...maybe i try to do a basic die.java to compile and see any errors. try to send die.java ASAP. thanks.

Any errors, i solve then after get .class, will make those additional lines into comments so u can see.
0
 
vijayakumarCommented:
Can you attach Die.java for me so that i can compile for you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.