APL/APL1.2/TP06/arc_en_ciel.c

41 lines
735 B
C
Raw Normal View History

2022-01-04 13:49:41 +01:00
#include <stdio.h>
#include <stdlib.h>
#include <graph.h>
#include "graph_sup.h"
struct block_ {
char* value;
struct block_* next;
};
typedef struct block_ block;
typedef block* list;
int main(int argc, char * argv[]) {
InitialiserGraphique();
CreerFenetre(100, 100, 800, 200);
block violet = {"purple", NULL};
block indigo = {"indigo", &violet};
block bleu = {"blue", &indigo};
block vert = {"green", &bleu};
block jaune = {"yellow", &vert};
block orange = {"orange", &jaune};
block rouge = {"red", &orange};
violet.next = &rouge;
list l = &rouge;
while(1) {
if (DrawNextFrame()) {
SetColorN(l->value);
EcrireTexte(200, 50, argv[1], 2);
l = l->next;
}
}
FermerGraphique();
return EXIT_SUCCESS;
}