Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Something really interesting :)
01-04-2010, 06:52 AM
Post: #1
Something really interesting :)
I didn't know what to do, and i decided to make something really interesting. I think everybody would love this idea.
I used 2-dimensional array for making like a picture in C++ and i wrote "PRO9RAMMING".
I just made a simple function for output and the most difficult thing was to manipulate with 2 dimensional array to write "PRO9RAMMING" in it. i used only 6 lines.
You can compile this code to get that interesting output :
Code:
# include <iostream>
# include <cstdio>

using namespace std;

string a[79][79]={{"*","*","*"," ","*","*","*"," ","*","*","*"," ","*","*","*"," ","*","*","*"," "," ","*"," "," ","*"," "," "," ","*"," ","*"," "," "," ","*"," ","*"," ","*"," "," ","*"," ","*","*","*"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "},
                  {"*"," ","*"," ","*"," ","*"," ","*"," ","*"," ","*"," ","*"," ","*"," ","*"," ","*"," ","*"," ","*","*"," ","*","*"," ","*","*"," ","*","*"," ","*"," ","*","*"," ","*"," ","*"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "},
                  {"*","*","*"," ","*","*","*"," ","*"," ","*"," ","*","*","*"," ","*","*","*"," ","*"," ","*"," ","*"," ","*"," ","*"," ","*"," ","*"," ","*"," ","*"," ","*","*"," ","*"," ","*"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "},
                  {"*"," "," "," ","*","*"," "," ","*"," ","*"," "," "," ","*"," ","*","*"," "," ","*","*","*"," ","*"," "," "," ","*"," ","*"," "," "," ","*"," ","*"," ","*"," ","*","*"," ","*"," ","*"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "},
                  {"*"," "," "," ","*"," ","*"," ","*"," ","*"," "," "," ","*"," ","*"," ","*"," ","*"," ","*"," ","*"," "," "," ","*"," ","*"," "," "," ","*"," ","*"," ","*"," ","*","*"," ","*"," ","*"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "},
                  {"*"," "," "," ","*"," ","*"," ","*","*","*"," ","*","*","*"," ","*"," ","*"," ","*"," ","*"," ","*"," "," "," ","*"," ","*"," "," "," ","*"," ","*"," ","*"," "," ","*"," ","*","*","*"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "}};

void output()
{
     int i,j,k;
     for (i=0;i<=8;i++)
     cout<<endl;
     for (i=0;i<=6;i++)
      {    
      cout<<"                ";              
        for (j=0;j<=50;j++)
          cout<<a[i][j];
        cout<<endl;        
      }
}

int main()
{
     output();    
    cin.get();
}

And picture of that is :

[Image: 30907_pro9rammingcppascii2darray.jpg]

Hope that you like this idea !

There's a fine line between genius and insanity. I have erased this line.
Oscar Levant
There's a fine line between an administrator and black hat hacker. I have erased this line.
Dr DEBCOL
Visit this user's website Find all posts by this user
Quote this message in a reply
01-04-2010, 07:18 AM (This post was last modified: 01-04-2010 07:19 AM by Alireza_M.)
Post: #2
RE: Something really interesting :)
Yeah,thats nice.we had sth like this in Pascal,we had to code sth that would give you a triangle like this
a *****
aa ***
aaa *
actually an inverted one(the stars..),in which user could set number of lines of the triangle.
Viva p9 !

Gholamreza Takhti
who was he? find out
Find all posts by this user
Quote this message in a reply
01-06-2010, 06:52 AM
Post: #3
RE: Something really interesting :)
haha thats sick

[Image: pgsig copy.png]
Visit this user's website Find all posts by this user
Quote this message in a reply
01-06-2010, 06:57 AM
Post: #4
RE: Something really interesting :)
(01-06-2010 06:52 AM)FreckleS Wrote:  haha thats sick
Yeah i had that funny idea, and i decided to realize it !

There's a fine line between genius and insanity. I have erased this line.
Oscar Levant
There's a fine line between an administrator and black hat hacker. I have erased this line.
Dr DEBCOL
Visit this user's website Find all posts by this user
Quote this message in a reply
09-24-2010, 06:13 AM
Post: #5
RE: Something really interesting :)
These programs keep impressing me.. Big Grin

"Character is determined more by the lack of certain experiences than by those one has had."
Friedrich Nietzsche
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 Quick Theme: