What's new

Latest Game

OP
Malcolm

Malcolm

Not a Moderator
Ok here it is.

Yes I know its sloppy but I made it in about 5 mins after Flow`` directed me to the site thats listed at the end of the program.

Code:
/*
for the includes below change the ( to < and ) to >, this is because the forum doesn't display text inside < >
#include (iostream.h)
#include (stdlib.h) //take out for linux
#include (stdio.h) //take out for linux  
*/



int main(){
	char array[99];
	int y=0;
	bool finish=false;

	cout << "This program will read your mind!\nThink of a number with 2 digits (ex: 54)\nSubtract from this number its 2 digits (ex: 54 - 5 - 4 = 45)\nFind the symbol that corresponds to this number\nConsentrate on this number and symbol, \nhit Y then enter for your symbol to be revealed!\n\n";
	while(finish == false){
		for(int x=99;x>=0;x--){
			y++;
			array[x]=35 + (rand()%10);
		}

		array[81]=array[0];
		array[72]=array[0];
		array[63]=array[0];
		array[45]=array[0];
		array[36]=array[0];
		array[27]=array[0];
		array[18]=array[0];
		array[9]=array[0];
		
		for(int j=99;j>=0;j--){
			y++;
			cout << j << ": " << array[j] << "\t";
			
			if(y<=10){
				cout << endl;
				y=0;
			}

		}

		cout << "Are you ready? (Y)";
		cin >>array[1];
		cout << "\nYour symbol is: " << array[0] << "\nMAU HAHAHAHA\n\n**Extracting credit Number**\n\n";
		cout << "Go again? (Y/other)";
		cin >> array[1];
		if (array[1]=='y' || array[1]=='Y'){
			finish=false;
			system("cls"); //comment out for linux
		}
		else{
			finish=true;
			cout << "Y not pressed, ending.\n\nThis game was coded by Malcolm of Emulation64.com/EmuTalk.net\n\nIdea copied from:\nhttp://www.twc.sshunet.nl/~olaudy/MindReader.html\n";
			system("pause"); //comment out for linux
		}
	}
	return 0;	
}

:)

Im a good cheater eh? :p
 
Last edited:

icepir8

Moderator
Malcolm said:
technically it can't be wrong, its actually quite impossible... unless you can't subtract properly...

No Malcolm, It is wrong if you pick any number from 10 to 19.

there must be a bug in your program.

:)
 
OP
Malcolm

Malcolm

Not a Moderator
icepir8 said:
No Malcolm, It is wrong if you pick any number from 10 to 19.

there must be a bug in your program.

:)

Humm... well teaches me for not testing it
 

smcd

Active member
Malcom just a few nitpicks but you never seeded the PRNG and you don't need the stdio.h and you use deprecated C++ header form. :p

A good way to seed it would be

// quotes will work but < > are proper
#include "iostream"
#include "cstdlib"
#include "ctime"

/* lazy way */
using namespace std;

srand((unsigned)time(NULL)); // seed that baby the best we can!


/**//**//**//**//**//**//**/
//revives old[ancient] thread
 

Top