Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int testnumber();
  6. int b;
  7. int x;
  8. int a;
  9.  
  10. int main()
  11. {
  12. cout << "Please select a level of difficulty" << endl;
  13. cout << "The level of difficulty ranks from 1 through to 6" << endl;
  14. cout << "Please select anywhere from 1, being the easiest, to 6 being the hardest" << endl;
  15. cin >> x;
  16. cout << "You have 5 guesses at the number" << endl;
  17.  
  18. if(x==1){
  19. b=37;
  20. cout << "The number is between 1 and 100" << endl;
  21. };
  22. if(x==2){
  23. b=142;
  24. cout << "The number is between 1 and 200" << endl;
  25. };
  26. if(x==3){
  27. b=96;
  28. cout << "The number is between 1 and 300" << endl;
  29. };
  30. if(x==4){
  31. b=311;
  32. cout << "The number is between 1 and 400" << endl;
  33. };
  34. if(x==5){
  35. b=184;
  36. cout << "The number is between 1 and 500" << endl;
  37. };``````
  38. if(x==6){
  39. b=422;
  40. cout << "The number is between 1 and 600" << endl;
  41. };
  42.  
  43. if(testnumber()==0){
  44. return 0; }
  45. if(testnumber()==0){
  46. return 0; }
  47. if(testnumber()==0){
  48. return 0; }
  49. if(testnumber()==0){
  50. return 0; }
  51. if(testnumber()==0){
  52. return 0; }
  53. cout << "The game has ended, and you have failed, YOU'RE A FUCKING SHIT CUNT!." << endl;
  54. return 0;
  55. }
  56.  
  57. int testnumber()
  58. {
  59. cout << "Please enter your guess" << endl;
  60. cin >> a;
  61. if(a>b) {
  62. cout << "The number is lower than " << a << endl;
  63. }
  64. if(a<b) {
  65. cout << "The number is higher than " << a << endl;
  66. }
  67. if (a==b) {
  68. cout << "The number is correct" <<endl;
  69. return 0;
  70. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement