Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void c15Puzzle_main(){
- char name[1000];
- fflush(stdin);
- printf("enter ur name\n");
- scanf("%s",&name);
- fflush(stdin);
- User *user=createUser(name);
- int rows=4, cols=4;
- int sourceTable[][4] = {
- { 1, 2, 3, 4 },
- { 5, 6, 7, 8 },
- { 9,10, 11, 12 },
- {13, 14, 0,15 }
- };
- Board *temp=createBoard(rows,cols);
- initializeBoard(temp, (int *)sourceTable, 4, 4);
- clearAndRedrawScreen(temp);
- printUser(user);
- char choice;
- while (choice=takeInput())
- {
- playMove(temp,user,choice);
- if (checkBoard(temp)){
- printf("\nGame is completed in %d Moves ,Good work %s\n", user->movesCount, user->name); break;
- }
- }
- }
Add Comment
Please, Sign In to add comment