Guest User

Untitled

a guest
May 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2. void c15Puzzle_main(){
  3. char name[1000];
  4. fflush(stdin);
  5. printf("enter ur name\n");
  6.  
  7. scanf("%s",&name);
  8. fflush(stdin);
  9. User *user=createUser(name);
  10. int rows=4, cols=4;
  11. int sourceTable[][4] = {
  12. { 1, 2, 3, 4 },
  13. { 5, 6, 7, 8 },
  14. { 9,10, 11, 12 },
  15. {13, 14, 0,15 }
  16. };
  17. Board *temp=createBoard(rows,cols);
  18. initializeBoard(temp, (int *)sourceTable, 4, 4);
  19. clearAndRedrawScreen(temp);
  20. printUser(user);
  21. char choice;
  22. while (choice=takeInput())
  23. {
  24.  
  25. playMove(temp,user,choice);
  26. if (checkBoard(temp)){
  27. printf("\nGame is completed in %d Moves ,Good work %s\n", user->movesCount, user->name); break;
  28. }
  29. }
  30.  
  31. }
Add Comment
Please, Sign In to add comment