Skip to content
Snippets Groups Projects
tools.c 1.62 KiB
Newer Older
Wadi.T's avatar
Wadi.T committed
#include <stdio.h>
#include <stdlib.h>
#include "tools.h"

/**********************************************************/
/**********************************************************/
void clearScreen()
{
   system("clear"); // Linux
  // system("CLS");   // Windows
}

/**********************************************************/
/**********************************************************/
void clearBuffer()
{
   char Dummy;

   do
   {
      scanf("%c", &Dummy);
   } while (Dummy != '\n');
}

/**********************************************************/
/**********************************************************/
void waitForEnter()
{
   printf("\nBitte Eingabetaste druecken ...");
   clearBuffer();
}

/**********************************************************/
/**********************************************************/
int askYesOrNo(char *Question)
{
   char Input;

   do
   {
      printf("%s", Question);
      scanf("%c", &Input);
      if (Input != '\n')
         clearBuffer();
   } while ((Input != 'j') && (Input != 'J') && (Input != 'n') && (Input != 'N'));
   return ((Input == 'j') || (Input == 'J'));
T.Wadi's avatar
T.Wadi committed
}
/**********************************************************/
/**********************************************************/
void PrintLogo ()
{
   FILE *titel = fopen("Logo.txt","r");
T.Wadi's avatar
T.Wadi committed
   char output[150];
   if(titel)
   {
   while(!feof(titel)){
      fgets(output,150,titel);
      printf("%s",output);  
         }
      puts("\n");
      }
   else {
      puts("Logo not found\n");
      exit(1);
   }
}

/**********************************************************/
/**********************************************************/