world.h
#ifndef WORLD_H_INCLUDED
#define WORLD_H_INCLUDED
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include "pile.h"
#define NB_PILE_MAX 10
typedef struct
{
int32_t main;
} Robot;
typedef struct
{
Cube* table[NB_PILE_MAX];
Robot robot;
uint32_t nombreCubes;
} World;
bool creer_cube(World* monde);
bool detruire_cube(World* monde);
bool prendre_cube(World* monde, int32_t valeur);
bool poser_cube_sur_table(World* monde);
bool poser_cube_sur_cube(World* monde, int32_t destination);
void initialiser_monde(World* monde);
void afficher_monde(World* monde);
#endif
pile.h
#ifndef PILE_H_INCLUDED
#define PILE_H_INCLUDED
#include <stddef.h>
#include <stdint.h>
typedef struct Cube Cube;
struct Cube
{
int32_t valeur;
Cube* suivant;
};
typedef Cube* PileCube;
void empiler(PileCube* pile, int32_t valeur);
void depiler(PileCube* pile);
int afficher_pile(PileCube pile);
int32_t sommet(PileCube pile);
uint32_t hauteur_pile(PileCube pile);
#endif