Click to See Complete Forum and Search --> : Does anyone want to do something silly for me?


TheLinuxDuck
11-19-2001, 06:00 PM
I was messing around with banner earlier, and was wondering if anyone wanted to write a silly little thing that will take the output from banner and turn the text so it's readable regularly...

I don't feel like doing it.

I'm being lazy today.

And, I don't have any real use for it. I just wanted to see if someone would do it for me.

I don't care what language.

I eat cheese.

bdg1983
11-19-2001, 09:48 PM
that is silly

TheLinuxDuck
11-20-2001, 10:33 AM
Originally posted by Bradmont:
<STRONG>that is silly</STRONG>

(^= Yea.. but I never tried to disguise the fact.. I guess no one wants to help out a poor poor duck with no ... err... (what's the opposite of laziness?)

Hmm..

kmj
11-20-2001, 10:51 AM
isn't each letter of the banner represented by a bunch its ascii characters? Like an 'S' is all "s"'s? that would be too easy duck.

TheLinuxDuck
11-20-2001, 10:52 AM
Each letter is represented by an #. I imagine it could be easily changed.

I just don't want to do it, because I'm feeling lazy.

Benny B
11-20-2001, 11:07 AM
Okay, do you mean turning the buch of #'s into normal text, eg: what was entered into banner in the first place... or do you mean rotating the banner output so that is is horizontal rather then vertical?

[ 20 November 2001: Message edited by: Benny B ]

TheLinuxDuck
11-20-2001, 11:34 AM
Originally posted by Benny B:
<STRONG>or do you mean rotating the banner output so that is is horizontal rather then vertical?</STRONG>

Yea.. that one.. (^=

What would be *really* qool, would be to have a frontend for banner that stored the resultant banner output, then turned it horizontally, then scrolled the message across the screen! That would be qool!

Now, if I just wasn't feeling so lazy... (^=

Benny B
11-20-2001, 11:38 AM
Originally posted by TheLinuxDuck:
<STRONG>What would be *really* qool, would be to have a frontend for banner that stored the resultant banner output, then turned it horizontally, then scrolled the message across the screen!</STRONG>

Phew, that was what I was working on, except the scroll thing....so far my frontend stores the output and thats all, I am working on the rotating part, but I have pretty limited programming skills and finding it a tad tricky, but I always like a challenge.....

Dru Lee Parsec
11-20-2001, 11:44 AM
I guess no one wants to help out a poor poor duck with no ... err... (what's the opposite of laziness?)


Is it "Wombly"? No wait, that's not it.

I dunno. I'd look it up at whatstheoppositeofthisword.com if I wasn't so lazy.

nanode
11-20-2001, 11:53 AM
Seems more like apathy than just laziness. =^)

Benny B
11-20-2001, 12:02 PM
ehhh, damn #'s ...... just when you think you have the solution, some variable pops up and ruins everythin...

I need some sleep, tis 3am here .... will sleep on it and solve it tommorow.....

TheLinuxDuck
11-20-2001, 12:35 PM
Originally posted by nanode:
<STRONG>Seems more like apathy than just laziness. =^)</STRONG>

I think maybe you're right. Hey! I just had a qool idea! We could start a new trend! We'll set a global variable in linux called "APATHY" that you put paths in that you just don't care about! Wouldn't that be qool!?

TheLinuxDuck
11-20-2001, 12:35 PM
Originally posted by Benny B:
<STRONG>ehhh, damn #'s ...... just when you think you have the solution, some variable pops up and ruins everythin...

I need some sleep, tis 3am here .... will sleep on it and solve it tommorow.....</STRONG>

(^= Get some sleep dood.. I look forward to your solution, though.. (^=

Benny B
11-20-2001, 09:56 PM
hmm well I've sorta done it...except it doesn't work very well....I am kinda stumped as to how to make it work better...at the moment it outputs the rotated text, but the text becomes skinnier and longer, plus there are a lot of white spaces below it......

I'll post my code and I'd be interested for people to show me how to fix it up/improve it. Like I said I have very little programming experience and a very wastefull/unorthodox style, so I'd imagine that there would be 101 better ways to do the task....but hey, I'm learning...

Once the rotational code is good and shows the text correctly, I want to work on making it a full featured banner frontend (accepting command line options etc) and also maybe trying my hand at doing the kewl scrollie thing...

Damn u TLD, I'm hooked on banner!! :D

Benny B
11-20-2001, 09:58 PM
Well here is the code so far...my code always seems soo ugly...please dont laugh at this too much...


#!/usr/bin/python

import string
import os


banner_comm = 'banner -w 80 '
input = 0
banner_correct = []
big_string = []

while input == 0:
message = raw_input('Enter your message: ')

if message == "":
print "It helps if you enter something....."
else:
input = 1


os.system(banner_comm+message+' &gt; '+message+'.txt')
file = message+'.txt'

banner_file = open(file,'r')
banner_text = banner_file.readlines()
banner_file.close()
os.system('rm '+file)
line_lengths = []
bannertext = {}

for lines in banner_text:
x = len(lines)
line_lengths.append(x)
line_lengths.sort()
line_lengths.reverse()

for x in range(len(banner_text)):
if len(banner_text[x]) != line_lengths[0]:
while len(banner_text[x]) != line_lengths[0]:
banner_text[x] = banner_text[x] + ' '

for x in range(len(banner_text)):
banner_text[x] = string.replace(banner_text[x], '\n', '')


for x in range(len(banner_text[0])):
for line in banner_text:
char = line[x]
big_string.append(char)
if len(big_string) == len(banner_text):
banner_correct.append(string.join(big_string,''))
big_string = []

banner_correct.reverse()
for line in banner_correct:
print line

Benny B
11-20-2001, 09:59 PM
now please people tear it apart and show me how to make it better.......

sans-hubris
11-20-2001, 11:22 PM
Originally posted by Benny B:
<STRONG>now please people tear it apart and show me how to make it better.......</STRONG>
Well, I can't tell you what's wrong as I don't know Python, but I decided I'm going to work on it using C++. All this is is transposition of a matrix of characters. Shouldn't be too difficult (especially with C++'s string class.)

bdg1983
11-21-2001, 01:01 AM
#!/usr/bin/perl

@banner=`banner @ARGV`;
$big = 0;
foreach (@banner){
$big = length($_) unless $big &gt; length($_);
}
foreach (@banner){
chomp;
$_ .= " " while (length($_) &lt; $big);
@line=split "";
$count=0;
foreach (@line){
$result[$count] .= $_;
$count++;
}
}
print $_ . "\n" foreach (reverse @result);


a little ugly, but it works...

and there are often a bunch of blank lines at the end, but that's banner's fault, and if I remove all the blank lines, things like "iiii" won't come out right.

[ 21 November 2001: Message edited by: Bradmont ]

bdg1983
11-21-2001, 01:07 AM
Originally posted by Benny B:
<STRONG>hmm well I've sorta done it...except it doesn't work very well....I am kinda stumped as to how to make it work better...at the moment it outputs the rotated text, but the text becomes skinnier and longer, plus there are a lot of white spaces below it......

I'll post my code and I'd be interested for people to show me how to fix it up/improve it. Like I said I have very little programming experience and a very wastefull/unorthodox style, so I'd imagine that there would be 101 better ways to do the task....but hey, I'm learning...

Once the rotational code is good and shows the text correctly, I want to work on making it a full featured banner frontend (accepting command line options etc) and also maybe trying my hand at doing the kewl scrollie thing...

Damn u TLD, I'm hooked on banner!! :D</STRONG>

I had the text stretching problem for awhile there too. It's because banner doesn't print more empty spaces after the right end of the letter. I had to append white spaces so all the lines were all the same length.

Benny B
11-21-2001, 02:44 AM
Originally posted by Bradmont:
<STRONG>I had to append white spaces so all the lines were all the same length.</STRONG>

Yeh I know, I did that, but I still get the stretching problem......

TheLinuxDuck
11-21-2001, 09:59 AM
Originally posted by Benny B:
<STRONG>Damn u TLD, I'm hooked on banner!! :D</STRONG>

bwa hwa hwa!! That was my diabolical scheme from the very start!!!

(^=

Actually, I'm glad to see some folks getting into this silly little thing!

mrBen
11-21-2001, 10:20 AM
Originally posted by TheLinuxDuck:
<STRONG> I think maybe you're right. Hey! I just had a qool idea! We could start a new trend! We'll set a global variable in linux called "APATHY" that you put paths in that you just don't care about! Wouldn't that be qool!?</STRONG>

ln -s /apathy /dev/null :D

TheLinuxDuck
11-21-2001, 10:32 AM
Originally posted by mrBen:
<STRONG>ln -s /apathy /dev/null :D</STRONG>

LOL!! Maybe we could form a new distro called ApathyLinux, in which there's really nothing in the distro, and all of the binaries don't do anything.

Wait.. that wouldn't be much fun, now would it...

crokett
11-21-2001, 01:54 PM
Originally posted by TheLinuxDuck:
<STRONG> LOL!! Maybe we could form a new distro called ApathyLinux, in which there's really nothing in the distro, and all of the binaries don't do anything.

Wait.. that wouldn't be much fun, now would it...</STRONG>

yea but who would care? :D

l01yuk
11-22-2001, 05:16 PM
Horizontal, hmmm, let me see, oh yes!!

If I type banner hello on this HP-UX system it comes out horizontal, I never could figure out why it doesn't do that in Linux. It's very handy for telling you that your script has fallen over.

Cheese anyone?

Gnu/Vince
11-26-2001, 10:31 PM
The thread is old now, but I thought I'd mention figlet... Check it out. Debian dudes: apt-get install figlet