summaryrefslogtreecommitdiff
path: root/lib/piece.c
diff options
context:
space:
mode:
authorRaúl Benencia <rul@kalgan.cc>2015-03-27 12:54:30 -0300
committerRaúl Benencia <rul@kalgan.cc>2015-03-27 12:54:30 -0300
commitecd86e1a263a543e395d9e145294103c0fbb7230 (patch)
tree6ba6874675232df33bf1e24286d171bcc94594fd /lib/piece.c
parent06fa323c65999ce6859bec3e27fa40ca04c17aa5 (diff)
setup piecespieces
Diffstat (limited to 'lib/piece.c')
-rw-r--r--lib/piece.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/piece.c b/lib/piece.c
index bbe0bdc..091d0a5 100644
--- a/lib/piece.c
+++ b/lib/piece.c
@@ -1,4 +1,6 @@
#include <ctype.h>
+#include <stdlib.h>
+
#include "piece.h"
#ifdef UTF8
@@ -51,3 +53,10 @@ int piece_character(Piece p) {
}
#endif
+
+Piece* new_piece(Color c, PieceType t) {
+ Piece* p = malloc(sizeof(Piece));
+ p->color = c; p->type = t;
+
+ return p;
+}
nihil fit ex nihilo