Advertisement
j0h

dialog.c

j0h
May 4th, 2023
1,024
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4. #include <string.h>
  5.  
  6. void rollOut(char *startup);
  7.  
  8.    
  9. int main(int argc, char **argv){
  10.         if(argc !=2){
  11.         printf("Usage: %s text to encode in qoutes\n",argv[0]);
  12.         return 0;
  13.         }
  14.     char *startup= argv[1];
  15. rollOut(startup);
  16. return 0;
  17. }
  18.  
  19. void rollOut(char *startup){
  20.     usleep(10000);
  21.     int size = strlen(startup);
  22.     for (int a = 0; a < size; a++){
  23.         if(startup[a]=='\\'&& startup[a+1]=='n'){
  24.             printf("\n");
  25.             a=a+2;
  26.             }
  27.         setvbuf(stdout, NULL, _IONBF, 0);
  28.         printf("%c", startup[a]);
  29.         usleep(60000);
  30.     }
  31.     printf("\n");
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement