Commit graph

379 commits

Author SHA1 Message Date
Olivier Teulière
43954a9fe5 Fixed detection of the first turn 2012-02-25 21:56:41 +01:00
Olivier Teulière
182263ce74 New UndoCmd class, not used yet 2012-02-21 08:22:33 +01:00
Olivier Teulière
b1ed3215d9 Rewrote the navigation system, to make it more powerful and easier to understand.
Internally, commands are now stored a bit differently: some commands
which were at the end of a turn (like the players rack in duplicate
mode) are now at the beginning. But from a user point of view, there is
no visible difference, except some details in training mode (and the new
behaviour is arguably better :)).
Only (known) problem: after loading a game saved before this commit,
navigating in the game history may be less nice (in particular, racks
may not be fully restored).
2012-02-21 08:22:33 +01:00
Olivier Teulière
e915e5f2cf New "auto-executable" flag for commands, not yet used 2012-02-21 08:22:33 +01:00
Olivier Teulière
de2d2777e2 The TurnCmd class does not inherit from Command anymore 2012-02-21 08:22:33 +01:00
Olivier Teulière
59fac223f4 Renamed some methods 2012-02-21 08:22:32 +01:00
Olivier Teulière
038910e5df Removed a few useless assignations and Tile copies 2012-02-21 08:22:32 +01:00
Olivier Teulière
66eec913c9 Added several assertions 2012-02-21 08:22:32 +01:00
Olivier Teulière
32957abfcc When playing a word, forbid using a joker to specify a letter on the board (even a joker).
This is just a convention, but a reasonable one :)
2012-02-21 08:22:32 +01:00
Olivier Teulière
6e2c665bdf Simplify the handling of jokers in the Round class.
This also fixes a very old (but minor) bug: when a word containing a
joker was played "manually" (i.e. not via a round generated by the
Results class but via the Game::checkPlayedWord() method), subsequent
search results using this joker on the board would display it as a
joker, not as a normal tile.
2012-02-21 08:22:32 +01:00
Olivier Teulière
b855c5f64e Simplify slightly the Round API 2012-02-21 08:22:32 +01:00
Olivier Teulière
0be2769dfa New utility methods to get the lowercase (joker) or uppercase (no joker) variant of a tile 2012-02-21 08:22:32 +01:00
Olivier Teulière
0d45fc6227 When showing a preview on the board, do not hijack the normal internal data 2012-02-21 08:22:32 +01:00
Olivier Teulière
0ae77a659e Cosmetics 2012-02-21 08:22:32 +01:00
Olivier Teulière
1336e3b65d Board: use the isVacant() method a bit more 2012-02-19 13:07:29 +01:00
Olivier Teulière
16a9a9b1a9 Removed Game::setTestTound() and Game::removeTestRound().
They are still available via the PublicGame class for interfaces.
2012-02-19 13:07:29 +01:00
Olivier Teulière
24d601543a Removed a useless include 2012-02-19 13:07:29 +01:00
Olivier Teulière
bf42c49850 Added loggers to most classes 2012-02-19 13:07:29 +01:00
Olivier Teulière
684880acbe Moved debug.h to dic/ 2012-02-19 13:07:29 +01:00
Olivier Teulière
5d98402891 Changed the prototype of PlayedRack::getRack() (and similar methods) 2012-01-26 21:10:41 +01:00
Olivier Teulière
e09f7f675e When all the moves are invalid for a turn, play the master move anyway 2012-01-17 23:49:09 +01:00
Olivier Teulière
13f4a3c346 Use the master move.
When no master move is defined, define a valid one using the best played
move (or the best playable move if all the played moves were invalid).
2012-01-17 23:35:16 +01:00
Olivier Teulière
1bc9c2f0f1 Implement (de)serialization of the MasterMoveCmd class 2012-01-17 23:15:05 +01:00
Olivier Teulière
744e90e6ca New command to define a master move. 2012-01-17 23:15:05 +01:00
Olivier Teulière
e327d4605d Always consider that the played move was played by the first player.
Knowing the actual player is not always possible, since potentially none
of the players has found the played move (for example in arbitration
mode). This ID is now only used to retrieve the rack from which the move
was formed, so any player ID will do.
The non-regression tests have been adapted accordingly.
2012-01-17 21:57:03 +01:00
Olivier Teulière
c81df46b5e Added a new type of move: NO_MOVE 2012-01-17 00:56:02 +01:00
Olivier Teulière
d32f3fdf81 Use assertions where appropriate 2012-01-17 00:56:02 +01:00
Olivier Teulière
482b5d674f Previewing a Round is now possible in all the game types.
It was only possible in Training mode. This change will be useful for
the future arbitration mdoe.
2012-01-17 00:43:19 +01:00
Olivier Teulière
90ce7e1111 Removed some useless code 2012-01-12 15:26:27 +01:00
Olivier Teulière
413d93c7cb Remove debug not meant to be committed. 2012-01-12 15:14:23 +01:00
Olivier Teulière
f2d25bc0d6 Include config.h before checking macro definitions 2012-01-05 20:43:57 +01:00
Olivier Teulière
9aea22d968 Use an enum for the variants 2011-08-28 19:25:26 +02:00
Olivier Teulière
56b66fea28 Added setters to GameParams, to simplify the code a little 2011-08-28 19:25:26 +02:00
Olivier Teulière
befe577fe7 Got rid of Game::getModeAsString() 2011-08-28 19:25:26 +02:00
Olivier Teulière
17bdd27899 Moved the dictionary to the GameParams class 2011-08-28 19:25:26 +02:00
Olivier Teulière
408c92df42 Moved the game mode to the GameParams class 2011-08-28 19:25:26 +02:00
Olivier Teulière
3d48facb55 Cosmetics 2011-08-28 19:25:26 +02:00
Olivier Teulière
d6fbd6bef1 Allow combining several variants in a single game 2011-08-28 18:47:25 +02:00
Olivier Teulière
38f3a456bb Handle the "7 among 8" variant in a few more places 2011-08-28 15:52:12 +02:00
Olivier Teulière
fd0bf204cc Fixed the variable used in board* 2011-08-27 21:55:49 +02:00
Olivier Teulière
fdc29871e5 New GameParams class to wrap a few game characteristics.
These characteristics will not change during the game.
2011-08-27 21:55:49 +02:00
Olivier Teulière
3b4750d3bf Round: the m_bonus field should be of type bool, not int. 2011-08-27 21:55:49 +02:00
Olivier Teulière
cfa88072a3 Replace the use of convertToMb() and convertToWc() with macros 2011-07-30 19:48:05 +00:00
Olivier Teulière
9e71372c42 Simplified the readFromUTF8() prototype 2011-07-30 19:46:47 +00:00
Olivier Teulière
424fd3af32 Display the points of the word entered by the player before validating it. 2011-07-16 23:31:17 +00:00
Olivier Teulière
23771f3f71 Indicate the end of the game 2011-01-30 00:23:45 +00:00
Olivier Teulière
7bb432b954 Removed a useless include 2011-01-29 23:50:14 +00:00
Olivier Teulière
0c76b9d781 Simplified the looging macros, and added logs in various key places. 2011-01-29 23:47:20 +00:00
Olivier Teulière
e175a6d8bc Added a new (optional) dependency on log4cxx, to enable logging.
If disabled (the default), everything is compiled away.
2011-01-16 21:30:30 +00:00
Olivier Teulière
c3785555b9 Print to stderr the complete stack trace in case of exception or segmentation fault.
This feature will only be activated in debug mode, and if available on the platform.
The symbols will even be demangled if possible (i.e. if compiled with g++).
2010-10-17 21:23:39 +00:00
Olivier Teulière
b7fff8b4a1 - Removed various C-style casts
- Factorized code in the Bag class
2010-03-06 16:54:20 +00:00
Olivier Teulière
5642bfa191 Fixed loading of games, for languages with multichar letters like Catalan 2010-03-06 16:53:37 +00:00
Olivier Teulière
7dcd9898ed Fixed a bug in PercentResults: AI players with a level lower than 100 could still play as if they were (almost) at level 100! 2010-02-20 13:31:12 +00:00
Olivier Teulière
65ae7075fd Make the destructor of the parent class virtual, since the class has virtual methods 2010-01-28 22:24:11 +00:00
Olivier Teulière
1756185f08 Compilation fix, when libconfig++ is missing 2010-01-28 22:23:47 +00:00
Olivier Teulière
2eb28d61c5 Use expat instead of libxml2: it is much smaller, and is easier to use with Arabica when cross-compiling for Windows 2009-12-06 00:07:35 +00:00
Olivier Teulière
3c7a84d543 Support saving/loading games (any game type) in XML format.
Status:
It works well, but there are still a few details to improve/fix

More details about the changes:
 - New dependency on Arabica and Libxml2 to parse the XML
 - Loading the old format is still supported for this release, but won't be supported anymore in the next one
 - Games are now only saved in the new format
 - In training mode, the player is now created externally, like in the other modes
 - Avoid using GameIO (the one from game/) whenever possible
 - Do not use a FILE* argument anymore when loading a game
 - Throw and catch exceptions correctly when a game cannot be loaded or saved
 - The non-regression tests now use a new method to print the game history
2009-11-29 16:01:31 +00:00
Olivier Teulière
bb13f634b3 Sort the training results using the dictionary order as alphabetical order 2009-07-03 23:00:12 +00:00
Olivier Teulière
02e4cb2970 - Invalid moves should be in the display form
- Moved some code from Header to Dictionary
2009-07-03 21:40:14 +00:00
Olivier Teulière
4fda3fed5e Support display and input strings in the dictionary header 2009-06-28 10:55:24 +00:00
Olivier Teulière
3a82ab75fd More uses of the display characters 2009-06-23 13:21:19 +00:00
Olivier Teulière
47e4b8c6b0 Simplifications 2009-06-23 12:56:40 +00:00
Olivier Teulière
7569a58bb7 Each letter (tile) now has a display string, defaulting to its internal char. It is not yet possible to change it.
This display string is used in the ncurses and Qt interfaces.

Display strings are types "wdstring" instead of plain "wstring" in a few places (not all of them) to help recognize them.
2009-06-23 12:41:53 +00:00
Olivier Teulière
7f1c0def1a - Do not allow vertical words for the first turn in duplicate mode
- Adapted unit tests
2009-03-18 18:54:41 +00:00
Olivier Teulière
3bde966efb Fixed a compilation warning (potential buffer overflow) 2009-03-18 18:53:57 +00:00
Olivier Teulière
6f14e34fe7 Allow the first word to be vertical 2009-03-12 18:56:25 +00:00
Olivier Teulière
6f9a343677 - Fixed the previous fix for joker games, for real this time
- Added tests for joker and explosive games in all modes
2009-02-21 16:56:32 +00:00
Olivier Teulière
903905c7bc Fixed a regression: joker games were not working correctly in version 1.8.
Thanks to Marcel Jolly for spotting this
2009-02-19 18:26:11 +00:00
Olivier Teulière
ed2a20a3e3 - Allow setting the coordinates of the played word by clicking on the board
- New PlayWordMediator class, to encapsulate the behaviour of the controls
   used to play a word
 - The Training mode now has input fields to play words directly, without
   choosing them in the search results
2009-02-19 18:25:17 +00:00
Olivier Teulière
a8b842a1a7 - Added missing files in the build system
- One more update of the French translation
2009-01-24 23:02:42 +00:00
Olivier Teulière
1df3c3ff51 Updated a few copyright dates 2009-01-24 17:44:56 +00:00
Olivier Teulière
4ffaef3e1d - Throw exceptions in case of problem in Duplicate::setPlayer()
- Clean up of the text interface:
    - removed all uses of wcstok()
    - factorized common code
    - made code a bit more robust
2009-01-24 17:11:07 +00:00
Olivier Teulière
7a5056354a - Setting the rack manually is now done via a command, and can thus be undone
- Added non-regression tests for the navigation in the game history (all modes), and removed a less useful test
2009-01-24 10:28:20 +00:00
Olivier Teulière
87e1d4795b Sorting the search results happens to be quite slow, often much slower than the search itself.
But we don't need to sort them all the time, and in general we don't even need to keep all the rounds.

This commit greatly improves the search performance by filtering the results in 3 different ways, depending on the context:
 - A limit to the number of results can be given (useful for the training mode). The kept results are the best ones, not the first ones found by the search.
 - When only the best round is needed (when the AI is playing with level 100, or when preparing the rack for an explosive game), we don't need to keep rounds with a lower score
 - When the AI has a level lower than 100, it is still possible to skip many rounds

The search limit in training mode is configurable (defaulting to 100) and can be deactivated.
2009-01-22 18:30:22 +00:00
Olivier Teulière
771ba0c35e New BoardSearch class to avoid carrying const parameters all over the place.
No functional change.
2009-01-17 14:57:32 +00:00
Olivier Teulière
8b9478542a - The core is now able to handle "explosive games" ("parties détonantes"). No interface uses this ability yet.
- Fixed a bug in Game::helperSetRackRandom()
2009-01-14 21:53:37 +00:00
Olivier Teulière
229f1fcc14 - Removed the RACK_MANUAL enum value, and the obsolete Training::setRack() method
- qt/board_widget.cpp: cosmetics
2009-01-11 14:20:35 +00:00
Olivier Teulière
5b1e228fb5 New command to handle the player points, useful to handle the end of a free game 2008-11-30 21:10:25 +00:00
Olivier Teulière
687a31bee8 The AI passes instead of changing letters when it has nothing to play 2008-11-30 21:09:37 +00:00
Olivier Teulière
81b44a8050 - When displaying an old turn, do not allow playing
- Turns start at 0 instead of 1, to indicate that nothing was played on the first turn
2008-11-30 21:08:29 +00:00
Olivier Teulière
06dd7dff71 Removed Game::back() 2008-11-30 21:07:19 +00:00
Olivier Teulière
67306bec3e Added auto-execution of commands when clearing future commands.
The goal is to automatically replay commands involving AI, so that the user cannot be 'blocked'.
2008-11-30 20:55:45 +00:00
Olivier Teulière
f6d7804847 - New PublicGame class, intended to be used by the interfaces instead of accessing Game directly
- Migrated the text, Qt and ncurses interfaces to the new PublicGame API.
2008-11-30 20:53:44 +00:00
Olivier Teulière
d4f4646b4f Get rid of Duplicate::prevHumanPlayer() and Duplicate::nextHumanPlayer() + cosmetics 2008-11-30 20:51:42 +00:00
Olivier Teulière
a79b71f028 When navigating in the history, display the current turn in the status bar 2008-11-30 20:51:05 +00:00
Olivier Teulière
c430d712b8 Improved debugging 2008-11-23 20:13:02 +00:00
Olivier Teulière
13f2e8daad - Really fixed duplicate games when noone plays a valid move
- Added a unit test to ensure it
 - Fixed Game::back() (this fixes some unit tests broken by a previous commit)
 - Added a unit test for a duplicate game with only one player
2008-11-23 18:18:02 +00:00
Olivier Teulière
fa225881c0 Do not allow navigating before the first turn, and do not count an empty turn as a real one when navigating.
The navigation in the history is now more natural.
2008-11-23 17:08:12 +00:00
Olivier Teulière
8e7c61e2d8 New command to handle changes of the current player. This fixes history navigation in free game mode 2008-11-23 17:07:42 +00:00
Olivier Teulière
e8cd922186 New Duplicate::MarkPlayedCmd command to change the "hasPlayed" status of a player, in duplicate mode 2008-11-23 17:06:44 +00:00
Olivier Teulière
9dc84ed963 - Duplicate: end turns after defining the new rack, not before
- FreeGame: create an additional turn after defining the initial rack
2008-11-23 17:05:13 +00:00
Olivier Teulière
b5c63ea6e3 Removed the useless return value of Game::start() 2008-11-23 17:04:40 +00:00
Olivier Teulière
40d25bd63a Handle the case when all players play an invalid move 2008-11-23 17:03:29 +00:00
Olivier Teulière
53cccd529e Added toString() methods to the commands to ease debugging 2008-11-23 17:02:33 +00:00
Olivier Teulière
7fa8c2b58f Removed experimental support of the real bag. It was not a good idea after all... 2008-11-23 16:58:31 +00:00
Olivier Teulière
675b534e77 - Fixed compilation in debug mode
- Centralized navigation in the game history in the Navigation class
 - The Qt interface now has (very) basic controls to navigate in the history.
2008-11-23 16:55:28 +00:00
Olivier Teulière
bce4ce4604 - The main game modifications (playing a move, setting a new rack, ...) are now done using the Command design pattern, which alows undoing these changes easily.
- Added support for navigation in the game history to the text interface (not unit-tested yet)
2008-11-23 08:18:03 +00:00
Olivier Teulière
4b766d2622 - Bumped version to 1.8-cvs
- Improved the error message when the dictionary cannot be loaded at startup
 - Updated the french translation
 - Made some Game fields private
 - Added more constness
2008-11-22 14:40:25 +00:00
Olivier Teulière
70be50c64e A lot of clean-up:
- Removed logiv from the History class
 - Used BOOST_FOREACH to simplify loops
 - Remove useless annotations and doxygen blocks
 - Added some constness
 - Marked Training::setRack() as deprecated
 - Improved compilation order in game/
2008-11-22 13:09:28 +00:00
Olivier Teulière
e3ef487ebb Sort the search result in a predictible way. The unit tests have been adapted accordingly. 2008-10-16 17:51:16 +00:00
Olivier Teulière
350666b568 - The last commit in cross.cpp fixed a bug but introduced another one, now both are fixed
- Added unit tests for both bugs
 - Fixed another bug preventing to enter some letters in the training rack
2008-10-15 19:43:23 +00:00
Olivier Teulière
fa5d97f942 - Be slightly more tolerant in release mode
- Prepare for release 1.7
2008-09-25 20:39:37 +00:00
Olivier Teulière
9498d044f8 - Install a desktop file to get an entry in the applications menu on Linux (works on both Gnome and KDE)
- New (optional) dependency on the libconfig library, to save/load configuration files.
 - On Unix, the location of the configuration file respects the XDG Base Directory Specification.
 - The contrib system automatically fetches and builds libconfig for Windows cross-compilation
 - Fixed make distcheck
2008-09-22 21:21:38 +00:00
Olivier Teulière
a9626975e0 - Support shuffling the rack of the current player
- More intuitive players management (in particular when there are several
   human players)
2008-09-14 17:56:18 +00:00
Olivier Teulière
12cc41fce7 Core:
- Fixed a crash on Windows
 - Do not authorize words if the cross-checks are invalid (it was possible when playing a joker)
 - Fixed detextion of invalid moves
 - Improved unit tests, and fixed a bug in one of them

Qt interface:
 - Do not allow playing a word if the coordinates are missing
 - Better focus
2008-09-13 21:32:45 +00:00
Olivier Teulière
0696a1b4a2 Qt interface:
- Be more explicit if the dictionary name is missing
 - Changed the colour of the joker on the board, instead of displaying it in lower case
 - Incorrect words are now refused by default
 - Changed the way words are input: the case is no longer relevant,
   and the coordinates are in a separate control
 - Explain the problem when a word is refused
 - Updated the French translation
2008-09-07 21:06:17 +00:00
Olivier Teulière
990f4c5212 Qt interface:
- Initialize the random numbers generator, and print the seed value
 - Handle properly Qt builds without STL support
 - Save the position of the main window
 - Got rid of the useless toolbar
 - Better size of the preferences dialog
 - Hopefully fixed translation issues on Windows
 - The Settings class throws an exception when asked for a non-existing setting
2008-09-05 21:31:30 +00:00
Olivier Teulière
75a67b28a5 Dic:
- Throw an exception if a regular expresison is invalid
 - Handle the exception in callers code

Game:
 - Fixed a bug in setRackRandom()

Qt interface:
 - Display the dictionary name in the status bar
 - Implemented printing
 - Translation of the interface into French. The menus have temporarily lost their accelerator keys in English.
2008-08-31 11:48:11 +00:00
Olivier Teulière
fa493d4135 Fixed a warning 2008-07-27 15:26:15 +00:00
Olivier Teulière
7ea51d2f23 Compilation fixes for some systems (missing headers) 2008-07-20 12:15:51 +00:00
Olivier Teulière
597673e8e5 Fixed an invalid read when sorting the search results and adapted regression scenarii 2008-07-04 19:03:12 +00:00
Olivier Teulière
cc70ccabef Fixed typos 2008-07-03 20:14:46 +00:00
Olivier Teulière
c7f85ce151 - Search results with the same score are now sorted alphabetically
- Adapted test scenarii for the new order of results
2008-03-03 22:13:58 +00:00
Olivier Teulière
0acc5cd48f Do not try to complete the rack when no letter was removed 2008-02-12 21:02:39 +00:00
Olivier Teulière
52b7363888 Players are not created by the Game object anymore but by the user of the class.
This allows more flexibility, in particular to choose the type of player or its name.
2008-01-28 19:17:33 +00:00
Olivier Teulière
d8780822c2 - Fixed a bug due to the reject sign '-' preventing to load a saved training game
- Qt interface: Loading and saving a game is now supported (it only works in
   training mode, due to limitations in the core)
2008-01-26 10:10:50 +00:00
Olivier Teulière
0a4b342f78 - Players can now have a name
- Use player names in the ncurses interface
 - In training mode, create the hidden player in the constructor, not in start()
 - When the AI has nothing to play, change the letters instead of simply passing
 - New Makefile to build the win32 dependencies automatically (INSTALL file updated)
2008-01-19 19:33:08 +00:00
Olivier Teulière
8c3708fa99 - Removed Game::setRackRandomOld() (replaced by Game::setRackRandom())
- Adapted regression scenarii
2008-01-15 14:56:38 +00:00
Olivier Teulière
572b31c64e - dic/encoding.cpp: simplification (this also removes a warning)
- game/rack.*: added a missing const
 - game/game_io.cpp: fixed a compilation warning
2008-01-11 10:09:26 +00:00
Olivier Teulière
7e7f7f2dfa - wxwin/mainframe.cc: Fixed a crash occurring when no config file is found
- Fixed a bug occurring in duplicate mode: sometimes the game ended too early,
   while it was still allowed to go on.
   Also updated the corresponding regression scenario
2008-01-10 10:23:36 +00:00
Olivier Teulière
81e980104f - Board::GetLetterMultiplier() and Board::GetWordMultiplier() are now static
- Added 2 convenient getters: Dictionary::getName() and Bag::getDic()
2008-01-09 10:48:19 +00:00
Olivier Teulière
ba230eda60 - Bumped version number to 1.6
- Used the -Wall option of automake, and fixed the reported warnings
 - Updated french translation
2008-01-08 16:09:08 +00:00
Olivier Teulière
e7a8d01a8d Merged the "cppdic" branch back into HEAD.
There are too many change to list properly, here is an overview of the main changes:
 - the dictionary is now in C++
 - the dictionary has a new format, where it is possible to specify the letters,
   their points, their frequency, ... It is backwards compatible.
 - Eliot now supports non-ASCII characters everywhere
 - i18n of the compdic, listdic, regexpmain binaries
 - i18n of the wxWidgets interface (now in english by default)
2008-01-08 13:52:32 +00:00
Antoine Fraboulet
d86bd2af4a - 32/64 bits types
- unused function parameters
2007-08-04 20:01:27 +00:00
Olivier Teulière
5199b6b7c1 Cosmetic changes 2006-12-23 16:48:15 +00:00
Olivier Teulière
421d0a29b1 Fixed a few char/wchar_t issues. The remaining ones need a wchar_t-aware dictionary 2006-12-23 13:50:43 +00:00
Olivier Teulière
9949225b8b Fixed a nasty bug, due to the way jokers are handled 2006-11-05 17:04:39 +00:00
Antoine Fraboulet
5b8cbbe680 - correct typo on alignment 2006-11-05 13:31:49 +00:00
Antoine Fraboulet
ec3a91e444 - _wtoi correction 2006-11-05 13:30:54 +00:00
Antoine Fraboulet
603a75a98c - extra debug output command for board cross info
- simplified cross class
- bug fix on cross information handling during backward moves
2006-11-05 13:30:06 +00:00
Antoine Fraboulet
69dada550b - add "load" in game_factory 2006-08-11 22:14:21 +00:00
Antoine Fraboulet
8d79f6ba78 - typo in declaration 2006-08-11 22:13:41 +00:00
Antoine Fraboulet
9f86b53021 - add debug strings 2006-08-11 22:13:02 +00:00
Antoine Fraboulet
f9af9493d2 - bug correction for game::play when playing on a joker tile 2006-08-11 22:12:10 +00:00
Olivier Teulière
bb5a17d0f1 Indentation 2006-01-22 20:48:17 +00:00
Olivier Teulière
77be2e9219 Backport of the 'multibyte' branch on HEAD. 2006-01-22 12:23:52 +00:00
Olivier Teulière
2799f5191e Use forward declarations to reduce dependencies 2006-01-02 19:05:37 +00:00
Antoine Fraboulet
4665fa176b - add comments and emacs mode 2006-01-01 19:49:35 +00:00
Antoine Fraboulet
55badf52e4 - correct helperSetRackRandom with RACK_ALL (replace tiles in bag)
- add game_io.cpp to load/save a game
2006-01-01 19:48:36 +00:00
Antoine Fraboulet
5bdca9e9fd - pldrack.h
add comments and emacs mode
    add modes for toString

- pldrack.cpp
    add modes for toString
    add bool "reject", should be used later to notify a reject during game
    add setRack(string)
2006-01-01 19:47:26 +00:00
Antoine Fraboulet
63005cdddb add comments and emacs mode 2006-01-01 19:47:03 +00:00
Antoine Fraboulet
fee2ddff8f - revert dic_chr patch. make dic_char instead. 2006-01-01 19:37:57 +00:00
Antoine Fraboulet
fea2ba6068 - correct off by one in score, once again. index+1 is right !
- revert previous dic_chr patch. make dic_char instead.
   The board should/will use codes instead of tiles for performance reasons
   in the next version
2006-01-01 19:37:26 +00:00
Antoine Fraboulet
2c262bcc34 Game load/save handling 2006-01-01 19:36:16 +00:00
Olivier Teulière
3ecf740432 - do not use std:: everywhere, it justs makes the code harder to read
- history.h: use forward declarations to reduce dependencies
 - history.cpp: fixed a compilation warning
2005-12-27 16:54:38 +00:00
Olivier Teulière
9aeeafa61b Removed the useless Game::getPlayerRack() method 2005-12-27 15:01:07 +00:00
Olivier Teulière
af720a02ee - Commented out some debug messages preventing the regression to work properly.
- Re-indented a few lines to remove tabulations and keep a consistent coding style
2005-12-27 13:11:17 +00:00
Antoine Fraboulet
fc157bc08f - correct bug in Game::back
- add regression test for this case
2005-12-27 01:06:54 +00:00
Antoine Fraboulet
d3e9d1e0ac - off by one in History. corrected. all regression tests ok.
Scenario: training_dict
Scenario: training_bag
Scenario: training_search
Scenario: training_play
Scenario: duplicate_2_ai
Scenario: freegame_passing
Scenario: freegame_change
Scenario: freegame_3_ai

Summary: Everything was OK.
2005-12-27 00:06:23 +00:00
Antoine Fraboulet
4c56636aef - use History class
- back is still buggy
2005-12-26 22:58:58 +00:00
Antoine Fraboulet
4881a63f75 - use History class 2005-12-26 22:58:19 +00:00
Antoine Fraboulet
1ea7bbaf9e - comment update 2005-12-26 22:57:44 +00:00
Antoine Fraboulet
e25d5825a6 - add toString 2005-12-26 22:56:40 +00:00
Antoine Fraboulet
061242ed15 - correct empty round to have valid coord 2005-12-26 22:55:26 +00:00
Antoine Fraboulet
712ddb5125 - use of History class 2005-12-26 22:54:02 +00:00
Antoine Fraboulet
3f4c290745 - modified to use History
- add setRack wrapper for both manual and random
2005-12-26 22:53:26 +00:00
Antoine Fraboulet
28fcd062bf - add toString method 2005-12-26 22:52:38 +00:00
Antoine Fraboulet
3bde5c3da5 - since we use History, the first round is numbered 1
- separate sort_by_points method, removed call from board_search
2005-12-26 21:22:21 +00:00
Antoine Fraboulet
1fb948cba9 - player now use History class for turn storage 2005-12-26 21:18:21 +00:00
Antoine Fraboulet
74900ca592 - add simple printout debug msg 2005-12-26 21:10:59 +00:00
Antoine Fraboulet
7bc239adfc - add toString() method 2005-12-26 21:08:08 +00:00
Antoine Fraboulet
159cb33b75 - add history.[h|cpp] 2005-12-26 20:13:02 +00:00
Antoine Fraboulet
91442662d0 - fixed typo 2005-12-26 19:43:21 +00:00
Antoine Fraboulet
9fa76dda0e Makefile.am 2005-12-26 19:19:42 +00:00
Antoine Fraboulet
983d413a3b - adding empty constructor for History 2005-12-26 19:17:49 +00:00
Antoine Fraboulet
504198b8ff - adding shortcut for getCurrentPlayer() 2005-12-26 18:09:52 +00:00
Antoine Fraboulet
f3ee945b91 - remove results members access methods from Training Class
- add m_testPlay for temporary placed words
2005-12-26 18:07:26 +00:00
Antoine Fraboulet
9b9fcfae4c - re-enabling toString() 2005-12-26 15:53:37 +00:00
Antoine Fraboulet
ce001c7aa2 - adding getWord and toString methods 2005-12-26 15:52:48 +00:00
Antoine Fraboulet
3c31b8a2e2 - backport modifications from branch 2005-12-26 15:33:15 +00:00
Olivier Teulière
96fe9f22b1 Dic_chr returns the actual char, not a code between 0 and 31.
Dic_lookup takes a string containing real chars, not codes.
The idea is to hide the internal representation of the characters from the
users of the dictionary, who don't care about it.
2005-12-24 18:42:44 +00:00
Olivier Teulière
5f74291e5c Fixed a typo in a comment 2005-12-23 22:19:22 +00:00
Olivier Teulière
777a6a5e8c The constuctors of the players now take as argument the ID of the player 2005-11-06 17:13:45 +00:00
Olivier Teulière
9e5b6e8ebf Use Turn objects for the players history too 2005-11-06 14:53:15 +00:00
Olivier Teulière
966418bf98 Typo 2005-11-06 01:09:41 +00:00
Olivier Teulière
4cef120cce Minor factorization, and avoided another copy of PlayedRack 2005-11-06 01:05:06 +00:00
Olivier Teulière
d64e22dc6b Fixed a typo and avoided a useless copy 2005-11-06 00:38:16 +00:00
Olivier Teulière
26b446f62b Simplification in the PlayedRack history at Player level 2005-11-05 23:57:41 +00:00
Olivier Teulière
03e8a80128 Use a vector of Turn objects instead of several history vectors 2005-11-05 23:22:41 +00:00
Olivier Teulière
5b682ef9b8 - Removed Game::format*
- Added Game::getPlayer
2005-11-05 15:48:59 +00:00
Olivier Teulière
12894e00e2 Take more advantage of the Coord class, and remove the useless accessors
from Round (to force using the Coord object)
2005-11-05 13:56:59 +00:00
Olivier Teulière
85a30f16a2 Use the Coord class for rounds 2005-11-05 11:01:58 +00:00
Olivier Teulière
50fc82f60c First backports from the branch (Game::getBoard and Game::getBag, mainly) 2005-11-04 23:26:03 +00:00
Olivier Teulière
fe13a5e627 Removed the $Id:$ lines on HEAD 2005-11-04 20:00:05 +00:00
Olivier Teulière
83bf9d8b37 Check the mandatory options in the command-line, to output a better error
message
2005-10-23 16:12:29 +00:00
Olivier Teulière
e3bc46b114 Updated licence text with FSF's new address. 2005-10-23 14:53:42 +00:00
Antoine Fraboulet
6626d0ee8c Game history class, will be used for games and players 2005-08-15 22:20:20 +00:00
Antoine Fraboulet
b4e52e47cc Eliot coordicate system 2005-08-15 18:14:52 +00:00
Antoine Fraboulet
3f438199a9 A turn is a tuple (Num,Player,PlayedRack,Round) 2005-08-15 18:13:57 +00:00
Olivier Teulière
eccb1ca5bb Pass argument by reference to avoid a copy 2005-04-20 20:58:51 +00:00
Olivier Teulière
1895268549 Simplification; this should fix the compilation problem with gcc 3.4 2005-04-20 18:52:39 +00:00
Antoine Fraboulet
1077565ace added toCode() function that should clarify the interface with the
dictionary. This function should be used wherever it applies to get
the internal dictionnary code that match the Tile.
2005-04-19 16:24:32 +00:00
Antoine Fraboulet
0d69751dfb "int getNCharInBag(char) const" changed to "int getNCharInBag(Tile) const;" 2005-04-19 16:23:04 +00:00
Olivier Teulière
25304bd978 test/*: Added non-regression tests, based on the text interface.
'regression.pl' is the script that runs the regression, and 'drivers' contains
the list of scenario files to be played.
By default, the complete regerssion is played, but you can play specific
scenarios by adding them to the command-line.
Example: ./regression.pl training_bag freegame_change
2005-04-16 15:47:59 +00:00
Olivier Teulière
b16b969406 When the letters to change are incorrect, do not end the turn for the player 2005-04-16 15:43:14 +00:00
Antoine Fraboulet
76178efe99 getPlayerRack display option added 2005-04-09 16:11:04 +00:00
Antoine Fraboulet
96e94a6be3 getPlayerRack display option added + Game::back() error return 2005-04-09 16:10:25 +00:00
Antoine Fraboulet
5e08e1cf6a manually entered racks can be lowercase or uppercase 2005-04-09 15:14:00 +00:00
Antoine Fraboulet
aa828e1f8e int -> unsigned int return values (count and points) 2005-04-09 14:58:24 +00:00
Antoine Fraboulet
8ed5045d75 minor modifications 2005-04-09 14:56:03 +00:00