Advertisement
Guest User

softEng

a guest
Feb 27th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <time.h>
  3. #include <string.h>
  4. #include <stdlib.h>
  5.  
  6.  
  7. int key1;
  8. char arr[7][3][20];
  9. int findElement(int key, char slotInformation[7][3][20];);
  10.  
  11. int main(void) {
  12. int ini;
  13. int both =0;;
  14. int inputCount =0;
  15. char line[1000];
  16. char slotInformation[7][3][20];
  17. char sortedSlots[7][3][20];
  18. int i =0;
  19. int j;
  20. char player[10][2][20];
  21. char blank[100];
  22. int numPlay;
  23. int typePlay;
  24. const char One[] = "Elf";
  25. const char Two[] = "Human";
  26. const char Three[] = "Ogre";
  27. const char Four[] = "Wizard";
  28.  
  29. printf("Please Enter The Number of Players Playing (Max 6)\n");
  30.  
  31. scanf("%d", &numPlay);
  32.  
  33. printf("Now Please Enter The Names of Players Playing\n");
  34.  
  35. for (i=0; i<numPlay; i++){
  36.  
  37. scanf("%s", &player[i][1]);
  38.  
  39. }
  40. for (i=0; i<numPlay; i++){
  41.  
  42. printf("%s", player[i][1]);
  43.  
  44. }
  45. printf("\n\nFor The Following Please enter\n1 for Type: Elf\n2 for Type: Human\n3 for Type: Ogre\n4 for Type: Wizrd\n");
  46. for (i=0; i<numPlay; i++){
  47. printf("Now Please Enter The Type of %s\n", player[i][1]);
  48. scanf("%d", &typePlay);
  49.  
  50. if (typePlay == 1){
  51. sscanf(One, "%s", player[i][2]);
  52. }
  53. if (typePlay == 2){
  54. sscanf(Two, "%s", player[i][2]);
  55. }
  56. if (typePlay == 3){
  57. sscanf(Three,"%s", player[i][2]);
  58. }
  59. if (typePlay == 4){
  60. sscanf(Four, "%s", player[i][2]);
  61. }
  62.  
  63. }
  64. printf("The Players Are:");
  65. for (i=0; i<numPlay; i++){
  66. printf("%s %s\n", player[i][1],player[i][2]);
  67. }
  68. return 0;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement