Hejsa
Har downloadet al kode til et Poker som man kan lægge online, men jeg fatter
ikke en brik af den s**** Java (altså, generelt, ikke kun denne fil)
Hvad skal man have på sin html side for at køre et poker spil f.eks. ? Skal
man "kalde" filen med Java ??
mvh, rune andreasen
den ene fil er "vedlagt" (poker-java) - WOL serveren/nyheds-gruppen kunne
ikke medtage en vedhæftelse:
--------------
import java.awt.*;
import java.applet.*;
import java.net.*;
import java.lang.*;
public class Poker extends Applet
{
boolean deck[];
String v[]={"2","3","4","5","6","7","8","9","t","j","q","k","a"};
String s[]={"c","d","h","s"};
String mes[]={"","Pair","Two Pair","Three of a Kind","Four of a
Kind","Full House",
"Flush","Straight","Straight Flush","Royal Flush","You
Lose"};
int curMes=0;
int mesLoc[]={0,225,200,160,168,188,215,202,167,182,197};
int payOut[]={0,1,2,3,25,8,5,4,50,250,0};
Color bg;
Color surface;
int Height=300;
int Width=500;
int SurfWidth=300;
int SurfHeight=106;
Image Cards[];
int hand[];
int value[];
int suit[];
int scratch[];
Button reDeal;
Button Quitit;
Button Card1;
Button Card2;
Button Card3;
Button Card4;
Button Card5;
Choice money;
boolean cardState[];
boolean firstDeal=false;
boolean drawable=false;
boolean youLose=false;
Font boldFont;
Font normalFont;
long score=100;
long highScore=10;
URL link=null;
String backDoc="
http://www.access.digex.net/~kkessler/index.html";
public void init()
{
int i,r,g,b;
String param;
param=getParameter("height");
if (param != null)
Height=Integer.valueOf(param).intValue();
param=getParameter("width");
if (param!=null)
Width=Integer.valueOf(param).intValue();
r=g=0;
b=255;
param=getParameter("bgcolor");
if (param!=null)
if(param.charAt(0)=='#')
{
r=readColorValue(param,1,3);
g=readColorValue(param,3,5);
b=readColorValue(param,5,7);
}
bg = new Color(r,g,b);
r=b=0;
g=255;
param=getParameter("bgcolor");
if (param!=null)
if(param.charAt(0)=='#')
{
r=readColorValue(param,1,3);
g=readColorValue(param,3,5);
b=readColorValue(param,5,7);
}
surface = new Color(r,g,b);
param=getParameter("highscore");
if(param!=null)
{
highScore=Long.valueOf(param).longValue();
}
param=getParameter("backlink");
if(param!=null)
{
backDoc=param;
}
deck=new boolean[52];
for (i=0;i<52;i++)
deck[i]=false;
hand=new int[5];
cardState=new boolean[5];
value=new int[5];
suit=new int[5];
scratch=new int[5];
Cards=new Image[52];
for (i=0;i<5;i++)
{
hand[i]=0;
cardState[i]=false;
}
setLayout(null);
boldFont=new Font("Helvetica",Font.BOLD,24);
normalFont=new Font("Helvetica",Font.PLAIN,12);
setFont(normalFont);
add(Card1=new Button());
add(Card2=new Button());
add(Card3=new Button());
add(Card4=new Button());
add(Card5=new Button());
Card1.reshape((Height-SurfHeight)/2+12,(Width-SurfWidth)/2 + 54,50,20);
Card2.reshape((Height-SurfHeight)/2+70,(Width-SurfWidth)/2 + 54,50,20);
Card3.reshape((Height-SurfHeight)/2+128,(Width-SurfWidth)/2 + 54,50,20);
Card4.reshape((Height-SurfHeight)/2+186,(Width-SurfWidth)/2 + 54,50,20);
Card5.reshape((Height-SurfHeight)/2+244,(Width-SurfWidth)/2 + 54,50,20);
add(money=new Choice());
money.addItem("$ 1");
money.addItem("$ 2");
money.addItem("$ 3");
money.addItem("$ 4");
money.addItem("$ 5");
money.reshape(385,230,50,120);
setFont(boldFont);
add(reDeal=new Button());
add(Quitit=new Button());
reDeal.setLabel("DEAL");
reDeal.reshape((Height-SurfHeight)/2+75,(Width-SurfWi