game_copy + edit README

This commit is contained in:
Thibault Perrier committed 2021-11-28 23:03:01 +01:00
1 parent 4b21f2c17b
commit 3d9f9edb3e
2 files changed
+9 -3

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ Projet Techno
| ------------------------------------ | ---------------------------------------------------------------------------- | ----------- | ----- | :--------------------: |
| [game_new](./game.c#L9-17) | [game game_new(square *squares)](./game.h#L73-81) | @thperrier | | <ul><li>[x] </li></ul> |
| [game_new_empty](./game.c#L19-41) | [game game_new_empty(void)](./game.h#L83-88) | @thperrier | | <ul><li>[x] </li></ul> |
| [game_copy](./game.c#L?) | [game game_copy(cgame g)](./game.h#L90-96) | @thperrier | | <ul><li>[ ] </li></ul> |
| [game_copy](./game.c#L43-51) | [game game_copy(cgame g)](./game.h#L90-96) | @thperrier | | <ul><li>[x] </li></ul> |
| [game_equal](./game.c#L?) | [bool game_equal(cgame g1, cgame g2)](./game.h#L98-106) | @thperrier | | <ul><li>[ ] </li></ul> |
| [game_delete](./game.c#L?) | [void game_delete(game g);](./game.h#L108-113) | @thperrier | | <ul><li>[ ] </li></ul> |
| [game_set_square](./game.c#L?) | [void game_set_square(game g, uint i, uint j, square s)](./game.h#L115-128) | @nnunes | | <ul><li>[ ] </li></ul> |
+8 -2
View File
@@ -40,8 +40,14 @@ game game_new_empty(void) {
return g;
}
game game_copy(cgame g) {
return NULL;
game game_copy(cgame g1) {
game g2 = game_new_empty();
for (int i = 0; i < DEFAULT_SIZE; i++) {
for (int j = 0; j < DEFAULT_SIZE; j++) {
g2->tab_cell[i][j] = g1->tab_cell[i][j];
}
}
return g2;
}
bool game_equal(cgame g1, cgame g2) {