0
\$\begingroup\$

I thought it might be fun to throw this on here.
Generate an ASCII-art for one of your favorite videogames.

What you want to generate is up to you but it should meet 2 requirements.

  1. It should be able to identify the game. So either a logo or something familiar like the triforce in Zelda. a pokeball for pokémon or an actual pokémon.
  2. Make it solid.

I'm guessing the second requirement is a bit vague, I just dont know how to explain it so let me show you with the triforce.

Wrong  
       /\   
      /__\  
     /\  /\  
    /__\/__\

Right  
           #  
          ###  
         #####  
        #######  
       #       #  
      ###     ###  
     #####   #####  
    ####### #######  

This is a popularity-contest, so be creative and dont worry about the length of your code.

Rules

  • No external resources
  • You can use any language you like

Edit
You are meant to write some kind of algorithm that will create your ascii art rather than simply arranging the characters.
Sorry for changing the question

Happy Coding!

\$\endgroup\$

closed as off-topic by Dennis, Blackhole, xnor, Alex A., Beta Decay Aug 28 '15 at 8:41

  • This question does not appear to be about programming puzzles or code golf within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 8
    \$\begingroup\$ This question appears to be off-topic because it is an art contest, not a programming contest. \$\endgroup\$ – Peter Taylor Feb 11 '14 at 15:34
  • 2
    \$\begingroup\$ I will make this more clear in the question, ofcourse youre supposed to program it instead of simply arranging the characters manually. \$\endgroup\$ – Teun Pronk Feb 11 '14 at 15:36
  • 2
    \$\begingroup\$ Why was this closed? The edit was not enough? After the question was edited, it is looking like a programming contest for me, not simply an art contest. \$\endgroup\$ – Victor Stafusa Feb 11 '14 at 20:52
14
\$\begingroup\$

Bash

An actual pokémon? Ok. I present the Voltorb, seen from behind.

#!/bin/bash
echo -e '\e[31m'    # escape character for red font
s=6
for i in `seq 8 2 16`; do
    if [ $i -ne 10 ]; then
        for j in `seq $s`; do
            echo -n ' '
        done
        for j in `seq $i`; do
            echo -n '#'
        done
        echo
    fi
    s=`expr $s - 1`
done
echo -e -n '\e[97m'    # escape character for white font
s=2
for i in `seq 16 -2 8`; do
    if [ $i -ne 10 ]; then
        for j in `seq $s`; do
            echo -n ' '
        done
        for j in `seq $i`; do
            echo -n '#'
        done
        echo
    fi
    s=`expr $s + 1`
done
echo -e '\e[0m'    # escape character for default font color

Output:

enter image description here

\$\endgroup\$
10
\$\begingroup\$

Javascript

Invaders !

for(j=8,o='';j--;o+='\n')for(i=11;i--;)o+=1&"ĎĘƾŭĽļĽŭƾĘĎ".charCodeAt(i)>>j?'##':'  '

Output :

    ##          ##          
      ##      ##            
    ##############          
  ####  ######  ####        
######################      
##  ##############  ##      
##  ##          ##  ##      
      ####  ####            

Triforce

for(j=8,o='';j--;o+='\n')for(i=15;i--;)o+=1&"āăćďėijűǰűijėďćăā".charCodeAt(i)>>j?'##':'  '

Output :

              ##              
            ######            
          ##########          
        ##############        
      ##              ##      
    ######          ######    
  ##########      ##########  
##############  ##############

Any 8-lines (can be extended to 16 easily) logo can be displayed with that code, you have to change only the encoding string.
Each character of the string corresponds to a column.
You can also declare a generic function :

function f(s){for(j=8,o='';j--;o+='\n')for(i=s.length;i--;)o+=1&s.charCodeAt(i)>>j?'##':'  ';return o}
f('ĎĘƾŭĽļĽŭƾĘĎ'); //invaders
f('āăćďėijűǰűijėďćăā'); //triforce

To encode the column (8bits), use parseInt, specify the bits with a 1 at the start to enforce unicode.

Example for the first part of the triforce :

String.fromCharCode(parseInt('100000001',2),parseInt('100000011',2),parseInt('100000111',2),parseInt('100001111',2),parseInt('100010111',2),parseInt('100110011',2),parseInt('101110001',2),parseInt('111110000',2))

Output: "āăćďėijűǰ"

\$\endgroup\$
  • 1
    \$\begingroup\$ That's brilliant! Even though you're using Unicode, I'll +1 for the clever use of bitwise and char operations. \$\endgroup\$ – Braden Best Feb 11 '14 at 23:35
7
\$\begingroup\$

Python 2.7

#!/bin/python2

a,b=[[78,20],[2,20,47,28],[5,20,40,27],[0,23,37,23],[2,21,14,28],[0,24,29,32],[2,22,21,40],[4,19,20,42],[8,14,13,49],[7,75],[6,66],[5,65],[3,58],[2,48],[2,33],[2,30],[2,28],[1,28],[1,28],[1,28],[1,28],[1,27],[1,27]],[]
for l in a:
    c=' '
    b.append([])
    for i in l:
    b[-1].append(c*i)
        c=[' ','#'][c==' ']
b[4]=b[4][:2]+['        OBJECTION!!']+b[4][2:]
for l in b: print ''.join(l)

Output

                                                                              ####################
  ####################                                               ############################
     ####################                                        ###########################
#######################                                     #######################
  #####################        OBJECTION!!              ############################
########################                             ################################
  ######################                     ########################################
    ###################                    ##########################################
        ##############             #################################################
       ###########################################################################
      ##################################################################
     #################################################################
   ##########################################################
  ################################################
  #################################
  ##############################
  ############################
 ############################
 ############################
 ############################
 ############################
 ###########################
 ###########################

Of course, based on:

Phoenix Wright

It's not a particularly novel method of generating the output, nor is it fantastic ASCII art (it looks more like a gun than a pointer finger, and the spiky hair doesn't come across great), but there isn't enough Ace Attorney in here! :)

\$\endgroup\$
6
\$\begingroup\$

Game Maker Language

a="    "
b=a+a+a
c=b+b
d="------"
show_message(a+"  _=====_"+c+a+"   _=====_# "+a+"/ _____ \"+c+a+" / _____ \#   +.-'_____'-."+d+d+d+d+"---.-'_____'-.+#  /   |     |  '."+a+a+"S O N Y+a+a+"'  |  _  |   \# / ___| /|\ |___ \"+b+a+a+" / ___| /_\ |___ \#/ |      |      | ;  __"+a+a+"   _   ; | _         _ | ;#| | <---   ---> | | |__|"+a+a+" |_:> | ||_|   "+a+"(_)| |#| |___   |   ___| ;SELECT"+a+"   START ; |___   "+a+"___| ;#|\    | \|/ |    /  _"+a+" ___  "+a+"_   \    | (X) |    /|#| \   |_____|  .','' '', |___|  ,'' '', '.  |_____|  .' |#|  '-.______.-' /       \ANALOG/   "+a+"\  '-._____.-'   |#|"+b+"   |   "+a+"|"+d+"|"+a+"   |"+b+a+"#|"+b+"  /\   "+a+"/ "+a" \   "+a+"/\   "+b+"|#|"+b+" /  '.___.'"+a+a+"'.___.'  \"+b+"  |#|"+b+"/"+c+a+"\"+b+" |# \  "+a+a+"/  "+c+a+"\"+a+a+"   /#  \________/"+c+a+a+"\_________/")

Result (SE has too much whitespace, try copying to Notepad)

      _=====_                               _=====_
     / _____ \                             / _____ \
   +.-'_____'-.---------------------------.-'_____'-.+
  /   |     |  '.        S O N Y        .'  |  _  |   \
 / ___| /|\ |___ \                     / ___| /_\ |___ \
/ |      |      | ;  __           _   ; | _         _ | ;
| | <---   ---> | | |__|         |_:> | ||_|       (_)| |
| |___   |   ___| ;SELECT       START ; |___       ___| ;
|\    | \|/ |    /  _     ___      _   \    | (X) |    /|
| \   |_____|  .','' '', |___|  ,'' '', '.  |_____|  .' |
|  '-.______.-' /       \ANALOG/       \  '-._____.-'   |
|               |       |------|       |                |
|              /\       /      \       /\               |
|             /  '.___.'        '.___.'  \              |
|            /                            \             |
 \          /                              \           /
  \________/                                \_________/
\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.