GTK and xcow haiku generators

Play with your Puppy.
Post Reply
Message
Author
User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

GTK and xcow haiku generators

#1 Post by vovchik »

Dear Puppians,

Here are two little apps I wrote over the past few days. Both generate haiku poetry. One is written in BaCon and uses GTK and the other is in bash and uses xcow to display the result. If xcowsay is not available on your machine, grab it from the forum (it is here somewhere and on the author's site: www.doof.me.uk/xcowsay) or settle for either gxmessage or console output. The programs install in /usr/local/haku-basho. Matsuo Basho, a 17th century Japanese poet, is credited with the invention of haiku. The algorithm for generating the haiku poems was developed by Kent Peterson in Forth. Peter van Eerten (www.basic-converter-org) did a console-based BaCon port. I did the GTK version, along with a bash version (which is instructive because of the array handling and random number generation). The Bacon/bash sources are included. Here are a two screenshots (xcow and gtk), along with a pet that installs both versions. The programs will appear in the fun menu.

Have fun....

With kind regards,
vovchik
Attachments
haiku-gtk.jpg
(20.67 KiB) Downloaded 1977 times
haiku-xcow.jpg
(24.83 KiB) Downloaded 2032 times
haiku-basho.pet
(95.53 KiB) Downloaded 857 times

User avatar
666philb
Posts: 3615
Joined: Sun 07 Feb 2010, 12:27
Location: wales ... by the sea

#2 Post by 666philb »

vovchik

i like it! thankyou

666philb
Bionicpup64 built with bionic beaver packages http://murga-linux.com/puppy/viewtopic.php?t=114311
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331

User avatar
GustavoYz
Posts: 883
Joined: Wed 07 Jul 2010, 05:11
Location: .ar

#3 Post by GustavoYz »

late voice
forest stands near frost
tiny cool app

8)

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#4 Post by Lobster »

xcowsay
http://www.murga-linux.com/puppy/viewto ... 637#429610

Can we give the poem a voice?

flite
http://www.murga-linux.com/puppy/viewto ... 897#365897


Puppy Linux
Poetry for penguins
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
666philb
Posts: 3615
Joined: Sun 07 Feb 2010, 12:27
Location: wales ... by the sea

#5 Post by 666philb »

hi vovchik , i have a problem with the gtk version. The icon is partially obscuring the text, i've tried shrinking the icon to no effect. Here's a pic
Image

666philb
Bionicpup64 built with bionic beaver packages http://murga-linux.com/puppy/viewtopic.php?t=114311
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

gtk haiku

#6 Post by vovchik »

Dear 666philb,

I had the same problem when I ported the prog to Mac OSX and had to add a different DPI setting. Now, Peter has fixed hug.bac (which I use) and it should scale automatically. here is a binary compiled with the latest hug. If this works for you, please let me know. If it doesn't, and you have a compiling environment, you could try changing the DPI value that hug uses (you could try changing HUGOPTIONS("BASEXFTDPI 78") to, say, "96" and see what happens. Also there is a hug scaling option (HUGOPTIONS("SCALING")) that may help.

With kind regards,
vovchik

PS. I see that you are not getting the Japanese characters as well. I use a rather extended DejaVu Sans with full Unicode support. It is here somewhere on the forum.
Attachments
haiku-hug-bin.tar.gz
(29.93 KiB) Downloaded 706 times

User avatar
666philb
Posts: 3615
Joined: Sun 07 Feb 2010, 12:27
Location: wales ... by the sea

#7 Post by 666philb »

hi vovchik

no, it didn't work, i still have the same problem. But i have xcowsay now and prefer it to the gtk, i have it in my start up folder, for a haiku every boot..

I would like to have the japanese characters, and will look for the suggested fonts

thanks

666philb
Bionicpup64 built with bionic beaver packages http://murga-linux.com/puppy/viewtopic.php?t=114311
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#8 Post by saintless »

Thank you, Vovchik, I really like it :D
I have KDPup-484 ant the pet package works fine.

Edit: I have haiku-basho.pet and xcowsay-1.2.pet installed.
After this command:

Code: Select all

# haiku-xcow
xcowsay will be used to display haiku
#
the Cat shows with new haiku text for about 3 seconds. The situation is the same when I use haiku-bash icon from the menu to start the program.
Is there any way to make it stay longer on the desktop?
Thank you and Best regards!

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#9 Post by saintless »

I found a solution for the short timing, Vovchik.

I just had to edit this line in /usr/local/haiku-basho

Code: Select all

xcowsay --bubble-at=-70,-110 --think --image="$image" -t 20 "$msg"
I made -t 0 to -t 20 and now the haiku cat stays on the screen long enough for me to enjoy the text :)

Best regards!

User avatar
666philb
Posts: 3615
Joined: Sun 07 Feb 2010, 12:27
Location: wales ... by the sea

#10 Post by 666philb »

attached is a 64bit version .
xcowsay should be available in the PPM &
fonts-arphic-ukai needed for chinese fonts also in the PPM
Attachments
haiku-basho-x86_64.pet
(161.46 KiB) Downloaded 254 times
Bionicpup64 built with bionic beaver packages http://murga-linux.com/puppy/viewtopic.php?t=114311
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331

Post Reply