Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C++/C Programming › need some code xD

need some code xD

Posts 1–9 of 9 · Page 1 of 1
AR
Arii
need some code xD
so i want some code and i want to share it to MPGH so give me some C++ code what ever code give it so u guys can enjoy hacking don't blame me for my bad english
#1 · 15y ago
NA
Nathan
You want some code so you can give us that same code back?
#2 · 15y ago
TO
Toxic Waltz
Enjoy your code!
Code:
//            .-'''-.                            _..._                                              
//           '   _    \                       .-'_..._''.                 .---.                     
//         /   /` '.   \              .--.  .' .'      '.\                |   |                     
//        .   |     \  '              |__| / .'             _     _       |   |                     
//     .| |   '      |  '             .--.. '         /\    \\   //       |   |     .|              
//   .' |_\    \     / /____     _____|  || |         `\\  //\\ //  __    |   |   .' |_             
// .'     |`.   ` ..' /`.   \  .'    /|  || |           \`//  \'/.:--.'.  |   | .'     |.--------.  
//'--.  .-'   '-...-'`   `.  `'    .' |  |. '            \|   |// |   \ | |   |'--.  .-'|____    |  
//   |  |                  '.    .'   |  | \ '.          .'     `" __ | | |   |   |  |      /   /   
//   |  |                  .'     `.  |__|  '. `._____.-'/       .'.''| | |   |   |  |    .'   /    
//   |  '.'              .'  .'`.   `.        `-.______ /       / /   | |_'---'   |  '.' /    /___  
//   |   /             .'   /    `.   `.               `        \ \._,\ '/        |   / |         | 
//   `'-'             '----'       '----'                        `--'  `"         `'-'  |_________| 


#include <iostream>
#include <windows.h>
#include <winbase.h>

using namespace std;

const int FieldWidth = 50;
const int FieldHeigth = 30;
const int Area= FieldWidth*FieldHeigth;
unsigned char Field [FieldWidth*FieldHeigth];
int Body[100];
int Direction=1;
int Length = 2;
int StartTime;
int Delay=100;
int bbq;
bool alive=true;

#include <stdlib.h>
#include <time.h>

void DrawScreen();
void CheckDirection();

void CreateSnake();
void Food();
void MoveSnake();
void GameOver();
void PutTheSnakeInTheField();

int main()
{
	srand ( time(NULL) );
	CreateSnake();
	Food();
	StartTime=GetTickCount();

	while(alive)
	{
		if((int)GetTickCount()>(StartTime+Delay))
		{
			system("cls");
			StartTime=GetTickCount();
			CheckDirection();
			PutTheSnakeInTheField();
			DrawScreen();
		}
		Sleep(10);
		
		
	}
	

	system("pause");
	return 0;


}

void DrawScreen()
{
	if(!alive)
	{
		for(int i=0; i<Area;i++)
		{
			Field[i]=176;
		}
	}
	for(int i=0; i <(FieldWidth+2);i++)
	{
		cout<<"#";
	}
	cout<<endl;
	
	for(int i=0; i<FieldHeigth; i++)
	{
		cout<<"#";
		for (int j =0;j<FieldWidth; j++)
		{
			cout<< Field [(FieldWidth*i)+j];
		}
		cout<<"#";
		cout<<endl;
	}
	for(int k=0; k <(FieldWidth+2);k++)
	{
		cout<<"#";
	}
	cout<<endl;
	
}

void CreateSnake()
{
	Body[0]=Area/2-FieldWidth/2;
	Body[1]=Area/2-FieldWidth/2-1;
	Body[2]=Area/2-FieldWidth/2-2;
}

void Food()
{
	
	do
	{
		bbq = rand()%Area;
	}while(Field[bbq]);
	Field[bbq]=229;
}

void PutTheSnakeInTheField()
{
	if(Body[0]+Direction==bbq)
	{
		Length++;
		Food();
	}
	else if((Field[Body[0]+Direction])==167)GameOver();
	else
	{
		switch(Direction)
		{
			case 1:
				if(!((Body[0]+1)%FieldWidth))GameOver();
				break;
			case (FieldWidth):
				if((Body[0]/FieldWidth)==FieldHeigth-1)GameOver();
				break;
			case -1:
				if(!(Body[0]%FieldWidth))GameOver();
				break;
			case (-FieldWidth):
				if(!(Body[0]/FieldWidth))GameOver();
				break;
		}
		Field[Body[Length]]='\0';
	}
	MoveSnake();
	Field[Body[0]]=235;
	for(int i=1;i<Length;i++)
	{
		Field[Body[i]]=167;
	}
}


void MoveSnake()
{
	for(int i=Length;i>0;i--)
	{
		Body[i]=Body[i-1];//klopt dit wel? //yup, als een bus
	}
	Body[0]=Body[0]+Direction;
}

void GameOver()
{
	alive=0;
}

void CheckDirection()
{
	if(GetAsyncKeyState(VK_LEFT)&&!(Direction==1))
	{
		Direction=-1;
	}
	else if(GetAsyncKeyState(VK_UP)&&!(Direction==FieldWidth))
	{
		Direction=-FieldWidth;
	}
	else if(GetAsyncKeyState(VK_RIGHT)&&!(Direction==-1))
	{
		Direction=1;
	}
	else if(GetAsyncKeyState(VK_DOWN)&&!(Direction==-FieldWidth))
	{
		Direction=FieldWidth;
	}
}
#3 · edited 15y ago · 15y ago
WH
whit
wcout << " Get a some skillz " ;

Code ^
#4 · 15y ago
NA
Nathan
Quote Originally Posted by whit View Post
wcout << " Get a some skillz " ;

Code ^
Or

Code:
char answer[20];
cout << "What is your name? ";
cin >> answer;
cout << "Hello " << answer << " you're a homo ;)";
#5 · 15y ago
Pxpc2
Pxpc2
// get your own
#include <leechlib>

using namespace std;
int main () {

cout << ("Next time get your own kk?");
system "PAUSE";
return 0
}

Just a joke, dont take so serious, but I did not understood you.
#6 · 15y ago
Melodia
Melodia
Quote Originally Posted by Pxpc2 View Post
// get your own
#include <leechlib>

using namespace std;
int main () {

cout << ("Next time get your own kk?");
system "PAUSE";
return 0
}

Just a joke, dont take so serious, but I did not understood you.
Your pseudocode is so ugly I cried D:
#7 · 15y ago
WH
whit
Quote Originally Posted by Melodia View Post


Your pseudocode is so ugly I cried D:
You dont have to cry alone...
I cry with
#8 · 15y ago
why06
why06
Quote Originally Posted by Toxic Waltz View Post
Enjoy your code!
Oh hey that was you. I was wondering who that was on msn.

I've been meaning to tell you. a 2 dimensional array would help you greatly. Instead of adding a hardcoded number of spaces to drop down a line you could simply do this

int array[1][1];
...
int array [height][width];

read up on it here: Arrays - C++ Documentation

it could help make your code more readable for yourself and others in the future.
#9 · 15y ago
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Tags for this Thread

None