1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include <string>
#include <cstring>
#include <string.h>
#include <stdio.h>
using namespace std;
void order1hint()
{
cout<<"Sir, the first order to the sentry is to take charge of **** **** and *** gove****** prop**** i* ****, sir.\n";
}
void order2hint()
{
cout<<"Sir, the second order to the sentry is to **** my post in a mi****** mann**, keeping always on the a***t and re***t*ng eve*y*h*ng that takes pl*c* within si** or h*ari*g, sir.\n";
}
void order3hint()
{
cout<<"Sir, the third order to the sentry is to r****t all vio*a*i*ns of orders I am instructed to enforce, sir.\n";
}
void order4hint()
{
cout<<"Sir, the fourth order to the sentry is to ****** all calls from post more d*s*ant from the g**rdhouse (quarter-deck) than my own, sir.\n";
}
void order5hint()
{
cout<<"Sir, the fifth order to the sentry is to quit my post only when pr*pe*ly rel*e*ed, sir.\n";
}
int main()
{
int orderchosen2;
int orderchosen;
string orderguess;
string orderguessfix;
string order1("Sir, the first order to the sentry is to take charge of this post and all government property in view, sir.");
string order2("Sir, the second order to the sentry is to walk my post in a military manner, keeping always on the alert, and reporting everything that takes place within sight or hearing, sir.");
string order3("Sir, the third order to the sentry is to report all violations of orders I am instructed to enforce, sir.");
string order4("Sir, the fourth order to the sentry is to repeat all calls from post more distant from the guardhouse (quarter-deck) than my own, sir.");
string order5("Sir, the fifth order to the sentry is to quit my post only when properly relieved, sir.");
string hint("hint");
cout<<"This program is designed to help you learn and memorize the Orders Of the Sentry as quickly as possible. \
\n Use it as needed.\n";
CHECKPOINTONE:
cout<<"Type in the name of the sentry you want to see.\n";
cout<<"Order to the sentry: 1\nOrder to the sentry: 2\nOrder to the sentry: 3\nOrder to the sentry: 4\nOrder to the sentry: 5\n";
cin>>orderchosen;
switch(orderchosen)
{
case 1:
cout<<"Sir, the first order to the sentry is to take charge of this post and all government property in view, sir.";
cin.get();
break;
case 2:
cout<<"Sir, the second order to the sentry is to walk my post in a military manner, keeping always on the alert and reporting everything that takes place within site or hearing, sir.";
cin.get();
break;
case 3:
cout<<"Sir, the third order to the sentry is to report all violations of orders I am instructed to enforce, sir.";
cin.get();
break;
case 4:
cout<<"Sir, the fourth order to the sentry is to repeat all calls from post more distant from the guardhouse (quarter-deck) than my own, sir.";
cin.get();
break;
case 5:
cout<<"Sir, the fifth order to the sentry is to quit my post only when properly relieved, sir.";
cin.get();
break;
default:
cout<<"That sentry is not included.\n";
goto CHECKPOINTONE;
cin.get();
break;
cin.get();
}
cin.get();
cout<<"*********************** NJROTC SENTRY ORDERS STUDY GUIDE*************************\n";
cout<<"\n\n\nIf at any time you need a hint for your current Order, type in \"hint\" when prompted\nfor \
your guess.\n";
cout<<"What order do you want to guess? Enter its number.\n";
cin>>orderchosen2;
cout<<"Remember, capitals and sir at the beginning and end of the Order count.\n";
cout<<"Press the space bar when ready.\n";
cin.get();
Sleep(5000);
switch(orderchosen2)
{
case 1:
CHECKPOINTTWO:
cout<<"Enter your guess...";
Sleep(5000);
cout<<" now.\n";
getline(cin, orderguessfix, '\n');
if (strcmp (orderguessfix.c_str(),order1.c_str() ) == 0)
{
cout<<"Correct.\n";
cin.get();
}
else if (strcmp (orderguessfix.c_str(), hint.c_str() ) == 0)
{
order1hint();
goto CHECKPOINTTWO;
}
else {
cout<<"Wrong.\n";
cin.get();
}
case 2:
CHECKPOINTTHREE:
cout<<"Enter your guess...";
Sleep(5000);
cout<<" now.\n";
getline(cin, orderguessfix, '\n');
if (strcmp (orderguessfix.c_str(),order2.c_str() ) == 0)
{
cout<<"Correct.\n";
cin.get();
}
else if (strcmp (orderguessfix.c_str(),hint.c_str() ) == 0)
{
order2hint();
goto CHECKPOINTTHREE;
}
else {
cout<<"Wrong.\n";
goto CHECKPOINTTHREE;
}
case 3:
CHECKPOINTFOUR:
cout<<"Enter your guess...";
Sleep(5000);
cout<<" now.\n";
getline(cin, orderguessfix, '\n');
if (strcmp (orderguessfix.c_str(),order3.c_str() ) == 0 )
{
cout<<"Correct.\n";
goto CHECKPOINTRANDOM;
}
else if (strcmp (orderguessfix.c_str(),hint.c_str() ) == 0 )
{
order3hint();
goto CHECKPOINTFOUR;
}
else {
cout<<"Wrong.\n";
goto CHECKPOINTFOUR;
}
case 4:
CHECKPOINTFIVE:
cout<<"Enter your guess...";
Sleep(5000);
cout<<" now.\n";
getline(cin, orderguessfix, '\n');
if (strcmp (orderguessfix.c_str(),order4.c_str() ) == 0)
{
cout<<"Correct.\n";
}
else if (strcmp (orderguessfix.c_str(),hint.c_str() ) == 0)
{
order4hint();
goto CHECKPOINTFIVE;
}
else {
cout<<"Wrong.\n";
goto CHECKPOINTFIVE;
}
case 5:
CHECKPOINTSIX:
cout<<"Enter your guess...";
Sleep(5000);
cout<<" now.\n";
getline(cin, orderguessfix, '\n');
if (strcmp (orderguessfix.c_str(),order5.c_str() ) == 0 )
{
cout<<"Correct.\n";
}
else if (strcmp (orderguessfix.c_str(),hint.c_str() ) == 0 )
{
order5hint();
goto CHECKPOINTSIX;
}
else {
cout<<"Wrong.\n";
}
CHECKPOINTRANDOM:
cin.get();
}
cin.get();
}
| |