commit - 2afa916b2f1041869a0619142ce63f851f96deb9
commit + bbc34e6ee18eeafb621138f2070719df6f94613d
blob - 8b137891791fe96927ad78e64b0aad7bded08bdc (mode 644)
blob + /dev/null
--- main.algo
+++ /dev/null
-
blob - 5996f56e42704c78da836ae03babd93f7f43b202
blob + 83d74f16a6cf49b1222150583ed6173f6cf41240
--- 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;
+//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;
+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 } ;
+
+const Suits trump_suit ;
+
+typedef struct {
+ unsigned short rank ;
+ unsigned short suit ;
+ unsigned short is_trump ;
+} Card ;
+
+typedef struct {
+ Card card1 ;
+ Card card2 ;
+ Card card3 ;
+ Card card4 ;
+ Card card5 ;
+ Card card6 ;
+ Card card7 ;
+ Card card8 ;
+} Suit ;
+
+typedef struct {
+ Suit suit_hearts ;
+ Suit suit_diamonds ;
+ Suit suit_clubs ;
+ Suit suit_spades ;
+} Deck ;
+
//struct Card { int suit; int value; } ; card[2] = suit, rank
-struct player {
+//struct player {
+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 " } ;
int strategy ; //= 1 // 0, 1, 2, 3 = boss, classic/default, batlaizan (mine), beginner/cautious
-} ; typedef struct player Player ;
+} Player1, Player2, Player3, Player4 ; //; typedef struct player Player ;
-Player Player1
-
int main() {
return 0 ;
int rule[3] ;
} ; typedef struct deduced Deduced ;
+int follow_rules(int plays_in, char ongoing[]) {
+
+ return ;
+}
+
int strat_boss(char *hand[], int player_n, Deduced deductions[], char ongoing[]){
return *card ;
return *card ;
}
-int trick(FirstPlayer->hand, SecondPlayer->hand, ThirdPlayer->hand, FourthPlayer->hand){
+int trick(*FirstPlayer->hand, *SecondPlayer->hand, *ThirdPlayer->hand, *FourthPlayer->hand){
return draw ;
}