Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // MoveBoxMove.cpp : main project file.
- #include "stdafx.h"
- #include<stdio.h>
- #include<iostream>
- using namespace System;
- using namespace std;
- using namespace System::Threading;
- void box (int x, int y, int s,int t, Char Ch,bool pen)
- {
- for(int i=0; i<s; i++)
- {
- if(pen==true);
- Console :: SetCursorPosition (x+i,y);
- putchar(Ch);
- Console :: SetCursorPosition (x+i,y);
- putchar(Ch);
- Console:: SetCursorPosition (x,y+i);
- putchar(Ch);
- Console:: SetCursorPosition (x,y+i);
- putchar(Ch);
- Thread::Sleep(t);
- if(pen==false);
- Console :: SetCursorPosition (x+i,y);
- putchar(Ch);
- Console :: SetCursorPosition (x+i,y);
- putchar(Ch);
- Console:: SetCursorPosition (x,y+i);
- putchar(Ch);
- Console:: SetCursorPosition (x,y+i);
- putchar(Ch);
- }
- }
- void box2 (int x, int y, int s,int t, Char Ch, bool pen)
- {
- for(int i=0; i<s; i++)
- {
- if(pen==true);
- Console :: SetCursorPosition (x-i,y);
- putchar(Ch);
- Console :: SetCursorPosition (x-i,y);
- putchar(Ch);
- Console:: SetCursorPosition (x,y-i);
- putchar(Ch);
- Console:: SetCursorPosition (x,y-i);
- putchar(Ch);
- Thread::Sleep(t);
- if(pen==false);
- Console :: SetCursorPosition (x-i,y);
- putchar(Ch);
- Console :: SetCursorPosition (x-i,y);
- putchar(Ch);
- Console:: SetCursorPosition (x,y-i);
- putchar(Ch);
- Console:: SetCursorPosition (x,y-i);
- putchar(Ch);
- Thread::Sleep(t);
- }
- }
- int main(array<System::String ^> ^args)
- {
- Console::Clear();
- Console::ForegroundColor=ConsoleColor::Red;
- box(5,5,5,200,'*',true);
- box2(10,10,6,200,'*',true);
- box(5,5,5,200,' ',false);
- box2(10,10,6,200,' ',false);
- Console::ForegroundColor=ConsoleColor::Green;
- box(10,5,5,200,'@',true);
- box2(15,10,6,200,'@',true);
- box(10,5,5,200,' ',false);
- box2(15,10,6,200,' ',false);
- Console::ForegroundColor=ConsoleColor::Blue;
- box(15,5,5,200,'$',true);
- box2(20,10,6,200,'$',true);
- box(15,5,5,200,' ',false);
- box2(20,10,6,200,' ',false);
- Console::ForegroundColor=ConsoleColor::Cyan;
- box(20,5,5,200,'%',true);
- box2(25,10,6,200,'%',true);
- box(20,5,5,200,' ',false);
- box2(25,10,6,200,' ',false);
- Console::ForegroundColor=ConsoleColor::Magenta;
- box(25,5,5,200,'^',true);
- box2(30,10,6,200,'^',true);
- box(25,5,5,200,' ',false);
- box2(30,10,6,200,' ',false);
- Console::ForegroundColor=ConsoleColor::Yellow;
- box(30,5,5,200,'=',true);
- box2(35,10,6,200,'=',true);
- box(30,5,5,200,' ',false);
- box2(35,10,6,200,' ',false);
- Console::ForegroundColor=ConsoleColor::Gray;
- box(35,5,5,200,'#',true);
- box2(40,10,6,200,'#',true);
- box(35,5,5,200,' ',false);
- box2(40,10,6,200,' ',false);
- Console::ForegroundColor=ConsoleColor::DarkCyan;
- box(40,5,5,200,'!',true);
- box2(45,10,6,200,'!',true);
- box(40,5,5,200,' ',false);
- box2(45,10,6,200,' ',false);
- Console::ForegroundColor=ConsoleColor::DarkYellow;
- box(45,5,5,200,'&',true);
- box2(50,10,6,200,'&',true);
- box(45,5,5,200,' ',false);
- box2(50,10,6,200,' ',false);
- Console::ForegroundColor=ConsoleColor::White;
- box(50,5,5,200,'+',true);
- box2(55,10,6,200,'+',true);
- box(50,5,5,200,' ',false);
- box2(55,10,6,200,' ',false);
- Console::CursorVisible=false;
- Console::ReadLine();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement