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

Years of Service
User Offline
Joined: 21st Feb 2010
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;

also i added the compiled game


Login to view attachments
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.
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: 2023-09-23 19:35:49
Your offset time is: 2023-09-23 19:35:49