亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 撲克.java

?? 在網上找的一個java編寫的撲克游戲程序
?? JAVA
字號:
/*
 * Class:        DrawPoker
 * Description:  Java Video Poker Applet.
 * Author:       Frank Maritato
 * Last Updated: 10/9/97
 **/

import java.applet.Applet;
import java.awt.*;
import java.io.BufferedInputStream;

public class DrawPoker extends Applet {
  
  public void init() {

    setLayout(new BorderLayout());
    resize(550,325);
    setBackground(backgroundColor);

    /** Bottom Labels **/
    Panel bottom = new Panel();
    bottom.setLayout(new FlowLayout(FlowLayout.LEFT));

    betLabel = new java.awt.Label("Bet:");
    betLabel.setForeground(Color.white);
    bottom.add(betLabel);

    betField = new java.awt.Label("0",Label.RIGHT);
    betField.setForeground(Color.white);
    bottom.add(betField);

    paidLabel = new java.awt.Label("Player Paid:",Label.RIGHT);
    paidLabel.setForeground(Color.white);
    bottom.add(paidLabel);
    
    paidField = new java.awt.Label("0",Label.RIGHT);
    paidField.setForeground(Color.white);
    bottom.add(paidField);
    
    MoneyLabel = new java.awt.Label("Credits: ");
    MoneyLabel.setForeground(Color.white);
    bottom.add(MoneyLabel);
    
    MoneyField = new java.awt.Label("0",Label.RIGHT);
    MoneyField.setForeground(Color.white);
    bottom.add(MoneyField);
    MoneyField.setText(""+myMoney);

    Panel gamepanel = new Panel();
    Label gameName = new Label("Game:");
    gameName.setForeground(Color.white);
    gameName.setBackground(backgroundColor);
    gamepanel.add(gameName);

    game = new Choice();
    game.setBackground(Color.black);
    game.setForeground(Color.white);
    game.addItem("Jacks Or Better");
    game.addItem("Bonus Poker");
    game.addItem("Double Bonus Poker");
    game.addItem("Deuces Wild");
    game.addItem("Joker Wild");
    gamepanel.add(game);
    bottom.add(gamepanel);
    add("South", bottom);

    /** East controls **/
    Panel right = new Panel();
    right.setLayout(new BorderLayout());

    Panel east = new Panel();
    east.setLayout(new GridLayout(3,1));

    betButton = new java.awt.Button("Bet 1");
    betButton.setForeground(Color.white);
    betButton.setBackground(Color.black);
    east.add(betButton);
    
    max = new java.awt.Button("Bet Max");
    max.setForeground(Color.white);
    max.setBackground(Color.black);
    east.add(max);
 
    deal = new java.awt.Button("Deal");
    deal.setForeground(Color.white);
    deal.setBackground(Color.black);
    east.add(deal);
    
    deal.disable();    
    right.add("South",east);
    add("East",right);

    loadImages();

    // Instantiate some arrays and Objects
    nodds = new int[12];
    codds = new String[12];
    newGame("Jacks Or Better");

  }

  /************************************************************************/
  private void loadImages() {
    MediaTracker tracker = new MediaTracker(this);
    Toolkit tk=Toolkit.getDefaultToolkit();
    images = new Image[5][14];
    for(int i=0;i<5;i++) {
      for(int j=0;j<14;j++) {
        if ((i == 0 && j == 0) ||
            (j != 0 && i != 4) ||
	    (i == 4 && j == 0)) {
	  try{
	    BufferedInputStream in = new BufferedInputStream
	      (getClass().getResourceAsStream("images/"+i+"-"+j+".gif"));
	    byte[] data = new byte[100000];
	    in.read(data);
	    images[i][j] = tk.createImage(data);
	    tracker.addImage(images[i][j],0);
	    tracker.waitForAll();
	  }
	  catch (Exception e) {
	    e.printStackTrace();
	  }
	}
      }
    }
  }
  
  /************************************************************************/
  public void update (Graphics g) {
    int x,y,xlen,ylen;
    
    y = 150;
    x = 0; xlen = 500; ylen = 15;
    
    g.setColor(backgroundColor);    
    if (redraw) {
      g.fillRect(0,0,500,350);
      redraw = false;
    } else {
      g.fillRect(x,y,xlen,ylen);
    }
    g.setColor(Color.white);
    paint(g); 
  }

  /************************************************************************/
  public void paint (Graphics g) {
    
    int 
      start,
      xpos, 
      ypos, 
      i    = 0;
    
    boolean 
      done = false;
    
    start = 10;
    xpos = 15;
    ypos = start;
    
    g.setColor(Color.white);
    g.drawString("Frank Maritato's Video Poker Version 2.2",xpos,ypos);
    
    start += 20;
    xpos = 15;
    ypos = start;
    while (codds[i] != null) {
      if (i == winningIndex) {
	g.setColor(Color.blue);
	g.fillRect(xpos-5,ypos-12,165,15);
	g.setColor(Color.yellow);
	g.drawString(codds[i],xpos,ypos);
	g.drawString(""+nodds[i]*myBet,xpos+130,ypos);
	g.setColor(Color.white);
	if (gameOver) {
	  myMoney += myBet*nodds[i];
	  paidField.setText(""+myBet*nodds[i]);
	}
      } else {
	g.drawString(codds[i],xpos,ypos);
	g.drawString(""+nodds[i]*myBet,xpos+130,ypos);
      }
      i++; 
      ypos += 15;
      if (i >= (currentLength/2) && !done) {
	xpos += 175;
	ypos = start;
	done = true;
      }
    }

    start += 140;
    xpos = 15;
    ypos = start;
    for (i=0;i<5;i++) {
      if (newDeal) {
	int a = h.hand[i].getSuit();
	int b = h.hand[i].getValue();
	g.drawImage(images[a-1][b],xpos,ypos,this);
	if (b == 2 && currentGame.equals("Deuces Wild")) {
	  g.setColor(Color.blue);
	  g.setFont(new Font("TimesRoman",Font.BOLD,18));
	  g.drawString("WILD",xpos+10,ypos+50);
	  g.setFont(new Font ("TimesRoman",Font.PLAIN,18));
	  g.setColor(Color.white);
	}
	//System.out.println("ypos "+ypos);
	if (h.hand[i].isHeld()) {
	  g.setFont(new Font("TimesRoman",Font.BOLD,18));
	  g.drawString("HELD",xpos+10,ypos-5);
	  g.setFont(new Font ("TimesRoman",Font.PLAIN,18));
	}
      } else 
	g.drawImage(images[0][0],xpos,ypos,this);

      xpos += 85;
    }
    if (gameOver) {
      start -= 40;
      xpos = 145;
      ypos = start;
      Font old = g.getFont();
      g.setFont(new Font("TimesRoman",Font.BOLD,24));
      g.setColor(Color.yellow);
      g.drawString("GAME OVER",xpos,ypos);
      g.setFont(new Font ("TimesRoman",Font.PLAIN,18));
      g.drawString("Play 5 coins",xpos+35,ypos+15);
      g.setColor(Color.white);
      g.setFont(old);
      myBet = 0;
    }

    MoneyField.setText(""+myMoney);
  }
  
  /************************************************************************/
  public boolean handleEvent(Event evt) {
    if (evt.id == Event.WINDOW_DESTROY)
      System.exit(0);
    return super.handleEvent(evt);
  }
  
  /************************************************************************/
  public boolean mouseDown (Event e, int x, int y) {
    int card1Start = 15;
    int card2Start = card1Start+85;
    int card3Start = card2Start+85;
    int card4Start = card3Start+85;
    int card5Start = card4Start+85;
    int  
      ytop,
      ybot;
    
    ytop = 165;
    ybot = ytop + images[0][0].getHeight(this);
    
    if (!gameOver) {
      redraw = false;
      if ( y > ytop && y < ybot) {
	if (x > card1Start && x < card1Start+70) {
	  hold(0);
	} else if ( x > card2Start && x < card2Start+70) {
	  hold(1);
	} else if ( x > card3Start && x < card3Start+70) {
	  hold(2);
	} else  if ( x > card4Start && x < card4Start+70) {
	  hold(3);
	} else if ( x > card5Start && x < card5Start+70) {
	  hold(4);
	}
      }
    }
    return true;
  }
  
  
  /************************************************************************/
  public boolean action (Event e, Object arg) {
    if (arg.equals("Bet 1")) {
      placeBet(1);
    } else if (arg.equals("Bet Max")) {
      placeBet(5);
    } else if (arg.equals("Deal")) {
      dealIt();
    } else if (arg.equals("Draw")) {
      draw();
    } else if (e.target instanceof Choice) {
      newGame(""+arg);
    }
    return true;
  }
  
  /************************************************************************/
  public void hold (int num) {
    if (h.hand[num].isHeld()) {
      h.hand[num].setHeld(false);
    } else {
      h.hand[num].setHeld(true);
    }
    repaint();
  }
  
  /************************************************************************/
  public void dealIt() {

    if (currentGame.equals("Joker Wild"))
      d = new CardDeck(1, true);
    else
      d = new CardDeck(1, false);
    
    h = new Hand(d.draw(), currentGame);
    for (int i=1;i<5;i++)
      h.Insert(d.draw());
    
    newDeal = true;
    paidField.setText("0");
    deal.setLabel("Draw");
    betButton.disable();
    max.disable();
    winningIndex = h.checkHand();
    redraw = true;
    repaint();
  }
  
  /************************************************************************/
  public void draw () {
    for(int i=0;i<5;i++) {
      if (!h.hand[i].isHeld()) {
	h.Delete(i);
	h.hand[i] = d.draw();
      }
    }
    resetIt();
    winningIndex = h.checkHand();
    gameOver = true;
    deal.disable();
    redraw = true;
    repaint();
  }
  
  /************************************************************************/
  public void resetIt() {
    deal.setLabel("Deal");
    betButton.enable();
    max.enable();
    game.enable();
    betField.setText(""+myBet);
  }

  /************************************************************************/
  public void placeBet(int n) {
    int
      thisbet = 0;

    if (n == 5) {
      thisbet = (5 - myBet);
      myBet = 5;
    } else {
      thisbet = 1;
      myBet++;
    }

    newDeal = false;
    betField.setText(""+myBet);
    deal.enable();
    myMoney -= thisbet;
    winningIndex = 11;

    if (myBet == 5) {
      betButton.disable();
      max.disable();
      dealIt();
    }

    game.disable();
    gameOver = false;
    redraw = true;
    repaint();
  }
  
  /************************************************************************/
  public void newGame (String arg) {
    newDeal = false;
    winningIndex = 11;
    currentGame = arg;
    codds[0] = "Royal Flush";
    nodds[0] = 800;
    if (arg.equals("Jacks Or Better")) {
      codds[1] = "Straight Flush";
      codds[2] = "4 of a Kind";
      codds[3] = "Full House";
      codds[4] = "Flush";
      codds[5] = "Straight";
      codds[6] = "3 of a Kind";
      codds[7] = "2 Pair";
      codds[8] = "Jacks or Better";
      codds[9] = null;
      codds[10]= null;
      currentLength = 9;
      nodds[1] = 50;
      nodds[2] = 25;
      nodds[3] = 8;
      nodds[4] = 5;
      nodds[5] = 4;
      nodds[6] = 3;
      nodds[7] = 2;
      nodds[8] = 1;
    } else if (arg.equals("Bonus Poker")) {
      codds[1]  = "Straight Flush";
      codds[2]  = "4 Aces";
      codds[3]  = "4 2's, 3's, 4's";
      codds[4]  = "4 5's - K's";
      codds[5]  = "Full House";
      codds[6]  = "Flush";
      codds[7]  = "Straight";
      codds[8]  = "3 of a Kind";
      codds[9]  = "2 Pair";
      codds[10] = "Jacks or Better";
      currentLength = 11;
      nodds[1]  = 50;
      nodds[2]  = 80;
      nodds[3]  = 40;
      nodds[4]  = 25;
      nodds[5]  = 8;
      nodds[6]  = 5;
      nodds[7]  = 4;
      nodds[8]  = 3;
      nodds[9]  = 2;
      nodds[10] = 1;
    } else if (arg.equals("Double Bonus Poker")) {
      codds[1]  = "Straight Flush";
      codds[2]  = "4 Aces";
      codds[3]  = "4 2's, 3's, 4's";
      codds[4]  = "4 5's - K's";
      codds[5]  = "Full House";
      codds[6]  = "Flush";
      codds[7]  = "Straight";
      codds[8]  = "3 of a Kind";
      codds[9]  = "2 Pair";
      codds[10] = "Jacks or Better";
      currentLength = 11;
      nodds[1]  = 50;
      nodds[2]  = 160;
      nodds[3]  = 80;
      nodds[4]  = 50;
      nodds[5]  = 10;
      nodds[6]  = 7;
      nodds[7]  = 5;
      nodds[8]  = 3;
      nodds[9]  = 1;
      nodds[10] = 1;
    } else if (arg.equals("Deuces Wild")) {
      codds[1]  = "4 Deuces";
      codds[2]  = "Royal Flush w/2's";
      codds[3]  = "5 of a Kind";
      codds[4]  = "Straight Flush";
      codds[5]  = "4 of a Kind";
      codds[6]  = "Full House";
      codds[7]  = "Flush";
      codds[8]  = "Straight";
      codds[9]  = "3 of a Kind";
      codds[10] = null;
      currentLength = 10;
      nodds[1]  = 200;
      nodds[2]  = 50;
      nodds[3]  = 16;
      nodds[4]  = 13;
      nodds[5]  = 4;
      nodds[6]  = 4;
      nodds[7]  = 3;
      nodds[8]  = 2;
      nodds[9]  = 1;
    } else if (arg.equals("Joker Wild")) {
      codds[1]  = "Royal Flush w/Joker";
      codds[2]  = "5 of a Kind";
      codds[3]  = "Straight Flush";
      codds[4]  = "4 of a Kind";
      codds[5]  = "Full House";
      codds[6]  = "Flush";
      codds[7]  = "Straight";
      codds[8]  = "3 of a Kind";
      codds[9]  = "2 Pair";
      codds[10] = "Kings or Better";
      currentLength = 11;
      nodds[1]  = 100;
      nodds[2]  = 200;
      nodds[3]  = 50;
      nodds[4]  = 15;
      nodds[5]  = 6;
      nodds[6]  = 4;
      nodds[7]  = 3;
      nodds[8]  = 2;
      nodds[9]  = 1;
      nodds[10] = 1;
    }
    redraw = true;
    repaint();
  }
  
  // ** Variables **
  Image
    images[][];
  
  int
    myBet        = 0,
    myMoney      = 100,
    winningIndex = 11,
    nodds[],
    currentLength;

  String      
    codds[], 
    currentGame;
  
  static String 
    OSNAME = "";

  CardDeck    
    d;

  Hand        
    h;

  boolean
    newDeal = false,
    gameOver= true,
    redraw=true;
  
  Color 
    backgroundColor = new Color(0,100,0);
  
  //{{DECLARE_CONTROLS
  java.awt.Button deal;
  java.awt.Label label1;
  java.awt.Label betLabel;
  java.awt.Button max;
  java.awt.Button betButton;
  java.awt.Label MoneyField;
  java.awt.Label MoneyLabel;
  java.awt.Label betField;
  java.awt.Label paidLabel;
  java.awt.Label paidField;
  Choice game;
  //}}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产传媒日韩欧美成人| 日韩欧美中文一区| 9191国产精品| 国产精品毛片大码女人| 丝袜美腿亚洲综合| 色噜噜狠狠色综合欧洲selulu| 91精品国产一区二区三区香蕉 | 67194成人在线观看| 亚洲视频在线一区二区| 国产精品1024| 欧美电影免费提供在线观看| 亚洲一卡二卡三卡四卡| 成人福利电影精品一区二区在线观看| 日韩一区二区在线播放| 亚洲成人三级小说| 在线视频你懂得一区二区三区| 国产日韩三级在线| 精品无人码麻豆乱码1区2区| www.久久精品| 国产精品久久久久久久午夜片 | 欧美三级蜜桃2在线观看| 国产精品女主播在线观看| 91成人在线观看喷潮| 亚洲美腿欧美偷拍| 99久久精品免费| 亚洲欧美福利一区二区| va亚洲va日韩不卡在线观看| 国产欧美精品一区| 成人在线视频一区二区| 国产日本欧美一区二区| 国产999精品久久久久久| 久久色视频免费观看| 韩日欧美一区二区三区| 日韩美女主播在线视频一区二区三区 | 五月激情综合网| 欧美在线|欧美| 亚洲国产精品人人做人人爽| 一区二区欧美精品| 欧美精选午夜久久久乱码6080| 夜夜嗨av一区二区三区中文字幕 | 国产麻豆日韩欧美久久| 久久蜜臀中文字幕| 成人一二三区视频| 亚洲视频在线观看三级| 欧美网站一区二区| 奇米在线7777在线精品| 国内久久精品视频| 欧美国产精品v| 99久久综合99久久综合网站| 亚洲免费成人av| 777xxx欧美| 国产一区二区调教| 亚洲欧洲一区二区在线播放| 欧美性受xxxx黑人xyx性爽| 日韩国产高清在线| 国产午夜精品一区二区三区视频| av欧美精品.com| 亚洲成a人片在线不卡一二三区| 欧美一区二区久久久| 国产美女主播视频一区| 亚洲欧美国产三级| 日韩欧美亚洲国产精品字幕久久久| 国产电影一区二区三区| 一区二区三区在线免费播放| 91精品在线免费| 成年人网站91| 日韩vs国产vs欧美| 中文在线一区二区| 欧美日韩午夜在线视频| 国产久卡久卡久卡久卡视频精品| 亚洲精品日韩专区silk| 欧美成人激情免费网| 日本乱人伦aⅴ精品| 精品一区在线看| 亚洲黄色av一区| 国产一区91精品张津瑜| 亚洲国产精品自拍| 欧美经典一区二区三区| 欧美日韩久久一区| 精品久久人人做人人爽| 日本韩国欧美三级| 国产精品一区2区| 亚洲高清免费视频| 中文字幕在线不卡一区二区三区 | 在线观看免费成人| 国产麻豆一精品一av一免费| 丝瓜av网站精品一区二区| 国产农村妇女精品| 欧美变态tickle挠乳网站| 在线看一区二区| av电影在线观看完整版一区二区| 狠狠色2019综合网| 天堂在线亚洲视频| 一区二区在线观看免费视频播放| 久久久99久久精品欧美| 日韩欧美国产三级| 欧美人xxxx| 欧美色网一区二区| 在线一区二区视频| 91麻豆国产香蕉久久精品| 粉嫩av一区二区三区粉嫩| 久久超碰97中文字幕| 日本成人超碰在线观看| 亚洲大尺度视频在线观看| 伊人婷婷欧美激情| 亚洲卡通欧美制服中文| 亚洲色图19p| 中文字幕一区二区视频| 国产精品美女久久久久久2018| 欧美精品一区二区精品网| 欧美成人a∨高清免费观看| 欧美一区二区视频观看视频 | 性感美女久久精品| 亚洲最新视频在线观看| 亚洲激情校园春色| 亚洲国产一区二区视频| 性做久久久久久免费观看欧美| 一区二区三区**美女毛片| 夜夜嗨av一区二区三区网页| 亚洲香蕉伊在人在线观| 石原莉奈在线亚洲二区| 日韩精品国产精品| 精品一区二区三区免费播放| 国内精品视频666| 丁香婷婷综合五月| 色偷偷久久一区二区三区| 欧美日韩中文另类| 欧美一级在线观看| 国产亚洲精品中文字幕| 中文字幕制服丝袜成人av | 石原莉奈在线亚洲三区| 欧美aa在线视频| 国产二区国产一区在线观看| 99精品国产一区二区三区不卡| 色美美综合视频| 正在播放一区二区| 国产日韩欧美亚洲| 亚洲欧美一区二区三区极速播放| 亚洲妇女屁股眼交7| 久久精品99国产精品日本| 丁香激情综合国产| 欧美亚男人的天堂| 欧美精品一区二区三区蜜桃| 日本一区二区三区免费乱视频| 一区二区三区日韩精品| 久久国产精品99精品国产| www.欧美色图| 日韩欧美成人一区| 综合欧美亚洲日本| 看片的网站亚洲| 91小视频免费观看| 日韩三级在线免费观看| 中文字幕一区二区三区四区不卡| 午夜精品123| 成人动漫在线一区| 日韩欧美一区二区久久婷婷| 中文字幕中文字幕一区| 久久精品国产99久久6| 91小宝寻花一区二区三区| 欧美大片免费久久精品三p| 亚洲视频每日更新| 国产精一区二区三区| 欧美色老头old∨ideo| 天堂在线一区二区| 高清国产午夜精品久久久久久| 欧美日韩亚洲不卡| 中文字幕一区二区三区在线不卡| 久久99精品国产麻豆婷婷| 欧美亚洲国产一区在线观看网站| 国产欧美日韩三级| 青青草原综合久久大伊人精品优势| 99精品视频在线免费观看| 欧美精品一区二区蜜臀亚洲| 亚洲国产成人高清精品| 成人成人成人在线视频| 久久毛片高清国产| 免费在线观看视频一区| 欧美系列日韩一区| 亚洲男人的天堂一区二区| 国产成人一级电影| 久久蜜臀中文字幕| 久久99精品久久久久久国产越南| 欧美日本在线观看| 亚洲在线视频网站| 日本高清成人免费播放| 中文字幕中文字幕中文字幕亚洲无线| 国产在线视视频有精品| 精品福利一区二区三区| 久久精品久久99精品久久| 欧美二区在线观看| 婷婷综合久久一区二区三区| 欧美色综合网站| 亚洲成人av中文| 欧美色中文字幕| 午夜私人影院久久久久| 精品1区2区3区| 日韩成人av影视| 日韩欧美成人激情| 国内精品免费**视频| 久久色.com|