I decieded to make a program that translates a phrase in english to "1337" or "elite". I have searched this website and others and can't find an answer to the error I'm getting. Thanks for any help :).
Btw I'm using Bloodshed Dev C++, not sure if that matters.
/*
Author: Cclausen7
Date: 10/15/10
Purpose: English to Elite
*/
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
//Function Declarations
void enterGameLoop();
string askWord(string prompt);
string convertWord(string word);
//Global Variable Declarations
string word = " ";
string again = "n";
//Array declaration
string alphabet= "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string leet[26]={"4","13","(","D","E","pH","9","|-|","1","j","|<","L","/\\/\\","|\\|","0","P","Q","R","5","7","|_|","\\/","\\/\\/","><","Y","2"};
int main()
{
//Changes text color to look more awesome
system("color 02");
//Enters the main game loop for the program
enterGameLoop();
return 0;
}
void enterGameLoop()
{
do
{
//Asks for a word form the user
word = askWord("\n\nEnter a word/phrase below\n\n>");
//Converts e's to 3's
word = convertWord(word);
//Displays converted word and asks if they want to go again
cout << word << "\n\nThe size of the word/phrase is " << word.size() << " characters\n\nDo you want to enter another word y/n?\n\n>";
getline(cin,again);
}
while(again == "y");
}
string askWord(string prompt)
{
system("CLS");
string word;
cout << prompt;
getline(cin,word);
cout << "\n\n" << word << " -> ";
return word;
}
string convertWord(string word)
{
for(int counter=0; counter < word.size(); counter++)
{
for(int i; i < 26; i++)
{
if (word[counter] == alphabet[i])
{
word[counter] = leet[i];
}
}
}
return word;
}