tsounakis

scissors

Apr 9th, 2020
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.29 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #define N 30
  5.  
  6. char getchoice();
  7. void read();
  8. void loaddict();
  9. void correct();
  10. void save();
  11. void stats();
  12. void legend();
  13.  
  14. int main() {
  15.     char choice;
  16.     legend();
  17.     while(1)
  18.     {      
  19.         printf("Please enter your input: ");
  20.         choice = getchoice();
  21.         switch (choice)
  22.         {
  23.             case 'r':
  24.                 read();
  25.                 break;
  26.             case 'd':
  27.                 loaddict();
  28.                 break;
  29.             case 'c':
  30.                 correct();
  31.                 break;
  32.             case 's':
  33.                 save();
  34.                 break;
  35.             case 'S':
  36.                 stats();
  37.                 break;
  38.             case 'l':
  39.                 legend();
  40.                 break;
  41.             case 'e':
  42.                 return 0;
  43.                 break;
  44.             default:
  45.                 printf("\n*Wrong input*\n");
  46.                 break;
  47.         }
  48.     }
  49. }
  50. char getchoice()
  51. {
  52.     char choice;
  53.     scanf(" %c", &choice);
  54.     return choice;
  55. }
  56.  
  57. void read()
  58. {
  59.     printf("\nText read.\n\n");
  60.     return;
  61. }
  62.  
  63. void loaddict()
  64. {
  65.     printf("\nDictionary inserted.\n\n");
  66.     return;
  67. }
  68.  
  69. void correct()
  70. {
  71.     printf("\nText corrected.\n\n");
  72.     return;
  73. }
  74.  
  75. void save()
  76. {
  77.     printf("\nText saved.\n\n");
  78.     return;
  79. }
  80.  
  81. void stats()
  82. {
  83.     printf("\nStats shown.\n\n");
  84.     return;
  85. }
  86.  
  87. void legend()
  88. {
  89.     printf("L\tE\tG\tE\tN\tD\t:\n[r:\tInsert text]\n[d:\tLoad dictionary]\n[c:\tCorrect the loaded text]\n[S:\tStatistics]\n[s:\tSave text]\n[l:\tShow legend]\n[e:\tEscape]\n\n");
  90.     return;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment