Generic Linked List

This commit is contained in:
cdricms
2023-12-27 00:36:57 +01:00
parent 5d830528cd
commit 8a91eb1fd0
5 changed files with 101 additions and 7 deletions

View File

@@ -1,11 +1,23 @@
#include "fen.h"
void printInt(void *value) { printf("%d", *(int *)value); }
int main() {
Board board;
FEN fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR";
fen_toBoard(fen, board);
Coordinates *coords = piece_getMoves(board, board[3].piece, board[3].coords);
printf("%d,%d", coords->row, coords->column);
free(coords);
// Board board;
// FEN fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR";
// fen_toBoard(fen, board);
// Coordinates *coords = piece_getMoves(board, board[3].piece,
// board[3].coords); printf("%d,%d", coords->row, coords->column);
// free(coords);
int a = 2;
LinkedList *head = linkedList_init(&a);
int b = 3;
linkedList_insertAt(head, &b, 0);
int c = 6;
linkedList_insertAt(head, &c, 1);
linkedList_print(head, printInt);
linkedList_removeAt(&head, 3);
linkedList_print(head, printInt);
// printf("%d", *(int *)first.value);
return 0;
}