Basically, you need to read in text from one file and output to another file, except translated to 1337. I have trouble understanding ifstream and such. This is what I have so far:
#include <iostream>
#include <stdlib.h>
#include <fstream>
usingnamespace std;
int main(int argc, char *argv[])
{
ifstream i("message.txt");
ofstream o("Thomas_leet_message.txt");
string s = "";
string temp = "";
while( !i.eof() ) //eof means end of file
{
for(int i=0; i<temp.length(); i++)
{
if
}
// read in your whole message into s
// concatinate word by word seperated by spaces and other punc marks
}
//do your translation here
// Use my .exe as a guide to know what english letter translates to what lee7 letter
i.close();
o.close();
// cout << s << endl;
// system("PAUSE");
return 0;
}
L337 Translator Program
Intro:
L337 ( or leet, or elite speak ) is a written form of internet slang – primarily used by online gamers and hackers. Leet Speak is a very basic form of encryption in the sense that English characters are written using 1 or more combination of characters.
For example:
H in leet is |-| .
Notice how |-| uses 3 characters – but still appears to look like the H.
Another example:
Town 70\/\/|\|
For more info on L337 visit : http://en.wikipedia.org/wiki/L337
Instructions:
You are to write a C++ program that translates a text file “message.txt” to another text file “lastnameF_leet_message.txt”. You must use ifstream to read from “message.txt” and ofstream to write to “lastnameF_leet_message.txt”
Your program will have no user interface – which means the user of this program will not see any questions, instructions, or options. The user will not interact with your program at all. All the user will do is simply double-click on the executable, and the message will be translated.
Note:
• Your message filename must be “message.txt”
• Your executable and “message.txt” must be in the same folder
• Your translated file must be named “LastnameF_leet_message.txt”
Translation:
Since there are several ways to translate characters in L337 speak, use the table below as the standard for your program (for both capital and lower-case letters)
English L337 English L337
A 4 P p
B I3 Q Q
C ( R r
D D S $
E 3 T 7
F pH U U
G 9 V \/
H |-| W \/\/
I 1 X ><
J j Y '/
K |< Z Z
L L
M /\/\
N |\|
O 0
Hints/How to do it?
• Store whole message into a string (using ifstream and .eof() )
• Loop Through each character in the string and if it is one of the English Alphabet Letters, translate using table above