Guest User

Untitled

a guest
Jul 15th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. void play_monotris(char* game) {
  6. char* alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  7. char* pos = 0;
  8.  
  9. while(*game++) {
  10. printf("char: %c\n", *game);
  11. if(*game != ' ') {
  12. pos = strchr(alphabet, game);
  13. printf("pos: %c\n", *pos);
  14. } else printf("space.\n");
  15. }
  16. }
  17.  
  18. int main(int argc, char** argv) {
  19. char game[1000];
  20. scanf("%[^\n]s", game);
  21. play_monotris(game);
  22. // printf("%s\n", game);
  23. return 0;
  24. }
Add Comment
Please, Sign In to add comment