boxes

Tracer des diagrammes dans un terminal - retour accueil

git clone git://bebou.netlib.re/boxes

Log | Files | Refs | README |

commit ee684e4bec123db1c776b8142cefcedd70165ad2
parent 66cc81669b8f0489931415705f406b003f819fd3
Auteurice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Fri, 13 Jun 2025 22:51:04 +0200

Retrait de min et max

Pas besoin pour le moment

Diffstat:
Mboxes.c | 5+----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/boxes.c b/boxes.c @@ -3,9 +3,6 @@ #define MAX_BOX_NB 100 -int max(int a, int b) { return a > b ? a : b; } -int min(int a, int b) { return a < b ? a : b; } - struct box { int x; int y; int h; int w; }; struct pile { struct box* list; int count; }; @@ -40,7 +37,7 @@ void addbox(struct pile *boxes, struct box b) { void deletebox(struct pile *boxes, int index) { for (int i=index;i<boxes->count-1;i++) boxes->list[i]=boxes->list[i+1]; - boxes->count=max(0,boxes->count-1); + if(boxes->count>0) boxes->count--; } int main(int argc, char **argv) {