<!doctype linuxdoc system>
<article>
<title>TkGames.SF.Net
<author>Author: Steven A
<newline>
Last updated: 31 August 2008
<toc>
<verb></verb>

I've recently got stuck into the old old M.A.M.E Tcl
front-end, <ref id="mamex_" name="Mamex">. This project is
amazing, and i've (finally) found the inspiration to rewrite
this old interface ;->

It is included with the latest <url url="http://prdownloads.sourceforge.net/tkgames/tkgames-1.1.tgz?download" name="TkGames tarball"> , as are a few bugfixes - mainly to do with Wish 8.5.

<sect> General <p>

<sect1> About TkGames <p>

Welcome to my SourceForge Tk Games page. 

This page is a compiler free zone. All you'll need to hack my programs is a text
editor!

The last few years I've learnt the powerful Tcl/Tk
programming language. In the process I've adopted several
abandoned projects, refined a couple from the <url url="http://wiki.tcl.tk/898"
name="Tk Game Wiki"> and coded a few widgets of my own.

I've also included links to other cool Tcl/Tk projects on the web, including
the great <ref id="tkdiff_" name="TkDiff"> utility.

<sect1> About Tcl <p>

<url url="http://tcl.tk" name="Tcl/Tk"> is a powerful computer language -
available on Windows, Linux and Macs - which was popular on early Unix systems,
especially in commercial and scientific fields.

It's first part is Tcl - an elegant scripting language whose only data
structure is a string(!) and uses lists extensively. This allows for very
readable and deeply nested code. It is also reminiscent of functional
computer languages (as opposed to procedural languages like C and Bourne
Shell) and, as such, can be hard for beginners to understand.

Tk is the powerful graphics library that the user sees on the computer screen.
It has a slightly unpolished look and feel - which may be the reason it never
gained more popularity - but allows for very rapid and correct application
development. A simple Tcl/Tk application takes a single line:
<verb>
#!/usr/bin/wish
pack [button .b -text Finish -command {destroy .} -activeforeground RoyalBlue]
</verb>

Another feature of Tcl is that it is designed to interface with other languages
such as C and Perl, allowing best use to made of (for example) C's speed
and Tk's easy to build interface.

<sect1> Download <p>

You can download the games as a single
<url url="http://prdownloads.sourceforge.net/tkgames/tkgames-1.0.9.tgz?download" name="tarball"> or visit the 
<url url="https://sourceforge.net/project/showfiles.php?group_id=143086"
name="file archive"> at the project page for the latest releases.

<label id="installation_">
<sect1> Installation <p>

<sect2> Unix <p>

Linux and FreeBSD should have Tcl/Tk installed by default.

To verify this, look for a command named <bf>wish</bf> or <bf>wish8.4</bf>.
Users needing to install Tcl should visit <url url="http://tcl.tk"
name="Tcl.Tk">  for the source code, or try <url url="http://rpmfind.net/"
name="RpmFind"> or <url url="http://www.activestate.com/Products/ActiveTcl/"
name="Active State"> for binary packages.

Sometimes the symbolic link "wish" is not created. To do this, type: <bf>cd
/usr/bin</bf> (or /usr/local/bin) and <bf>ln -s wish8.4 wish</bf>. 

Building from source is fairly easy,
with parallel installation of different versions no problem.
For example, if "wish8.4" is in "/usr/bin", you can install wish8.5 in
"/usr/local/bin". After downloading and uncompressing the tcl-8.5.2 and tk-8.5.2 source code:
<verb>
    cd tcl8.5.2/unix && ./configure --prefix=/usr/local && make install
    cd tk8.5.2/unix && ./configure --prefix=/usr/local && make install
</verb>

<sect2> Windows <p>

To run on Windows boxes, install Tcl/Tk, and rename each program with a ".tcl" extension (eg. rename tksol tksol.tcl). 
I recommend using <url url="http://www.activestate.com/Products/ActiveTcl/"
name="Active State Tcl">. 

<sect2> MacOSX <p>

Mac users can install a standard version of Tcl/Tk from either
<url url="http://tcltkaqua.sourceforge.net" name="Aqua Tcl/Tk"> or
<url url="http://www.activestate.com/Products/ActiveTcl/" name="Active State">,
or try the
<url url="http://www.maths.mq.edu.au/%7Esteffen/tcltk/TclTkAqua/" name="Batteries-Included">
version.

The standard OSX installations of Tcl do not allow programs to be launched from the Finder.
They must be run from the command line by typing
<verb>
cd {directory where program is}
wish {program name}
</verb>
Alternatively, you can install the <url url="http://www.maths.mq.edu.au/%7Esteffen/tcltk/Launcher/"
name="Mac Tcl/Tk Launcher">, which is also included with the
"batteries-included" version.

<!-- horizontalline -->

<sect> Games <p>

<em> These programs require Tcl/Tk 8.4, but may work with earlier versions.
For more info see the <ref id="installation_" name="installation"> section.</em>


<label id="polypuzzle_">
<sect1> PolyPuzzle <p>

Based on a tesselation puzzle named Beat the Computer, this is my first "original" Tk program. 
Over the last couple of years, I've implemented most of the different puzzles. 
<url url="http://prdownloads.sourceforge.net/tkgames/polypuzzle-1.8.1.tgz?download" name="Download">. Version 1.8.1 has attractive Help, Changelog and About widgets.

You can find photos of the 
<url url="http://www.huybers.net/poly/btc.html" name="original puzzles">
and some
<url url="http://www.huybers.net/poly/polyominoe.html"
name="mathematical background"> at Pascal's web page.

<figure>
<eps file="none.eps">
<img src="images/poly.gif">
</figure>

<label id="tkhearts_">
<sect1> TkHearts <p>

<url url="http://www.talvo.com/" name="Mike Griffiths"> coded this great Hearts
clone.  My latest version is
<url url="http://prdownloads.sourceforge.net/tkgames/tkhearts-0.90.gz?download" name="0.90">
which includes a few changes.

I had a look at resizing this game, but doing so breaks up the nice clean
look of the face-up cards in the player's hand... Instead i have added an
auto-raise feature. It helps a little, and looks cool too.

<figure>
<eps file="none.eps">
<img src="images/tkhearts.gif">
</figure>

<label id="tkspider_">
<sect1> TkSpider <p>

This thoughtful game of solitaire is played with the equivalent of two packs of
cards. I recently removed the poor quality sound support till 
<url url="http://www.speech.kth.se/snack/download.html" name="Snack">
is working better.  On the plus side , at <url url="http://www.fotosearch.com">
i found some great art work and made a few nice card-backs. (One of which is
also in TkTk and Hearts).  <newline> <url
url="http://prdownloads.sourceforge.net/tkgames/tkspider-1.04.gz?download"
name="Download">

<figure>
<eps file="none.eps">
<img src="images/tkspider.gif">
</figure>


<label id="tktk_">
<sect1> TkTk <p>
Tk Time Killer is a geat little solitaire written by Greg Bacon. Unfortunately, I really
hate Perl. And while
<url url="http://home.hiwaay.net/~gbacon/perl/tktk.html" name="Greg's version">
used Tk, it espoused Tcl for Larry Wall's bride-of-frankenstein creation. 

Anyway, it wasn't much effort to re-use plenty of TkSpider and code
this game. Features include full undo, configurable decorations, a modest tally box
and a few fancy mouse bindings. 

More thanks to Greg for letting me borrow the name TkTk.

<url url="http://prdownloads.sourceforge.net/tkgames/tktk-0.96.gz?download"
name="Download">

<figure>
<eps file="none.eps">
<img src="images/tktk.gif">
</figure>

<label id="tktp_">
<sect1> TkTp <p>
Tk TriPeaks is an easier variation of <ref id="tktk_" name="TkTk">.

<url url="http://prdownloads.sourceforge.net/tkgames/tktp-0.81.gz?download"
name="Download">

<figure>
<eps file="none.eps">
<img src="images/tktp.gif">
</figure>

<label id="tkyahtzee_">
<sect1> TkYahtzee <p>

This is another program I found at
<url url="http://www.tcl.tk" name="tcl.tk"> which was mostly complete but
had playability issues. I've made a few changes, including the 
addition of high-score and help widgets, and redesigning the buttons and
menus.  Thanks to the original author, <url url="http://wiki.tcl.tk/934" name="Kevin Kenny">.
<newline>
<url url="http://prdownloads.sourceforge.net/tkgames/tkyahtzee-1.2.3.gz?download"
name="Download">.

<figure>
<eps file="none.eps">
<img src="images/yahtzee.gif">
</figure>

<label id="tksol_">
<sect1> TkSol <p>

<url url="http://www.cs.umd.edu/users/bao/tksol.html" name="Bao Trinh">
originally coded tksol for FreeBSD, and it had't been updated in 8 or
9 years. Over several point releases I've fixed quite
a few bugs, added some features and really got my hands dirty learning Tcl.
Recently some new artwork has been contributed, and the game is looking nice.
<url url="http://prdownloads.sourceforge.net/tkgames/tksol-1.9.1.tgz?download"
name="Download">

<figure>
<eps file="none.eps">
<img src="images/tksol.gif">
</figure>

<sect1> TkHangman <p>

My first Tcl/Tk program - A half-working and abandoned hangman program I
adopted from <url url="http://ibiblio.org/pub/linux" name="Ibiblio.org">, and
eventually rewrote.  <url
url="http://sourceforge.net/project/showfiles.php?group_id=143086&amp;package_id=157165"
name="Download">.

<figure>
<eps file="none.eps">
<img src="images/hangman.gif">
</figure>

<sect1> Other Games <p>

<itemize>

<item> <bf>Asteroids</bf> is a very slick clone of the arcade game, which will have you wondering
"Is that Tcl!".

<newline><newline>

It is available at the <url url="http://www.jeffgodfrey.com/development.shtml" name="author's
home page"> as a windows executable, as a <url url="http://wiki.tcl.tk/13601"
name="basic version"> without sound, and in full as part of the
<url url="http://cvs.sourceforge.net/viewcvs.py/tcllib/tclapps/" name="tclapp"> package. Sound support is provided by the
<url url="http://???" name="snack"> sound library. 
<newline><newline>
Note - unfortunately snack doesn't work too well anymore. With OSS it is poor,
and even worse with ALSA. It really needs someone to give this worthwhile
project an update.

<newline><newline>

<item> <bf>Awele</bf> is an interesting game from Africa.  <url
url="http://prdownloads.sourceforge.net/tkgames/awele-sa-1.0.tgz?download"
name="This version"> is written in Tcl/Tk and C and is an attractive though challenging game.
While it is redistribuatable, it is not GPL-ed, so it requires a clumsy
installation... See the download for details.

<newline> <newline>

Stéphane Arnold brought this game to my attention, and has his own version at 
his <url url="http://sarnold.free.fr/wordpress/?page_id=64" name="webpage">.

<newline><newline>

<item> The colourful and fun <url url="http://wiki.tcl.tk/734" name="Bubbles">.

<newline><newline>

<item> <url url="http://tclines.sourceforge.net" name="TcLines">.

<newline><newline>

<item> <url url="http://www.freshmeat.net/projects/konnekt4" name="Konnekt4">.

<newline><newline>

<item> <url url="http://wiki.tcl.tk/7666" name="TkAtaxx">.

<newline><newline>

<item> <url url="http://wiki.tcl.tk/4354" name="Overlord">.

<newline><newline>

<item> A cool game called <url url="http://wiki.tcl.tk/10287" name="Collapse">.

<newline><newline>

<item> A <url url="http://wiki.tcl.tk/4206" name="Spirograph"> widget and
an fairly useless but loveable widget named
<url url="http://wiki.tcl.tk/8763" name="Ferris Wheel">.

<newline><newline>

<item> <url url="http://tickletux.sourceforge.net" name="Tickletux Hangman">
works fine, but has been abandoned for a few years. It has some GUI and playability issues, but shows real class. 

<newline><newline>

<item> There is also an impressive solitaire known as 
<url url="http://sourceforge.net/projects/patience" name="Patience">
It is written in &lsqb;incr&rsqb;tcl and includes 5 or 6 different games
including "Battle Solitaire".  To get it running , after installing Itcl, I had
to edit patience.tcl and replace 

<verb>
	package require Iwidgets 3.0
</verb>

with 

<verb>
	package require Iwidgets
	namespace import -force itcl::*
</verb>

and then type <bf>wish patience.tcl</bf> to start the game. 

</itemize>

<label id="frontends_">

<sect> Front-ends

<sect1> Tk TiMidity++ <p>

<url url="http://prdownloads.sourceforge.net/tkgames/tkgames-tkmidity-0.9.tgz?download" name="Download">

Linux midi support is such a mess. Very recently I gave the Tk interface an overhaul
- see the readme in the tarball for details - fixing as few little bugs
and giving the widget a QA overhaul. Hopefully someone will find this useful.

<label id="mamex_">
<sect1> M.A.M.E. <p>

M.A.M.E. stands for <bf>Multiple Arcade Machine Emulator</bf>, and
is an amazing project that brings the arcade classics to
your PC. There are many, many versions and front-ends for the project.

Mamex is a minimalist front-end written for the Linux
M.A.M.E. port, <bf>XMame</bf>
(versions 0.96 and 0.106).  I've written many new widgets -
overhauling functionality and appearance, and also hacked a
useful "Mute" option into the game.  You'll find more info
in <url
url="http://prdownloads.sourceforge.net/tkgames/mamex-1.4.1.gz?download"
name="Mamex-1.4.1">.

The SDL Mame version is here: 
<url url="http://prdownloads.sourceforge.net/tkgames/sdlmamex-1.4.gz?download"
name="SDL Mamex-1.4">.

<figure>
<eps file="none.eps">
<img src="images/mamex.gif">
</figure>

<sect> Utilities <p>

<label id="tkdiff_">
<sect1> TkDiff <p>

TkDiff -- A graphical front-end to diff for Unix and Windows by
AccuRev Inc. and John M. Klassa.
I love it.

<url url="http://tkdiff.sourceforge.net" name="TkDiff Home Page"> 

<sect1> TkCVS <p>

Dorothy is a computing professional who shares with me a fondness of Macs,
Fvwm, Tk and music :->. She is also the maintainer of
<url url="http://www.twobarleycorns.net/tkcvs.html" name="TkCVS">,
a front-end for the revision-control software, CVS.  



<sect1> TkInfo <p>

Yes, the GNU "info" files suck bigtime.  This front-end makes the pain more bearable.

<url url="http://www-math.uni-paderborn.de/%7Eaxel/tkinfo/" name="TkInfo Home Page">

<sect1> Tkvol and Tkgamma <p>

Miminalist volume and screen brightness widgets.
Tkvol requires the aumix program, and Tkgamma uses Xorg's xgamma command.

<figure>
<eps file="none.eps">
<img src="images/tkvol.jpg">
</figure>

<url url="http://prdownloads.sourceforge.net/tkgames/tkvol?download" name="Download Tkvol">
<newline>
<url url="http://prdownloads.sourceforge.net/tkgames/tkgamma?download" name="Download Tkgamma">

<sect1> Alert <p>

<verb>
# Steven.a's first tk script
# Modelled on beos' Alert
# No , I don't really know what I'm doing  ;->
# 13/5/02 : patched up a bit.....
</verb>

A dialog widget modelled on the "alert" command from BeOS.

[I started using linux around 1999, with slackware 3.4, and
from the comments it looks like I started learning Tcl in 2001.]

Usage: <bf>alert</bf> [-g] message response(s)..

<figure>
<eps file="none.eps">
<img src="images/alert.jpg">
</figure>

<url url="http://prdownloads.sourceforge.net/tkgames/alert?download" name="Download">

<sect1> Tkexe <p>

Small Tcl/Tk command launcher.

<figure>
<eps file="none.eps">
<img src="images/tkexe.jpg">
</figure>

<url url="http://prdownloads.sourceforge.net/tkgames/tkexe?download" name="Download">

<sect> Links <p>

TkGames <url url="http://sourceforge.net/projects/tkgames" name="Project Page">.

<url url="http://wiki.tcl.tk/references/13404" name="Tk Game Pack">

<url url="http://wiki.tcl.tk/898" name="Tk Game Wiki">

<url url="http://www.tcl.tk" name="Tcl/Tk Homepage">

<url url="http://www.activestate.com/Products/ActiveTcl/" name="Active State Tcl">

<url url="http://tcltkaqua.sourceforge.net" name="Aqua Tcl/Tk">

<!-- horizontalline -->

<sect> Author <p>
Steven A. is a uni graduate in math and computer science, who programs as a hobby in
tcl/tk, bash and C. I live and work in rural australia, and enjoy beating up Lachlan at squash.

<url url="http://www.myspace.com/stevenaaus" name="Projects">

<url url="mailto:yahoo - dot - com - username - stevenaaus" name="Email">

</article>
