#include #include #include "ball.h" struct ball * new_ball(int x, int y) { struct ball *b; b = malloc(sizeof(*b)); if (b == NULL) { return NULL; } b->x = x; b->y = y; return b; } void free_ball(struct ball *b) { free(b); } void clear_ball(struct ball *b) { mvprintw(b->y, b->x, " "); } void update_ball(struct ball *b) { ++b; } void draw_ball(struct ball *b) { mvprintw(b->y, b->x, "o"); }