Guest User

Untitled

a guest
Jun 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int roullette()
  6. {
  7. srandom(time(NULL));
  8. int bullet = random() % 13;
  9. int spin = random() % 13;
  10.  
  11. printf("Bullet: %d\n", bullet);
  12. printf("Spin: %d\n", spin);
  13.  
  14. if ( bullet == spin )
  15. {
  16. return 1;
  17. } else {
  18. return 0;
  19. }
  20. }
  21.  
  22. int main()
  23. {
  24. if ( roullette() == 1)
  25. {
  26. printf("BAM, you're dead!\n");
  27. } else {
  28. printf("You survived!\n");
  29. }
  30. return 0;
  31. }
Add Comment
Please, Sign In to add comment