Shop OBEX P1 Docs P2 Docs Learn Events
Add some cool banners to your Propeller code comments - ASCII Art — Parallax Forums

Add some cool banners to your Propeller code comments - ASCII Art

RobotWorkshopRobotWorkshop Posts: 2,307
edited 2011-12-29 08:20 in Propeller 1
Lately I've been using Figlet or one of the online tools to generate some nice title/banners for my Propeller source code. You can also make small ASCII art graphics to paste them in the code comments as well. It can add a nice touch to your code. Some sites that have may help are:

http://www.network-science.de/ascii/

http://www.degraeve.com/img2txt.php

http://www.glassgiant.com/ascii/

http://tech.shantanugoel.com/projects/online-tools/figlet-online

http://www.figlet.org/

Comments

  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2011-12-28 09:18
    Some examples:
    {{
    
    8""""8                                                 
    8    8 eeeee  eeeee eeeee eeee e     e     eeee eeeee  
    8eeee8 8   8  8  88 8   8 8    8     8     8    8   8  
    88     8eee8e 8   8 8eee8 8eee 8e    8e    8eee 8eee8e 
    88     88   8 8   8 88    88   88    88    88   88   8 
    88     88   8 8eee8 88    88ee 88eee 88eee 88ee 88   8
    
    8""""8                  
    8    " eeeee eeeee eeee 
    8e     8  88 8   8 8    
    88     8   8 8e  8 8eee 
    88   e 8   8 88  8 88   
    88eee8 8eee8 88ee8 88ee
    
    }}
    
    
    {{
    
    ________                                               
    ___  __ \___________________ _____________ _______ ___ 
    __  /_/ /_  ___/  __ \_  __ `/_  ___/  __ `/_  __ `__ \
    _  ____/_  /   / /_/ /  /_/ /_  /   / /_/ /_  / / / / /
    /_/     /_/    \____/_\__, / /_/    \__,_/ /_/ /_/ /_/ 
                         /____/
    _____   __                       
    ___  | / /_____ _______ ________ 
    __   |/ /_  __ `/_  __ `__ \  _ \
    _  /|  / / /_/ /_  / / / / /  __/
    /_/ |_/  \__,_/ /_/ /_/ /_/\___/
    
    }}
    
    
  • Heater.Heater. Posts: 21,230
    edited 2011-12-28 10:07
    I hate to be a Boring Old F*** here but I have to say I hate to see such things in source code.

    1) It has no function.
    2) It conveys no information.
    3) It distracts from what you really want to read, the code and comments.
    4) It wastes screen space.

    So can I suggest keeping it to a tasteful minimum, where it can be a bit of fun. Perhaps a little header or tucked away with the copyright notice at the end.
  • Prophead100Prophead100 Posts: 192
    edited 2011-12-28 10:43
    Within limits, I could see how this could be useful for documenting code where a graphics would help relate the parameters to its application much like the addition of circuitry info to an object. While it should get stripped out during compilation and add no extra weight in the final code, you would need to be careful that no special characters are used to avoid surprises...

    I sometimes add things like this to show how the method relates to a physical object.
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2011-12-28 10:52
    I can never read those things.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2011-12-28 12:32
    Heater. wrote: »
    I hate to be a Boring Old F*** here but I have to say I hate to see such things in source code.

    1) It has no function.
    2) It conveys no information.
    3) It distracts from what you really want to read, the code and comments.
    4) It wastes screen space.

    So can I suggest keeping it to a tasteful minimum, where it can be a bit of fun. Perhaps a little header or tucked away with the copyright notice at the end.

    I think everyone missed the fact that I specifically mentioned the use for a banner in the title. So far I use it once at the beginning of the main source for a couple robot projects. When editing the code having it on the first page (or last) really doesn't interfere with any editing, etc. While someone could certainly go overboard there is nothing wrong with making the source code look good as well. When properly used it can help:

    In regards to 1 and 2 it can show the title of the program. For me it makes it easier to find the listing of a particular program when looking at the code offline. As the eyesight gets slightly worse the larger title helps. When used on the first page it doesn't get the way of any code and comments in the program.

    No one is forcing anyone to use them but I'm sure that a few people might and that is why I posted the links. If not no big deal.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-12-28 14:13
    This used to be common decades ago when you always printed a listing of the compiled code.

    I like just a border around the title of blocks of code so that it is performing a highlight function and not a space waster. The circuit schematics, where applicable, is a nice feature, but only if you use the propeller font.
  • Heater.Heater. Posts: 21,230
    edited 2011-12-28 16:42
    Sorry I was just being a bit grumpy. Tags, logos, banners are OK, in moderation.
    Cluso has reminded me that one of the first programs I ever used was "banner" on a ICL 1909. Made it easier for us students to separate/identify our ALGOL listings.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-12-28 21:22
    Figits (banners) are cool.. Like any other art, when not overdone they can add a layer of "cool" to the program.

    Anything that promotes commenting of code is a good thing.. :)

    OBC
  • lanternfishlanternfish Posts: 366
    edited 2011-12-28 23:25
    Have filed the linked sites as they could be handy for quickly generating splash screens for some programs that display ASCII only.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2011-12-29 08:20
    Have filed the linked sites as they could be handy for quickly generating splash screens for some programs that display ASCII only.

    Yes indeed. I'm using the Propeller as a co-processor on a large robot to handle all the lighting and some misc I/O. It has a 10.4" touch screen acting as the PC display which also has a composite input. That is connected to the Propeller board so I can switch to get the status of that at any time. I used Figlet to generate the title in the code:
    ' Build the DC-2 screen for Propeller status
      text.str(string("    ______   _______         _______",13))
      text.str(string("   |      | |       |       |       |",13))
      text.str(string("   |  _    ||       | ____  |____   |",13))
      text.str(string("   | | |   ||       ||____|  ____|  |",13))
      text.str(string("   | |_|   ||      _|       | ______|",13))      
      text.str(string("   |       ||     |_        | |_____ ",13))
      text.str(string("   |______| |_______|       |_______|",13))
      text.str(string("┌──────────────────────────────────────┐"))
      text.str(string("│",10,39,"││",10,39,"│"))
      text.str(string("│",10,39,"││",10,39,"│"))
      text.str(string("└──────────────────────────────────────┘"))
    

    In order to print in the last spot on the screen I make a copy of TV TEXT and saved a custom version with the project with the code to shift up the display commented out.

    For now the box is just used to print out status, variables, etc and I'm still working on the final list of items that I want to keep on the display. It has really helped showing the ADC values while I was trouble shooting the hardware and code to monitor the voice.

    It would be pretty cool to see some new Propeller text adventure games with perhaps a little of the ASCII art blended in during certain times. Some sites that have examples:

    http://www.chris.com/about/

    http://www.ascii-art.de/

    http://artscene.textfiles.com/asciiart/
Sign In or Register to comment.