Petite retouche sur simple-terrain.c .
This commit is contained in:
parent
ef8400fa35
commit
a6934e407b
|
@ -1,7 +1,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define SIZE 1024
|
#define SIZE 512
|
||||||
// best value for MAX_DETAIL is 8
|
// best value for MAX_DETAIL is 8
|
||||||
#define MAX_DETAIL 8
|
#define MAX_DETAIL 8
|
||||||
|
|
||||||
|
@ -110,11 +110,13 @@ int get_z(int x, int y) {
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
int y;
|
int y;
|
||||||
int x;
|
int x;
|
||||||
fprintf(stderr, "Aide :\n");
|
if (argc != 1) {
|
||||||
fprintf(stderr, "Utilisez ./simple-terrain | display pour visualiser la sortie.\n");
|
fprintf(stderr, "Aide :\n");
|
||||||
fprintf(stderr, "Utilisez ./simple-terrain > fichier.pnm pour sauvegarder.\n");
|
fprintf(stderr, "Utilisez ./simple-terrain | display pour visualiser la sortie.\n");
|
||||||
printf("P5 %d %d 255\n", SIZE, SIZE);
|
fprintf(stderr, "Utilisez ./simple-terrain > fichier.pnm pour sauvegarder.\n");
|
||||||
for (y=SIZE-1; y>=0; y--)
|
}
|
||||||
for (x=0; x<SIZE; x++)
|
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));
|
printf("%c", (char)get_z(x,y));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user