From b063bc42c0edd6aa5f460d59dbf4a8f6dcb19c96 Mon Sep 17 00:00:00 2001 From: klmp200 Date: Mon, 26 Dec 2016 18:16:37 +0100 Subject: [PATCH] Ajout de OR et AND --- LibAutomaton/CellElement.c | 16 ++++++++++++++++ LibAutomaton/CellElement.h | 17 +++++++++++++++++ LibAutomaton/matrix.c | 1 - 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/LibAutomaton/CellElement.c b/LibAutomaton/CellElement.c index e0fbfa1..7aa444a 100644 --- a/LibAutomaton/CellElement.c +++ b/LibAutomaton/CellElement.c @@ -137,3 +137,19 @@ void FreeCellElement(cellElement* element) { element = NULL; } + +bool OR(bool a, bool b){ + if (a || b){ + return true; + } else { + return false; + } +} + +bool AND(bool a, bool b){ + if (a && b){ + return true; + } else { + return false; + } +} diff --git a/LibAutomaton/CellElement.h b/LibAutomaton/CellElement.h index 01c44f7..982fa1d 100644 --- a/LibAutomaton/CellElement.h +++ b/LibAutomaton/CellElement.h @@ -144,4 +144,21 @@ int SetNextRow(cellElement* tree,cellElement* elem); void recursivePrint(cellElement * tree); + +/** +* Apply OR operator to a bool a and a bool b +* @param a a bool +* @param b a bool +* @return result a or b +*/ +bool OR(bool a, bool b); + +/** +* Apply AND operator to a bool a and a bool b +* @param a a bool +* @param b a bool +* @return result a and b +*/ +bool AND(bool a, bool b); + #endif diff --git a/LibAutomaton/matrix.c b/LibAutomaton/matrix.c index 88d6e42..dad465a 100644 --- a/LibAutomaton/matrix.c +++ b/LibAutomaton/matrix.c @@ -311,7 +311,6 @@ Matrix freeMatrix(Matrix matrix){ } - /* todos : *finir le freeMatrix *chasser les bugs