~ubuntu-branches/ubuntu/trusty/gcompris/trusty

« back to all changes in this revision

Viewing changes to src/boards/python/connect4p/human.py

  • Committer: Bazaar Package Importer
  • Author(s): Yann Dirson
  • Date: 2006-12-15 23:08:17 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20061215230817-exr5ks1hd73s3tlk
Tags: 8.2.2-1
* New upstream bugfix release, fixes among other things the support for
  the version of gnucap shipped in etch.
* Add missing dependency on python-gtk2 (Closes: #396523).
* Removed reference to non-existent sound file from memory.c (upstream
  fix - impacts 8.2 as well).  
* Now suggests gnuchess, gnucap, and tuxpaint.
* Updated extended description for the main package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#  gcompris - connect4 
 
2
 
3
# Time-stamp: 
 
4
 
5
# Copyright (C) 2005 Laurent Lacheny 
 
6
 
7
#   This program is free software; you can redistribute it and/or modify
 
8
#   it under the terms of the GNU General Public License as published by
 
9
#   the Free Software Foundation; either version 2 of the License, or
 
10
#   (at your option) any later version.
 
11
 
12
#   This program is distributed in the hope that it will be useful,
 
13
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
#   GNU General Public License for more details.
 
16
 
17
#   You should have received a copy of the GNU General Public License
 
18
#   along with this program; if not, write to the Free Software
 
19
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
20
 
 
21
#
 
22
# This code comes from the project 4stattack
 
23
# http://forcedattack.sourceforge.net/
 
24
#
 
25
#########################################################################
 
26
#                            4st Attack 2                               #
 
27
#########################################################################
 
28
# Created by:                                                           #
 
29
# Developer            - "slm" - Jeroen Vloothuis                       #
 
30
# Graphics             - "Korruptor" - Gareth Noyce                     #
 
31
# Music                - "theGREENzebra"                                #
 
32
#########################################################################
 
33
# Specail thanks:                                                       #
 
34
# chakie(Jan Elkholm)    - letting me "embrace and extend" his gui lib  #
 
35
# Mighty(Xander Soldaat) - for the Makefile and the Debian packages     #
 
36
# Han                    - for the rpms                                 #
 
37
# jk                     - for the FreeBSD port                         #
 
38
# Tjerk Nan              - for the Windows version                      #
 
39
# Micon                  - for the webdesign                            #
 
40
# Everyone in #pygame and the opensource community in general           #
 
41
#########################################################################
 
42
# This software is licensed under the GPL - General Public License      #
 
43
#########################################################################
 
44
 
 
45
from player import *
 
46
import rules
 
47
 
 
48
class Human:
 
49
  type = 'human'
 
50
 
 
51
  def __init__(self, difficulty):
 
52
    pass
 
53
 
 
54
  # This method returns the move to be made
 
55
  def doMove(self, board, player, event):
 
56
    self.board = board
 
57
    if event >-1 and event < 7:
 
58
      return event
 
59
    return -1
 
60
 
 
61
  def setmove(self, trigger, event, number):
 
62
    if rules.isMoveLegal(self.board, number):
 
63
      self.move = number
 
64
      return widget.DONE
 
65
  def gameOver(self, move):
 
66
    return None
 
67
 
 
68
  def setDifficulty(self, difficulty):
 
69
    pass