Commit graph

77 commits

Author SHA1 Message Date
Olivier Teulière
dd44196d21 Renamed _wtoi into wtoi to avoid a name collision with mingw32 headers 2010-05-20 20:27:47 +00:00
Olivier Teulière
ddfb55593e Fixed compilation of the ncurses interface on Mac OS X 2010-02-01 21:26:11 +00:00
Olivier Teulière
f2e3e64bc0 Compilation fix (needed to build on Mac) 2010-01-28 22:25:51 +00:00
Olivier Teulière
c878573183 Improved the handling of errors in the text interface 2010-01-01 17:59:39 +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
43d42a0388 Little hack to have the 7+1 search in alphabetical order (or more precisely, in the order of the letters as defined at dictionary creation) 2009-09-21 20:10:34 +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
da85bde477 First step in accepting various input strings for the same tile: input coming from the text interface is now passed through a conversion method (... which does nothing yet!) 2009-06-23 21:39:07 +00:00
Olivier Teulière
795c44827d Center correctly multi-chars letters in the text interface 2009-06-23 21:36:33 +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
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
8f72fd8152 - Always display characters in uppercase on the board (a lowercase character was still possible with a joker, in some rare cases)
- Fixed a compilation warning
2009-01-26 20:30:41 +00:00
Olivier Teulière
7fc8309868 - Text interface: removed uses of the 'n' command with a negative argument 2009-01-24 17:43:57 +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
d0294b5a38 - Echo the input in the text interface when libreadline is not present, so that the non-regression tests can still pass in this case.
- Changed a bad file format in a test, and adapted the reference accordingly
2009-01-15 20:55:57 +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
1f99311d51 - Allow changing a setting from the text interface
- Force a setting in one unit test to be sure of the test outcome
2008-11-23 18:18:59 +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
9e330cf83b In the text interface, display the seed used for the random number generator 2008-11-23 08:33:16 +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
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
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
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
37359e97c0 - Renamed the binaries: eliot is now the Qt interface, whereas wxeliot is the wxWidgets interface
- Embed the program icon into the executable on Windows: the icon is not visible in Windows explorer
 - Fixed gettext configuration on Windows. The translations now appear, but the accents still don't display correctly.
 - Fixed a few translation issues
2008-09-07 13:17:39 +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
90badeca21 - Fixed a bug in the parser, preventing to parse correctly some regular expressions with wide chars. The regular expressions seem now to work fine with a dictionary using polish words.
- More C++ in the automaton code
 - Simplified the code in several places
2008-07-27 13:32:47 +00:00
Olivier Teulière
7ea51d2f23 Compilation fixes for some systems (missing headers) 2008-07-20 12:15:51 +00:00
Olivier Teulière
11adaba410 - Added several tests for the regular expressions engine
- New regexp parser using Boost.Spirit. Lex and yacc are now gone.
   The main advantage of this new parser, apart from being purely C++,
   is that it can handle wide characters.
   Currently, the new parser does the same as the previous one, but the
   code is not yet ready to use regular expressions with non-ASCII
   dictionaries.
2008-07-07 17:29:59 +00:00
Olivier Teulière
414baa8d7a - Use vectors instead of lists to store the results of dictionary searches
- New parameter to most search functions, allowing to limit the number of results.
   No interface uses it yet.
2008-03-02 18:45:10 +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
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
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
831c578c3a Use Unix file fornat 2006-12-23 13:57:08 +00:00
Antoine Fraboulet
70041c80b3 - extra debug output command for board cross info 2006-11-05 13:27:49 +00:00
Antoine Fraboulet
6f00463fa1 - removed game loading commands in mode loops
- add game loading in main loop
- changed stderr to stdout for incorrect words during gameplay
2006-08-11 22:06:53 +00:00
Olivier Teulière
1e13d6bfad Release memory properly at exit, and fixed a new/free mismatch 2006-01-29 12:40:49 +00:00
Olivier Teulière
77be2e9219 Backport of the 'multibyte' branch on HEAD. 2006-01-22 12:23:52 +00:00
Antoine Fraboulet
30d6cc0687 - eliottxt.cpp
add "a P" command for standard format printout
    add regexp testing
    add performance testing
2006-01-01 19:32:44 +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
Antoine Fraboulet
240d106a9d - correct comment, removing loading game from training mode 2005-12-27 09:23:08 +00:00