Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- Simple string program for chatting.
- Ok, so anyways..the program doesn't save when you close it, which will be fixed.
- This is the basic source code, and took awhile to make.
- Beta Features:
- Login works great. (Still has a few bugs)
- Program is stable
- --------------------------------------------------------------------------------
- Beta To-Do-List:
- Create Account Process Added
- Chat Process Added
- Connected to the net
- Graphics
- --------------------------------------------------------------------------------
- */
- #include <iostream>
- #include <cstring>
- using namespace std;
- char username[25];
- char password[30];
- char email[50];
- char answer[10];
- int loggedin = 0;
- int invalid = 0;
- int FriendsOnline = 0;
- int isdoingpassword = 0;
- int input;
- int main()
- {
- // Some information on the program.
- printf("Thank you for using Chat Test Beta 1\n"); // Displays a print message (or outputs) I chose to use printf instead of cout
- printf("Your username and password is: UN: thebigdick123 PS: fuck\n\n");
- // The fun begins.
- // If the username or password is invalid (1) this will happen
- if ( invalid == 1 ) {
- printf("Invalid username or password, please restart the program");
- cin.get();
- }
- // This checks if the user is logged in
- if ( loggedin == 0 ) {
- printf("Username: ");
- cin.getline ( username, 25 ); // Reads the input for the username
- // If the user is not typing in his/her's password
- if ( isdoingpassword == 0 ) {
- if ( strcmp ( username, "thebigdick123" ) == 0 ) // If the username is as listed above
- isdoingpassword += 1;
- else
- printf("Invalid username or password");
- cin.get(); // Waits for the user to press enter
- }
- // If the user is typing in his/her password
- if ( isdoingpassword == 1 ) {
- printf("Password: ");
- cin.getline ( password, 30 ); // Reads the input for the username
- cin.ignore();
- if ( strcmp ( password, "fuck" ) == 0 ) // If the password is as listed above
- cout << "Welcome, " << username << "! You are now logged in.\n\n";
- loggedin += 1;
- }
- }
- // If the user is logged in
- if ( loggedin == 1 ) {
- // Now in INT MAIN
- printf("Actions:\n");
- printf("1. Friends Online\n");
- printf("2. My Profile\n");
- printf("Selection: ");
- cin >> input;
- // Beginning my cases!
- switch ( input ) {
- case 1:
- if ( FriendsOnline <= 1 ) {
- printf("You have no friends online!");
- cin.get();
- } else if ( FriendsOnline >= 0 ) {
- cout << "You have " << FriendsOnline << " Online!";
- cin.get();
- }
- break;
- case 2:
- printf("This feature has not been added yet!");
- cin.get();
- break;
- default:
- printf("That option has not been added yet!");
- cin.get();
- break;
- }
- }
- cin.get();
- } // Int Main Closing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement