commit - bbc34e6ee18eeafb621138f2070719df6f94613d
commit + 8fea09befa91743d4dd3bf2d411e54bdbb575601
blob - 83d74f16a6cf49b1222150583ed6173f6cf41240
blob + e92e40c057a622750aef4768c01f0f0766ec2eb7
--- main.c
+++ main.c
# include <stdlib.h>
# include <stdio.h>
-//char* std_suit[8] = { "A ", "10", "K ", "Q ", "J ", "9 ", "8 ", "7 " } ;
-//int v_std[8] = { 11, 10, 4, 3, 2, 0, 0, 0 } ;
-//char* trp_suit[8] = { "J ", " 9", "A ", "10", "K ", "Q ", "8 ", "7 " } ;
-//int v_trp[8] = { 20, 14, 11, 10, 4, 3, 0, 0 } ;
-//char* suits[4] = { " ♥", " ♦", " ♧", " ♤" } ;
-//int trump;
+// UNIVERSALS
-typedef enum { hearts, diamonds, clubs, spades } Suits ;
-char *suits[4] = { "♥ " , "♦ ", "♧ ", "♤ " } ;
-char *stdrds[8] = { " 7", " 8", " 9", " J", " Q", " K", "10", " A" } ;
-unsigned int v_std[8] = { 0, 0, 0, 2, 3, 4, 10, 11 } ;
-char *trumps[8] = { " 7", " 8", " Q", " K", "10", " A", " 9", " J" } ;
-unsigned int v_trp[8] = { 0, 0, 3, 4, 10, 11, 14, 20 } ;
-
+typedef enum { hearts, diamonds, clubs, spades } Suits ;
+char *suits[4] = { "♥ " , "♦ ", "♧ ", "♤ " } ;
const Suits trump_suit ;
+char *stdrds[8] = { " 7", " 8", " 9", " J", " Q", " K", "10", " A" } ;
+int v_std[8] = { 0, 0, 0, 2, 3, 4, 10, 11 } ;
+char *trumps[8] = { " 7", " 8", " Q", " K", "10", " A", " 9", " J" } ;
+int v_trp[8] = { 0, 0, 3, 4, 10, 11, 14, 20 } ;
typedef struct {
- unsigned short rank ;
- unsigned short suit ;
- unsigned short is_trump ;
+ int rank ;
+ int suit ;
} Card ;
typedef struct {
Suit suit_spades ;
} Deck ;
-//struct Card { int suit; int value; } ; card[2] = suit, rank
-//struct player {
-struct {
+// PARTICULARS
+
+typedef struct {
int player_n ; // 0 = NULL
int teammate ; // if 1 -> 3 ; if 2 -> 4 ; and vice-versa
- char hand[8] ; //= { "0 ", "0 ", "0 ", "0 ", "0 ", "0 ", "0 ", "0 " } ;
+ Hand hand ;
int strategy ; //= 1 // 0, 1, 2, 3 = boss, classic/default, batlaizan (mine), beginner/cautious
} Player1, Player2, Player3, Player4 ; //; typedef struct player Player ;
+typedef struct {
+ Card card1 ;
+ Card card2 ;
+ Card card3 ;
+ Card card4 ;
+ Card card5 ;
+ Card card6 ;
+ Card card7 ;
+ Card card8 ;
+} Hand ;
+
+// GAME
+
int main() {
return 0 ;
int follow_rules(int plays_in, char ongoing[]) {
- return ;
+ return 0 ;
}
int strat_boss(char *hand[], int player_n, Deduced deductions[], char ongoing[]){