changement yvan
This commit is contained in:
6
Makefile
6
Makefile
@@ -1,8 +1,8 @@
|
|||||||
OFILES = main.o mouvements_controller.o
|
OFILES = mars_main.o
|
||||||
main.out: $(OFILES)
|
main.out: $(OFILES)
|
||||||
gcc ${OFILES} -o main.out -lgraph
|
gcc ${OFILES} -o main.out -lgraph
|
||||||
mouvements_controller.o: mouvements_helper.o mouvements_controller.h mouvements_controller.c
|
mars_main.o: mars_main.c mars_types.h
|
||||||
gcc -ansi -c mouvements_controller.c
|
gcc -c mars_main.c
|
||||||
clean:
|
clean:
|
||||||
rm *.o *.out
|
rm *.o *.out
|
||||||
.PHONY: clean
|
.PHONY: clean
|
44
mars_main.c
Normal file
44
mars_main.c
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
#include<stdio.h>
|
||||||
|
#include<stdlib.h>
|
||||||
|
#include<time.h> /* Utilisé pour obtenir une adresse de démarrage aléatoire */
|
||||||
|
#include"mars_types.h" /* importe les types utilisés dans le programme */
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char* argv[]){
|
||||||
|
int position_player1, position_player2; /* Permet de connaître la position des joueurs dans la mémoire */
|
||||||
|
struct adresse memoire[8000]; // Initialisation de la mémoire 0->7999
|
||||||
|
|
||||||
|
if (argc < 3){
|
||||||
|
printf("Vous n'avez pas rentrez assez d'arguments \n");
|
||||||
|
printf("Exemple d'utilisation: %s fichier1.ass fichier2.ass\n", argv[0]);
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
} else if (argc > 3){
|
||||||
|
printf("Vous avez utilisé trop d'arguments \n");
|
||||||
|
printf("Exemple d'utilisation: %s fichier1.ass fichier2.ass\n", argv[0]);
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
FILE* fichier1;
|
||||||
|
FILE* fichier2;
|
||||||
|
|
||||||
|
fichier1 = fopen(argv[1], "r");
|
||||||
|
fichier2 = fopen(argv[2], "r");
|
||||||
|
|
||||||
|
if(fichier1 == NULL || fichier2 == NULL){
|
||||||
|
printf("Erreur d'ouverture du fichier !\n");
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Fichier 1: %s\n", argv[1]);
|
||||||
|
printf("Fichier 2: %s\n", argv[2]);
|
||||||
|
|
||||||
|
fclose(fichier1);
|
||||||
|
fclose(fichier2);
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
/* To do: faire le programme qui lit le fichier compilé */
|
||||||
|
}
|
||||||
|
|
||||||
|
void write_at_adresse(int adresse, int player, int valeur){
|
||||||
|
return;
|
||||||
|
}
|
7
mars_reader.c
Normal file
7
mars_reader.c
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#include<stdlib.h>
|
||||||
|
#include<stdio.h>
|
||||||
|
#include<string.h>
|
||||||
|
|
||||||
|
void ouvrir_fichier(char* path){
|
||||||
|
|
||||||
|
}
|
5
mars_reader.h
Normal file
5
mars_reader.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#ifndef MARS_READER_H
|
||||||
|
|
||||||
|
#define MARS_READER_H
|
||||||
|
|
||||||
|
#endif
|
11
mars_types.h
Normal file
11
mars_types.h
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#ifndef MARS_TYPES_H
|
||||||
|
|
||||||
|
#define MARS_TYPES_H
|
||||||
|
|
||||||
|
struct adresse {
|
||||||
|
int player;
|
||||||
|
int valeur;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
Reference in New Issue
Block a user