Question: I need help writing this code for computer science in eclispe I got the code for game of pig I want to check and compare
I need help writing this code for computer science in eclispe I got the code for game of pig I want to check and compare my solution here is what I have now private void switchPlayer
currentPlayerIndex currentPlayerIndex ;
if scorescurrentPlayerIndex WINNINGSCORE
Game over, record result
String result "Player currentPlayerIndex wins!";
LocalDateTime dateTime LocalDateTime.now;
int totalPoints scorescurrentPlayerIndex;
GameRecord gameRecord new GameRecordresult dateTime, totalPoints, "Player currentPlayerIndex ;
gameHistory.addgameRecord;
Reset scores for a new game
scores new int;
@SuppressWarningshiding
private void updateUI
gameofpig.currentPlayerLabel.setTextCurrent Player: Player currentPlayerIndex ;
roundScoreLabel setTextRound Score: scorescurrentPlayerIndex;
private int rollDice
return new RandomnextInt;
private static class GameRecord
private String result;
private LocalDateTime dateTime;
private int totalPoints;
private String player;
public GameRecordString result, LocalDateTime dateTime, int totalPoints, String player
this.result result;
this.dateTime dateTime;
this.totalPoints totalPoints;
this.player player;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
