repositories
/
Project_algorithmic_C.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement the helper functions needed to list the playble shots
[Project_algorithmic_C.git]
/
lib
/
othello.h
diff --git
a/lib/othello.h
b/lib/othello.h
index 24bf9fb30750f47dedb4b170ef58f5a2e7e57df4..9800676693bd58f59919d56269428f3ed00c30ad 100644
(file)
--- a/
lib/othello.h
+++ b/
lib/othello.h
@@
-19,25
+19,32
@@
#ifndef OTHELLO_H
#define OTHELLO_H
#ifndef OTHELLO_H
#define OTHELLO_H
+#include <stdbool.h>
+
#include "constants.h"
#include "list.h"
#include "constants.h"
#include "list.h"
-struct shots_list {
+/* linked list of can play shots */
+struct shots_list_s {
struct list_head list;
struct list_head list;
- unsigned int*** pawn_array_member;
+ int y;
+ int x;
+ unsigned int type; /* can be white or black or hint allowed or hint_fordidden */
};
unsigned int current_player(unsigned int round_count);
unsigned int eval_winner(unsigned int nb_white, unsigned int nb_black);
};
unsigned int current_player(unsigned int round_count);
unsigned int eval_winner(unsigned int nb_white, unsigned int nb_black);
-int** init_pawns(unsigned int pawn_array[board_size][board_size]);
+void zero_pawns(unsigned int pawn_array[board_size][board_size]);
+void init_pawns(unsigned int pawn_array[board_size][board_size]);
unsigned int get_box_value(int y, int x, unsigned int pawn_array[board_size][board_size]);
unsigned int get_box_value(int y, int x, unsigned int pawn_array[board_size][board_size]);
-
int**
set_pawn(int y, int x, unsigned int type, unsigned int pawn_array[board_size][board_size]);
+
void
set_pawn(int y, int x, unsigned int type, unsigned int pawn_array[board_size][board_size]);
-bool is_valid_input(int y, int x, unsigned int pawn_array[board_size][board_size]);
bool is_box_type(int y, int x, unsigned int pawn_array[board_size][board_size], unsigned int type);
bool is_board_full(unsigned int pawn_array[board_size][board_size]);
bool is_box_type(int y, int x, unsigned int pawn_array[board_size][board_size], unsigned int type);
bool is_board_full(unsigned int pawn_array[board_size][board_size]);
-unsigned int count_pawn_type(unsigned int pawn_array[board_size][board_size], unsigned int type);
+unsigned int count_pawns_type(unsigned int pawn_array[board_size][board_size], unsigned int type);
+
+unsigned int valid_shot(int y, int x, unsigned int current_player, unsigned int pawn_array[board_size][board_size]);
#endif /* OTHELLO_H */
#endif /* OTHELLO_H */