commit 2afa916b2f1041869a0619142ce63f851f96deb9 from: Sylvain Saboua date: Tue Jan 27 21:46:56 2026 UTC more definitions commit - e07323d22e572084eda45e7087566bcb31b5e1b5 commit + 2afa916b2f1041869a0619142ce63f851f96deb9 blob - 660be0573b2f1686c9658c9f5d8ec59ee4f84022 blob + 8b137891791fe96927ad78e64b0aad7bded08bdc --- main.algo +++ main.algo @@ -1,22 +1 @@ -char stdrd = [ 'A ', '10', 'K ', 'Q ', 'J ', '9 ', '8 ', '7 ' ] -int v_std = [ 11, 10, 4, 3, 2, 0, 0, 0 ] -char trump = [ 'J ', ' 9', 'A ', '10', 'K ', 'Q ', '8 ', '7 ' ] -int v_trm = [ 20, 14, 11, 10, 4, 3, 0, 0 ] -// char suits = [ ' H', ' D', ' S', ' C' ] -char suits = [ ' ♥', ' ♦', ' ♤', ' ♧' ] - //hearts, diamonds, spades, clubs -struct card { int suit; int value } -int players = [ 0, 1, 2, 3, 4 ] - -/* shuffle/cut */ - -/* deal */ - /* bargain 1,2 (3,4) */ - -/* trick */ - n - first throw - -/* compute */ - blob - e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 blob + 5996f56e42704c78da836ae03babd93f7f43b202 --- main.c +++ main.c @@ -0,0 +1,69 @@ +/*****************************************/ +/* Belote : TUI implementation of */ +/* the French traditional card-playing */ +/* game. C training project. */ +/* copyright © Sylvain Saboua */ +/*****************************************/ + +# include +# include + +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; + +//struct Card { int suit; int value; } ; card[2] = suit, rank +struct player { + 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 ; + +Player Player1 + +int main() { + + return 0 ; +} + +/* shuffle/cut */ + +/* deal */ + /* bargain 1,2 (3,4) */ + +/* trick */ +int first_player; +struct deduced { + int rule[3] ; +} ; typedef struct deduced Deduced ; + +int strat_boss(char *hand[], int player_n, Deduced deductions[], char ongoing[]){ + + return *card ; +} + +int strat_classic(char *hand[], int player_n, Deduced deductions[], char ongoing[]){ + + return *card ; +} + +int strat_batlaizan(char *hand[], int player_n, Deduced deductions[], char ongoing[]){ + + return *card ; +} + +int strat_cautious(char *hand[], int player_n, Deduced deductions[], char ongoing[]){ + + return *card ; +} + +int trick(FirstPlayer->hand, SecondPlayer->hand, ThirdPlayer->hand, FourthPlayer->hand){ + + return draw ; +} + +/* compute */