October 29th, 2004, 08:06 PM
|
#1 (permalink)
|
| Senior Member
Join Date: Aug 2004 Location: LA, California
Posts: 812
|
Help please Code: //Spell Poncho
//By me
#include <iostream>
#include <string>
int main ()
{
char one, two, three, four, five, answer, poncho, p, six,o,n,c,h;
int i;
i=1;
{
std::cout << "\t\t-----------------------------------------------\n";
std::cout << "\t\t- Spell Poncho Version 1.0 -\n";
std::cout << "\t\t- How do you spell Poncho? -\n";
std::cout << "\t\t- SPELL PONCHO CORRECT -\n";
std::cout << "\t\t- TO CLOSE THE PROGRAM -\n";
std::cout << "\t\t-----------------------------------------------\n";
std::cout << "\n";
std::cout << "\n";
while (i ==1)
{
{
std::cout << "SPELL PONCHO: ";
std::cin >> one;
std::cin >> two;
std::cin >> three;
std::cin >> four;
std::cin >> five;
std::cin >> six;
}
if (six != 'o' or five !='h' or one !='p' or two !='o' or three !='n' or four !='c')
{
std::cout << "Spelling PONCHO\n";
std::cout << "\n";
std::cout << "\n";
std::cout << "WRONG SPELLING DETECTED!!! IT IS SPELLED PONCHO YOU IDIOT!";
std::cout << "\n";
std::cout << "\n";
std::cout <<"You Spelled: " << one<<two<<three<<four<<five<<six;
std::cout << "\n";
std::cout << "\n";
std::cout << "TRY SPELLING IT AGAIN!";
std::cout << "\n";
std::cout << "\n";
std::cout << "\n";
}
if (six =='o' and five =='h' and one =='p' and two =='o' and three =='n' and four =='c')
{
std::cout << "\n";
std::cout << "\n";
std::cout << "\nGreat job! You spelled: ";
std::cout << one<<two<<three<<four<<five<<six;
std::cout << "\n";
std::cout << "\n";
}
}
}
} Here is my source.
I need to know how to reset the variables one,two,three,four,five,six because if they misspell poncho one time then every other time poncho will be misspelled no matter what happens because the variables are not cleared.
Can someone tell me how to clear/reset these variables?
__________________
People are like coins, there's always two sides.
Last edited by TechKnickle : October 29th, 2004 at 08:07 PM.
Reason: Fix title
|
| |