vanjikumaran / CardGame304

Server and Client for the "304" Card game using WebSub technology and implemented using Ballerina Language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CardGame304

Server and Client for the "304" Card game using WebSub technology and implemented using Ballerina Language

Introduction

304, pronounced three-nought-four, is a trick-taking card game. The game is played by two teams of two using a subset (7 through Ace of all suits) of the 52 standard playing cards.

Overview

304 is a strategic game, as opposed to one that is based on luck, and everything can be exactly calculated.

The cards are dealt by the dealer to all four players in a counter-clockwise manner, each getting four cards in the first round. Then the player to the right of the dealer looks at his cards and picks out a trump and places it face down on the table. player then shouts out a score for his team to score, which he trusts he can win with the cards he has.

Then a member of the opposing team can pick their own trump, and must pick a score higher than that was named before for his team to score. When a score is agreed the rest of the cards are distributed and the game is started.

The game is played similar to the standard rules followed, where the players answer the suit played. But if they don't have the particular suit, then they can try to guess the trump by passing a face down card to the player who has closed a trump card. If he or she guesses it right then she gets the hand or else the game goes on.

Points are scored according to the points shown in the table. After all the hands are completed, if the team has scored the required score they win.

Card Values

Card Points Alternative Scoring
J 30 3.0
9 20 2.0
A 11 1.1
10 10 1.0
K 3 0.3
Q 2 0.2
8 0 0.0
7 0 0.0

NOTE

This code only works with 0.991 bellow.

About

Server and Client for the "304" Card game using WebSub technology and implemented using Ballerina Language

License:Apache License 2.0


Languages

Language:Ballerina 100.0%