boxes

Tracer des diagrammes dans un terminal - retour accueil

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

Log | Files | Refs | README |

commit 7dfd13c5626304365b119ee8c9c9a35380bcdd16
parent 61b6a1ec36f657b3b53873a46f29d3e789e63c7e
Auteurice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Fri, 13 Jun 2025 21:03:28 +0200

On gagne quelques lignes, rien de modif

Diffstat:
Mboxes.c | 15+++------------
1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/boxes.c b/boxes.c @@ -8,12 +8,7 @@ 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 box { int x; int y; int h; int w; }; void drawboxcoord(int x, int y, int w, int h) { if(w<0) { x=x+w; w=-w; } @@ -33,14 +28,10 @@ void drawboxcoord(int x, int y, int w, int h) { tb_printf(30,0,TB_DEFAULT,TB_DEFAULT,"x: %d, y: %d\nw: %d, h: %d",x,y,w,h); } -void drawbox(struct box b) { - drawboxcoord(b.x,b.y,b.w,b.h); -} +void drawbox(struct box b) { drawboxcoord(b.x,b.y,b.w,b.h); } struct box createbox(int x, int y, int w, int h) { - struct box b; - b.x=x; b.y=y; b.w=w; b.h=h; - return b; + struct box b; b.x=x; b.y=y; b.w=w; b.h=h; return b; } int main(int argc, char **argv) {