[Tutor] An Introduction and a question

Jonathon Sisson sisson.j at gmail.com
Sat Jun 10 04:27:08 CEST 2006


Michael Sullivan wrote:
> Here's the situation:  My wife likes to play the game Chuzzle, found at
> Yahoo Games.  We use primarily Linux, however Chuzzle is written as an
> ActiveX control, which only works on Windows.  I have not been able to
> get Internet Explorer to work correctly through Wine, 

This might not be a Python topic, but I figured I'd respond with what I
know on this particular subject...

ActiveX can be run in Linux using the WINDOWS version of Mozilla in Wine
and a little bit of coaxing as per this HOWTO on the Gentoo Forums (make
sure you install the ActiveX control in Wine...):

http://forums.gentoo.org/viewtopic-t-246098-highlight-warcraft.html

World of Warcraft uses ActiveX in it's patch updater, and although I've
never personally run it I've had many people tell me this method works.
 Now if I could just figure out how to convince my wife to try Linux (as
you apparently have done) then I'd be set...kudos to you on that.

Jonathon

so I determined to
> write a Chuzzle-like game (with many of my own enhancements) for Linux.
> I've been playing around with some Pygame examples lately, and thought
> that I'd try writing the game in Python (I've been meaning to learn
> Python for years, but just never got around to it.)  Today I started on
> writing the game.  I've decided (at least for now) to call my version,
> LinePuzzle.  For those of you unfamiliar with Chuzzle, here's the basic
> concept:  There are individual pieces of different colors arranged on a
> grid.  The pieces can be moved on a line either vertically or
> horizontally.  The object of the game is to position three similarly
> colored pieces ajacent to each other.  At this point the three pieces
> will disappear, and the pieces above them will fall to take their place.
> As the levels progress, locks are added so that the player cannot move a
> locked piece either horizontally or vertically.  The game is over when
> no more pieces can be removed.  
> 
> I started my script by creating a class called LinePuzzlePiece which
> represents a single coloured piece.  I wanted a random colour chosen
> from a list to be assigned to the piece, and then to prove that I had it
> set up correctly, I wanted to call a method that would print out the
> color of the piece.  Here is my code:
> 
> #!/usr/bin/env python
> 
> import random
> import time
> import math
> 
> class LinePuzzlePiece:
>    """This class defines a single playing piece for LinePuzzle"""
>    def __init__(self):
>       seed(time)
>       index = int(math.floor(uniform(1, 10)))       colorlist = ["red",
> "blue", "green" "yellow", "purple"]       self.color = colorlist[index]
> 
>    def printcolor():
>       print self.color
> 
> mypiece = LinePuzzlePiece
> mypiece.printcolor
> 
> 
> I saved the script and made it chmod +x.  However, when I run it, I get
> this:
> 
> michael at camille ~ $ ./linepuzzle.py
> michael at camille ~ $
> 
> Now, I'm no expert, but I really think something should have been
> printed, if even a blank line.  What am I doing wrong here?  Why is
> nothing printing?  Is my printcolor method even being called
> successfully?
> -Michael Sullivan-
> 
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 



More information about the Tutor mailing list