Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / here is a fun c++ game under 20 lines

Author
Message
op117
14
Years of Service
User Offline
Joined: 21st Feb 2010
Location:
Posted: 28th Jun 2010 06:18
try to break the code rules are that you cant post the secret pass word have fun

#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main(){
char myArray[50];
cout << "Whats the password? ";
cin.getline( myArray, 50, '\n');
if( !strcmp( myArray, "pass")){
strcat( myArray, " is correct! Access granted!\n");
} else {
strcpy( myArray, "no you hade the frist part right!\n");
}
cout << myArray;
system("pause");
}


also i added the compiled game

Attachments

Login to view attachments
Madscientist
14
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 7th Jul 2010 16:32
Pointless to try and find the answer when you have the code infront of you.

If it hasn't exploded yet, I haven't touched it.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 3rd Aug 2010 22:55
You should make it so the program randomly generates or selects a password
Also I think this is the wrong place for C++ code.

Login to post a reply

Server time is: 2024-04-24 09:53:27
Your offset time is: 2024-04-24 09:53:27