intro to c++ ASCII Art :D

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

#include <cstdlib>
#include <iostream>

using namespace std;

void TweetyBird();


int main(int argc, char *argv[])
{
    
    TweetyBird();

    
    system("PAUSE");
    return EXIT_SUCCESS;
}

void TweetyBird()
{
    cout << "TWEETY\n"
"    ´´´´´´´´´´´´´´´´´¶\n"
"´´´´´´´´´´´´´´¶´´¶´´´¶¶\n"
"´´´´´´´´´´´´´´¶´¶¶´¶¶\n"
"´´´´´´´´´¶¶¶¶´´´´´´¶¶¶¶¶¶\n"
"´´´´´´´¶¶´´´´´´´´´´´´´´´´¶¶\n"
"´´´´´¶¶´´´´´´´´¶¶´´´´´´´´´´¶¶\n"
"´´´¶¶´´´´´´´´´´´´´´´´´´´´´´´´¶¶\n"
"´´¶¶´´´´´´´´´´´´´´´´´´´´´´´´´´¶¶\n"
"´´¶´´´´´´´´´´´´´´´´´´´´´´´´´´´¶´¶\n"
"´¶´´´´´´´´´´´´´´´´¶´´´´´´´´´´´´´¶\n"
"´¶´´´´´´´´´´´´´¶¶¶¶´´´´´´´´´´´´´´¶\n"
"´¶´´´´´´´´´´´´¶¶´¶´´´´´´´´´´´¶´´´¶\n"
"´¶´´´´´´´´´´¶¶¶¶¶¶´´´´´´´¶¶¶¶´´´´¶\n"
"´¶´´´´´´´´´¶¶¶¶¶¶¶´´´´´´¶¶´´¶´´´´¶\n"
"´´¶´´´´´´´´¶¶¶¶¶´¶´´´´´¶¶¶¶¶¶´´´¶\n"
"´´¶¶´´´´´´´¶´´´´´¶´´´´¶¶¶¶¶¶´´´¶¶\n"
"´´´¶¶´´´´´´¶´´´´¶´´´´¶¶¶¶´´´´´¶\n"
"´´´´¶´´´´´´¶´´´¶´´´´´¶´´´´´´´¶\n"
"´´´´¶´´´´´´¶¶¶¶´´´´´´´´´¶´´¶¶\n"
"´´´´¶¶´´´´´´´´´´´´´´´¶¶¶´´¶\n"
"´´´´´¶¶¶´´´´´´´¶¶¶¶¶´´´´´´¶\n"
"´´´´´´´´¶¶¶´´´´´¶¶´´´´´´´¶¶\n"
"´´´´´´´´´´´´¶¶´´´´´¶¶¶¶¶¶´\n"
"´´´´´´´´´´¶¶´´´´´´¶¶´¶\n"
"´´´´´´´¶¶¶¶´´´´´´´´¶´¶¶\n"
"´´´´´´´´´¶´´¶¶´´´´´¶´´´¶\n"
"´´´´¶¶¶¶¶¶´¶´´´´´´´¶´´¶´\n"
"´´¶¶´´´¶¶¶¶´¶´´´´´´¶´´´¶¶¶¶¶¶¶\n"
"´´¶¶´´´´´´¶¶¶¶´´´´´¶´¶¶´´´´´¶¶\n"
"´´¶´´´´´´´´´´¶¶¶¶¶¶¶¶´´´´´´´´´¶\n"
"´´´¶¶´´´´´´´´´¶´´´¶´´´´´´´´´´¶\n"
"´´´´¶¶¶¶¶¶¶¶¶¶¶´´´¶¶¶¶¶¶¶¶¶¶¶ ~*" << endl;
}
Last edited on
Thanks for the extremely detailed tutorial about how to learn C++ by making ASCII art! I am sure this will help lots of beginners who know nothing about C++ at all :)

EDIT: oh, my brain inserted a "through" between "C++" and "ACSII" in the title, nevermind...


So, uh, thanks, I guess?
That is, without a doubt, ascii art - but how is it related to C++?
I'm slightly confused as to why a function called 'diamond' draws a picture of tweety pie. You could've told me the function name and given me a million attempts to guess what it does, not once would I have guessed that.
Last edited on
I was at work doing school work at first and then finally understood functions. At first i was foolin with my diamond proggy i had and eventually made this ascii art and the name stayed the same. Its c++ related because i used it in a sense of a function to call the art. and its the lounge so i thought i could show some fun with ascii art. just fun and games with what i recently learned.
Last edited on
AWESOME. I like the term "proggy".
★★ - Make the program be able to change the characters used in the ASCII art to one of several options and still keep the image roughly the same.

★★★★★ - Make the program auto-generate the ASCII art given a .png image to generate it from. [/evil]

-Albatross
Last edited on
★ - Give the function the correct name.

AWESOME. I like the term "proggy".

Used this term since i was just a weem playing video games.

★★ - Make the program be able to change the characters used in the ASCII art to one of several options and still keep the image roughly the same.

★★★★★ - Make the program auto-generate the ASCII art given a .png image to generate it from. [/evil]

I'm super new to programming/c++ so I wouldn't know how to do many of those things. but over time i would be able to do that.
An extremely easy route with the image to ascii is to output characters based on the rows of the image, and only output a character if the opacity of that pixel is 255 (or transparency is 0), I actually did this a couple weeks ago!
You will still need the relevant image library in dissecting the image file. I believe jpg,gif,png etc format mandate certain headers (correct?) inside the image file. Once you get past that part, the rest would be reading array of bytes and yes ultifinitus way is feasible.
@ultifinitus,
Surely if the opacity is < 255 you should output a space? You could also use a different character for different opacities.

@sohguanh,
You don't particularly need to support every image type and all you need from the file header is the width, height and colour depth of the image.
@chrisname, definitely =]
Topic archived. No new replies allowed.