-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
88 lines (71 loc) · 1.92 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Course: Programming in Python - Autumn 2009
University of Helsinki - Department of Computer Science
*********
* Poker *
*********
***************
* How to play *
***************
What you need
- Python (tested with 2.5 and 2.6)
- PyGTK
- Python Glade (tested with 2.14)
How to run
----------
Go to the src directory and run:
# python Pokeri.py
*************
* Gamelogic *
*************
Round in the game:
- Choose bet and Deal.
- Choose cards you want to hold, other cards will be replaced.
- If you have a winning hand you get bet * winfactor ammount of money.
Otherwise you lose your bet.
How many times your bet is multiplied if you win.
Times : Type of win
1 : pair
2 : two pairs
3 : three of a kind
4 : straight
5 : flush
6 : full house
7 : four of a kind
8 : straight flush
Gamestates:
1 : Choose bet and Deal.
2 : Choose cards you want to hold.
3 : Round ended.
4 : Ran out of money. GAME OVER.
*******************
* Class hierarchy *
*******************
Poker.py - Main program
Poker
Model
Card (Card.py)
Deck (Deck.py)
Hand (Hand.py)
WinChecker (WinChecker.py)
Test
CardTest (CardTest.py)
DeckTest (DeckTest.py)
HandTest (HandTest.py)
WinCheckerTest (WinChecker.py)
Controller
GameController (GameController.py)
View
PokerGladeUI (PokerPyGtkUI.py)
***************
* Development *
***************
The architecture is a common MVC -architecture.
The graphical interface is done with Passive view -designpattern where
the controller handles responses to user events and also does all the updating
of the view. With this designpattern theres no dependency between the model and
the view.
Userinterface was made with Glade.
Unittesting was done for all the classes in the Model package. Systemtesting
for View and Controller was done by playing.
You can run unittests with:
python -m unittest discover src/ '*Test.py'