Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.8 kB
2
Indexable
Never
#include <iostream>
#include <stdio.h>
using namespace std;

void jump(char X[][80], int r, int c)
{
	char z;
	int i = 0, j = 0;
	z = X[r][c];
	X[r][c] = X[r - 1][c];
	X[r - 1][c] = z;
	for (i = 0; i < 24; i++)
	{
		for (j = 0; j < 80; j++)
		{
			cout << X[i][j];
		}
		cout << endl;
	}
	z = X[r - 1][c];
	X[r - 1][c] = X[r - 2][c];
	X[r - 2][c] = z;
	for (i = 0; i < 24; i++)
	{
		for (j = 0; j < 80; j++)
		{
			cout << X[i][j];
		}
		cout << endl;
	}
	z = X[r - 2][c];
	X[r - 2][c] = X[r - 1][c];
	X[r - 1][c] = z;
	for (i = 0; i < 24; i++)
	{
		for (j = 0; j < 80; j++)
		{
			cout << X[i][j];
		}
		cout << endl;
	}
	z = X[r - 1][c];
	X[r - 1][c] = X[r][c];
	X[r][c] = z;
	for (i = 0; i < 24; i++)
	{
		for (j = 0; j < 80; j++)
		{
			cout << X[i][j];
		}
		cout << endl;
	}
}

void main()
{
	char X[24][80];
	int i = 0, r = 0, c = 0, p = 0, j = 0, k = 0, l = 0;
	for (r = 0; r < 24; r++)
	{
		for (c = 0; c < 80; c++)
		{
			X[r][c] = ' ';
		}
	}
	for (c = 1; c < 79; c++)
	{
		r = 0;
		X[r][c] = 205;
	}
	for (c = 1; c < 79; c++)
	{
		j = 23;
		X[j][c] = 205;
	}
	X[0][0] = 201;
	X[23][0] = 200;
	X[0][79] = 187;
	X[23][79] = 188;
	for (r = 1; r < 23; r++)
	{
		c = 0;
		X[r][c] = 186;
	}
	for (r = 1; r < 23; r++)
	{
		p = 79;
		X[r][p] = 186;
	}
	for (r = 0; r < 24; r++)
	{
		for (c = 0; c < 80; c++)
		{
			cout << X[r][c];
		}
		cout << endl;
	}
	X[10][40] = 225;
	X[11][40] = '|';
	X[11][41] = 92;
	X[11][39] = 47;
	for (r = 0; r < 24; r++)
	{
		for (c = 0; c < 80; c++)
		{
			cout << X[r][c];
		}
		cout << endl;
	}
	jump(X, 10, 40);
	jump(X, 11, 40);
	jump(X, 11, 41);
	jump(X, 11, 39);
	for (r = 0; r < 24; r++)
	{
		for (c = 0; c < 80; c++)
		{
			cout << X[r][c];
		}
		cout << endl;
	}
}
Leave a Comment