www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit a6934e407baebdc9ba9838bc98ad6a59509e492e
parent ef8400fa359ce40e19bf1d3f58e79a67bed64e8f
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date:   Mon, 26 Sep 2011 22:45:11 +0200

Petite retouche sur simple-terrain.c .

Diffstat:
Msimple-terrain.c | 16+++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/simple-terrain.c b/simple-terrain.c @@ -1,7 +1,7 @@ #include <stdio.h> #include <math.h> -#define SIZE 1024 +#define SIZE 512 // best value for MAX_DETAIL is 8 #define MAX_DETAIL 8 @@ -110,11 +110,13 @@ int get_z(int x, int y) { int main(int argc, char** argv) { int y; int x; - fprintf(stderr, "Aide :\n"); - fprintf(stderr, "Utilisez ./simple-terrain | display pour visualiser la sortie.\n"); - fprintf(stderr, "Utilisez ./simple-terrain > fichier.pnm pour sauvegarder.\n"); - printf("P5 %d %d 255\n", SIZE, SIZE); - for (y=SIZE-1; y>=0; y--) - for (x=0; x<SIZE; x++) + if (argc != 1) { + fprintf(stderr, "Aide :\n"); + fprintf(stderr, "Utilisez ./simple-terrain | display pour visualiser la sortie.\n"); + fprintf(stderr, "Utilisez ./simple-terrain > fichier.pnm pour sauvegarder.\n"); + } + printf("P5 %d %d 255\n", SIZE, SIZE); + for (y=SIZE-1; y>=0; y--) + for (x=0; x<SIZE; x++) printf("%c", (char)get_z(x,y)); }