Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

PIG game dice

articus
articus 


Please look at files attached! Need this done ASAP Attachments Tags Clarifications

Answers

A Game of Pig

felo
felo 



Kindly find attached running program Attachments
game of pig.png (109 K) Download Preview

PigGame.zip (20 K) Download









Preview
JMenuItem("Restart"); quitItem.addActionListener(this); restartItem.addActionListener(this); playItem.addActionListener(this); fileMenu.add(restartItem); fileMenu.add(playItem); fileMenu.add(quitItem); menus = new JMenuBar(); myGUI.setJMenuBar(menus); menus.add(fileMenu); myGUI.setVisible(true); } /**************************************************************** Respond to the user action @param e - the JComponent just selected **********************************

Preview
4: g.fillOval (left,left,dotSize,dotSize); g.fillOval (left,right,dotSize,dotSize); g.fillOval (right,left,dotSize,dotSize); g.fillOval (right,right,dotSize,dotSize); break; case 6: g.fillOval (left,left,dotSize,dotSize); g.fillOval (left,middle,dotSize,dotSize); g.fillOval (left,right,dotSize,dotSize); g.fillOval (right,left,dotSize,dotSize); g.fillOval (right,middle,dotSize,dotSize); g.fillOval (right,right,dotSize,dotSize); break; } } /***********************

Preview
true; } //Returns currentRoundScore public int getRoundScore() { return currentRoundScore; } //Returns playerScore public int getPlayerScore () { return playerScore; } //Returns computerScore public int getComputerScore() { return computerScore; } //Uses GVdie method

Preview
{ Pig p = new Pig(); if (setNonZero (p)) { textLog.setLength(0); /* get the current state */ int lastRound = p.getRoundScore(); p.playerRolls(); int currRound = p.getRoundScore(); if (!isOne(p)) { assertEquals("playerRolls(): round score is not updated correctly ", lastRound + sumOfDices(p),

Screenshots
Screenshot
Purchase Answer