Skip to content

Commit db12b9e

Browse files
committed
Fixed scoring bug in main.go
1 parent ba3d8cd commit db12b9e

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

Client/Atari/bin/FujiLlama.xex

2 Bytes
Binary file not shown.

server/lobbyClient.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var DefaultGameServerDetails = GameServer{
2323
Region: "nz",
2424
Serverurl: "N:https://fujillama.spysoft.nz",
2525
Clients: []GameClient{
26-
{Platform: "atari", Url: "tnfs://34.31.166.226/atari/fujillama.xex"},
26+
{Platform: "atari", Url: "tnfs://tnfs.spysoft.nz/atari/fujillama.xex"},
2727
},
2828
}
2929

server/main.go

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -815,14 +815,39 @@ func EndofRoundScore(tableIndex int) {
815815
a := 0
816816
b := 0
817817
c := 0
818+
f1 := 0
819+
f2 := 0
820+
f3 := 0
821+
f4 := 0
822+
f5 := 0
823+
f6 := 0
824+
f7 := 0
825+
// Calculate the score based on the cards remaining in the player's hand
818826
for _, card := range gameStates[tableIndex].Players[i].Hand {
819827
switch {
820828
case card.Cardvalue == 0:
821829
// do nothing
822-
case card.Cardvalue == 7:
823-
b++ // Llama is worth 1 black counter (10 points)
824-
default:
830+
case card.Cardvalue == 1 && f1 == 0:
831+
a = a + card.Cardvalue
832+
f1++
833+
case card.Cardvalue == 2 && f2 == 0:
834+
a = a + card.Cardvalue
835+
f2++
836+
case card.Cardvalue == 3 && f3 == 0:
837+
a = a + card.Cardvalue
838+
f3++
839+
case card.Cardvalue == 4 && f4 == 0:
840+
a = a + card.Cardvalue
841+
f4++
842+
case card.Cardvalue == 5 && f5 == 0:
843+
a = a + card.Cardvalue
844+
f5++
845+
case card.Cardvalue == 6 && f6 == 0:
825846
a = a + card.Cardvalue
847+
f6++
848+
case card.Cardvalue == 7 && f7 == 0:
849+
b++ // Llama is worth 1 black token (10 points)
850+
f7++
826851
}
827852
}
828853

0 commit comments

Comments
 (0)