diff --git a/Cribbage/cribbage.log b/Cribbage/cribbage.log index aa5c683897821af5648fa8f30f02c93924490e2b..b8ec5f86b8d2d157b4912a005e7965d0bb8e0346 100644 --- a/Cribbage/cribbage.log +++ b/Cribbage/cribbage.log @@ -1,33 +1,25 @@ -seed,30006 +seed,55510 cribbage.RandomPlayer,P0 cribbage.RandomPlayer,P1 -deal,P0,[AH,3H,4D,4S,7D,8C] -deal,P1,[AS,3S,6S,9S,TS,JS] -discard,P0,[3H,7D] -discard,P1,[3S,9S] -starter,3D -play,P0,4,4D -play,P1,10,6S -play,P0,14,4S -play,P1,15,AS -score,P1,2,2,fifteen -play,P0,23,8C -score,P0,1,1,go -play,P0,24,AH -score,P0,2,1,go -score,P0,3,1,go -play,P1,10,JS -score,P1,3,1,go -play,P1,20,TS -score,P1,4,1,go -show,P0,3D+[AH,4D,4S,8C] -score,P0,5,2,fifteen,[3D,4D,8C] -score,P0,5,2,fifteen,[3D,4S,8C] -score,P0,9,2,pair2,[4D,4S] -show,P1,3D+[AS,6S,TS,JS] -score,P1,8,4,flush4,[AS,6S,TS,JS] -show,P1,3D+[3H,3S,7D,9S] -score,P1,10,2,fifteen,[3H,3S,9S] -score,P1,10,2,fifteen,[3D,3H,9S] -score,P1,10,2,fifteen,[3D,3S,9S] -score,P1,20,6,pair3,[3D,3H,3S] +deal,P0,[2C,2H,7C,QC,QD,KH] +deal,P1,[AD,AH,TD,JS,QH,KC] +discard,P0,[2C,QC] +discard,P1,[JS,KC] +starter,8H +play,P0,2,2H +play,P1,3,AD +play,P0,13,QD +play,P1,23,QH +score,P1,2,2,pair2 +play,P0,30,7C +play,P1,31,AH +score,P1,4,2,thirtyone +play,P0,10,KH +play,P1,20,TD +score,P1,5,1,go +show,P0,8H+[2H,7C,QD,KH] +score,P0,2,2,fifteen,[7C,8H] +show,P1,8H+[AD,AH,TD,QH] +score,P1,7,2,pair2,[AD,AH] +show,P1,8H+[2C,JS,QC,KC] +score,P1,10,3,run3,[JS,QC,KC] diff --git a/Cribbage/cribbage.properties b/Cribbage/cribbage.properties index fba8e4a48c76d2488bd03f688b01f865c06b3902..07cd098a1569820f205ce904b49647c4169e77ce 100644 --- a/Cribbage/cribbage.properties +++ b/Cribbage/cribbage.properties @@ -1,7 +1,7 @@ -#Seed=55510 +Seed=55510 #Seed=12345 #Seed=1248 -Seed=30006 +#Seed=30006 #Animate=true Animate=false #Player0=cribbage.HumanPlayer diff --git a/Cribbage/out/production/Cribbage/cribbage/Cribbage.class b/Cribbage/out/production/Cribbage/cribbage/Cribbage.class index 741a399389144ae4f656afaf3367d4e2d2a1f342..6c70f9e298f56a3fb038383ee51473a682db7d22 100644 Binary files a/Cribbage/out/production/Cribbage/cribbage/Cribbage.class and b/Cribbage/out/production/Cribbage/cribbage/Cribbage.class differ diff --git a/Cribbage/src/cribbage/Cribbage.java b/Cribbage/src/cribbage/Cribbage.java index 522a7faf719d57c5c5b1aba3b3be48d0aab412f0..d65dd4bb11077d083e6034948edb80ab3525cb59 100644 --- a/Cribbage/src/cribbage/Cribbage.java +++ b/Cribbage/src/cribbage/Cribbage.java @@ -326,27 +326,26 @@ private void play() { } void showHandsCrib() { + HandCards handCards = new CribbageHandCards(); + modifyShow(handCards); // score player 0 (non dealer) log.writeLog(String.format("show,P0,%s+%s", canonical(starter.getLast()), canonical(handsCopy[0]))); - HandCards p0HandCards = new CribbageHandCards(); - p0HandCards.setPlayer(0); - p0HandCards.setScore(scores[0]); - modifyShow(p0HandCards); - p0HandCards.sendHandCards(handsCopy[0], starter, deck); - scores[0] = p0HandCards.scoreHandCards(); + handCards.setPlayer(0); + handCards.setScore(scores[0]); + handCards.sendHandCards(handsCopy[0], starter, deck); + scores[0] = handCards.scoreHandCards(); updateScore(0); // score player 1 (dealer) log.writeLog(String.format("show,P1,%s+%s", canonical(starter.getLast()), canonical(handsCopy[1]))); - HandCards p1HandCards = new CribbageHandCards(); - p1HandCards.setPlayer(1); - p1HandCards.setScore(scores[1]); - modifyShow(p1HandCards); - p1HandCards.sendHandCards(handsCopy[1], starter, deck); - p1HandCards.scoreHandCards(); + handCards.setPlayer(1); + handCards.setScore(scores[1]); + handCards.sendHandCards(handsCopy[1], starter, deck); + handCards.scoreHandCards(); + updateScore(1); // score crib (for dealer) log.writeLog(String.format("show,P1,%s+%s", canonical(starter.getLast()), canonical(crib))); - p1HandCards.sendHandCards(crib, starter, deck); - scores[1] = p1HandCards.scoreHandCards(); + handCards.sendHandCards(crib, starter, deck); + scores[1] = handCards.scoreHandCards(); updateScore(1); }