position
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 515
showposition 0.5
showposition is a Web-based tool that shows (using Google Maps) the position provided in the URL. more>>
showposition is a Web-based tool that shows (using Google Maps) the position provided in the URL, with a comment provided in the URL.
showposition is useful if you want to explain to somebody (e.g. on Usenet) where something is.
<<lessshowposition is useful if you want to explain to somebody (e.g. on Usenet) where something is.
Download (0.003MB)
Added: 2006-06-14 License: GPL (GNU General Public License) Price:
1228 downloads
Games::AlphaBeta::Position 0.4.6
Games::AlphaBeta::Position is a base Position class for use with Games::AlphaBeta. more>>
Games::AlphaBeta::Position is a base Position class for use with Games::AlphaBeta.
SYNOPSIS
package My::GamePos;
use base qw(Games::AlphaBeta::Position);
sub apply { ... }
sub endpos { ... } # optional
sub evaluate { ... }
sub findmoves { ... }
package main;
my $pos = My::GamePos->new;
my $game = Games::AlphaBeta->new($pos);
Games::AlphaBeta::Position is a base class for position-classes that can be used with Games::AlphaBeta. It inherits most of its methods from Games::Sequential::Position; make sure you read its documentation.
This class is provided for convenience. You dont need this class in order to use Games::AlphaBeta. It is, however, also possible to make use of this class on its own.
<<lessSYNOPSIS
package My::GamePos;
use base qw(Games::AlphaBeta::Position);
sub apply { ... }
sub endpos { ... } # optional
sub evaluate { ... }
sub findmoves { ... }
package main;
my $pos = My::GamePos->new;
my $game = Games::AlphaBeta->new($pos);
Games::AlphaBeta::Position is a base class for position-classes that can be used with Games::AlphaBeta. It inherits most of its methods from Games::Sequential::Position; make sure you read its documentation.
This class is provided for convenience. You dont need this class in order to use Games::AlphaBeta. It is, however, also possible to make use of this class on its own.
Download (0.012MB)
Added: 2007-01-03 License: Perl Artistic License Price:
1026 downloads
Games::Sequential::Position 0.4.6
Games::Sequential::Position is a base Position class for use with Games::Sequential. more>>
Games::Sequential::Position is a base Position class for use with Games::Sequential.
SYNOPSIS
package My::GamePos;
use base Games::Sequential::Position;
sub init { ... } # setup initial state
sub apply { ... }
package main;
my $pos = My::GamePos->new;
my $game = Games::Sequential->new($pos);
Games::Sequential::Position is a base class for position-classes that can be used with Games::Sequential. This class is provided for convenience; you dont need this class to use Games::Sequential. It is also possible to use this class on its own.
<<lessSYNOPSIS
package My::GamePos;
use base Games::Sequential::Position;
sub init { ... } # setup initial state
sub apply { ... }
package main;
my $pos = My::GamePos->new;
my $game = Games::Sequential->new($pos);
Games::Sequential::Position is a base class for position-classes that can be used with Games::Sequential. This class is provided for convenience; you dont need this class to use Games::Sequential. It is also possible to use this class on its own.
Download (0.012MB)
Added: 2007-01-03 License: Perl Artistic License Price:
1025 downloads
gstring
The General String library was inspired by the Icon programming language string manipulation features. more>>
The General String library was inspired by the Icon programming language string manipulation features. This library has a GNU license, i.e. it is free. I encourage you to get acquainted with the GNU license and support it if you agree with it.
Icon has two interesting features that are very useful in string manipulation:
Generators: A construct that can generate a sequence of values, and fails when no more values are available.
This is somewhat similar to Javas Iterator. This General String library supports generators through the IGenerator interface.
Backtracking: An operation can consist of two (or more) generators associated together, e.g. through an operator, if the second generator fails, we backtrack to the first generator and retry the operation again.
Think of a database transaction to help you understand backtracking, although they are different. This General String library supports backtracking through the operator classes in the gstring.operators package.
Next is a simple example to show the elegance of these concepts. Suppose that you want to parse a string to find the indexes of vowels:
GString source = new GString("Hello world"); // String to be parsed
SetChar target = new SetChar("aeiou"); // Vowels
IGenerator g = source.doGenerate().find().generator(target); // a find generator
Variant v; // a variant to hold generated positions
// loop until no more generations
do {
v= g.next(); // get next position
if (g.ok()) // if successful generation then print position
System.out.println(v);
} while (g.ok());
The above example will print:
1
4
7
<<lessIcon has two interesting features that are very useful in string manipulation:
Generators: A construct that can generate a sequence of values, and fails when no more values are available.
This is somewhat similar to Javas Iterator. This General String library supports generators through the IGenerator interface.
Backtracking: An operation can consist of two (or more) generators associated together, e.g. through an operator, if the second generator fails, we backtrack to the first generator and retry the operation again.
Think of a database transaction to help you understand backtracking, although they are different. This General String library supports backtracking through the operator classes in the gstring.operators package.
Next is a simple example to show the elegance of these concepts. Suppose that you want to parse a string to find the indexes of vowels:
GString source = new GString("Hello world"); // String to be parsed
SetChar target = new SetChar("aeiou"); // Vowels
IGenerator g = source.doGenerate().find().generator(target); // a find generator
Variant v; // a variant to hold generated positions
// loop until no more generations
do {
v= g.next(); // get next position
if (g.ok()) // if successful generation then print position
System.out.println(v);
} while (g.ok());
The above example will print:
1
4
7
Download (0.054MB)
Added: 2005-09-27 License: GPL (GNU General Public License) Price:
1488 downloads
Term::Animation 2.3
Term::Animation is a Perl module that provides a framework to produce sprite animations using ASCII art. more>>
Term::Animation is a Perl module that provides a framework to produce sprite animations using ASCII art. Each ASCII sprite is given one or more frames, and placed into the animation as an animation entity.
An animation entity can have a callback routine that controls the position and frame of the entity. The module can also do collision detection between entities.
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
<<lessAn animation entity can have a callback routine that controls the position and frame of the entity. The module can also do collision detection between entities.
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
Download (0.018MB)
Added: 2006-12-19 License: Perl Artistic License Price:
1062 downloads
3D Spatialization of Sound
3D Spatialization of Sound is a Linux/X11 port of the 3D spatializer library from the CRC. more>>
3D Spatialization of Sound is a Linux/X11 port of the 3D spatializer library from the CRC.
This program creates "directional" stereo sound from mono source. CRC folks told me I shouldnt have raised the sampling frequency without adjusting other stuff.
Oh well. This was a proof-of-concept type project anyway. I think to get correct 3D effect, you need to drop sampling rate back to 11025.
To Build the X11 implementation:
1. make
2. cp audio-filter /usr/local/bin
3. mpg123 -m -s some_music.mp3 | audio-filter | aplay -S -s 44100 -f s16l -
audio-filter is implemented as a filter, it reads signed 16 bit mono input at 44100 khz from stdin, and outputs signed 16 bit stereo, 44100 khz output to stdout. You can replace mpg123 with any sound source generating signed 16 bit 44100 khz mono signal. "aplay" is a sound player utility which comes with ALSA linux sound driver. You can use "play" from the sox package, or "ampctl", or any other sound player that would read 44100 khz, signed 16 bit stereo raw data from stdin. For "sox" play script, you would replace "aplay" command line with "play -c 2 -f s -r 44100 -s w -t raw -"
If everything is good, a 640x480 window will come up, with some cryptic writing on the top, a filled circle with an arrow pointing right, and a empty circle slightly to the right of the circle with arrow.
NOTE, that just like in the original Windows implementation, the axiss are reversed. The arrow on the "head" is pointing "forward". So, in the default startup configuration, the sound is located in front of the listener. Moving the sound source "up" moves it to the left of the listener, and "down", to the right. You can visualize this well if you turn your monitor 90 degrees counter
clock wise.
The filled circle with an arrow is your "head"
The empty circle is the "sound source"
You can move the "sound source" around by clicking the mouse at any position in the window, or by clicking on the "sound source" circle, and dragging it to the desired position. Soundfield will be dynamically updated as you do this.
You can move the "head" by moving the mouse to desired position, and right-clicking. The "head" icon will move to the new position and soundfield will be updated.
<<lessThis program creates "directional" stereo sound from mono source. CRC folks told me I shouldnt have raised the sampling frequency without adjusting other stuff.
Oh well. This was a proof-of-concept type project anyway. I think to get correct 3D effect, you need to drop sampling rate back to 11025.
To Build the X11 implementation:
1. make
2. cp audio-filter /usr/local/bin
3. mpg123 -m -s some_music.mp3 | audio-filter | aplay -S -s 44100 -f s16l -
audio-filter is implemented as a filter, it reads signed 16 bit mono input at 44100 khz from stdin, and outputs signed 16 bit stereo, 44100 khz output to stdout. You can replace mpg123 with any sound source generating signed 16 bit 44100 khz mono signal. "aplay" is a sound player utility which comes with ALSA linux sound driver. You can use "play" from the sox package, or "ampctl", or any other sound player that would read 44100 khz, signed 16 bit stereo raw data from stdin. For "sox" play script, you would replace "aplay" command line with "play -c 2 -f s -r 44100 -s w -t raw -"
If everything is good, a 640x480 window will come up, with some cryptic writing on the top, a filled circle with an arrow pointing right, and a empty circle slightly to the right of the circle with arrow.
NOTE, that just like in the original Windows implementation, the axiss are reversed. The arrow on the "head" is pointing "forward". So, in the default startup configuration, the sound is located in front of the listener. Moving the sound source "up" moves it to the left of the listener, and "down", to the right. You can visualize this well if you turn your monitor 90 degrees counter
clock wise.
The filled circle with an arrow is your "head"
The empty circle is the "sound source"
You can move the "sound source" around by clicking the mouse at any position in the window, or by clicking on the "sound source" circle, and dragging it to the desired position. Soundfield will be dynamically updated as you do this.
You can move the "head" by moving the mouse to desired position, and right-clicking. The "head" icon will move to the new position and soundfield will be updated.
Download (0.046MB)
Added: 2006-10-19 License: GPL (GNU General Public License) Price:
1114 downloads
KMasterMind 2.2
KMasterMind is a mastermind game designed for K Desktop Environment. more>>
KMasterMind is a mastermind game designed for K Desktop Environment. KMasterMind game is written using Qt & KDE libraries.
KMasterMind is an intuitive game using the drag and drop mechanism for placing the pieces on site.
Enhancements:
- I added numerical labels to locate the position of the pieces and the ticks
- Tooltips for the toolbar buttons with the useful shortcuts
<<lessKMasterMind is an intuitive game using the drag and drop mechanism for placing the pieces on site.
Enhancements:
- I added numerical labels to locate the position of the pieces and the ticks
- Tooltips for the toolbar buttons with the useful shortcuts
Download (0.59MB)
Added: 2006-09-28 License: GPL (GNU General Public License) Price:
1121 downloads
pitchfork 0.5.3
pitchfork project is a webinterface to musicpd more>>
pitchfork project is a webinterface to musicpd. The client is relatively new so not all wanted features are implemented yet.
Main features:
- Adjusting of volume/position
- Move multiple songs around in playlist
- List style library browsing (filesystem/album/artist) and search
- Cropping/removing
- Server settings (random/repeat/xfade/outputs/update db)
- Quick add
- Album art
- Lyrics
<<lessMain features:
- Adjusting of volume/position
- Move multiple songs around in playlist
- List style library browsing (filesystem/album/artist) and search
- Cropping/removing
- Server settings (random/repeat/xfade/outputs/update db)
- Quick add
- Album art
- Lyrics
Download (0.19MB)
Added: 2007-06-25 License: GPL (GNU General Public License) Price:
859 downloads
PgcEdit 7.2
PgcEdit is a DVD IFO and Menu editor designed to allow the modification of the navigation commands and parameters of DVDs. more>>
PgcEdit is a DVD IFO and Menu editor designed to allow the modification of the navigation commands and parameters of an already authored DVD structure.
PgcEdit is also an excellent tool to learn how a DVD works, with his powerful Trace function.
Since v0.6.0, PgcEdit is also the first program able to burn a Double Layer DVD-Video on DL DVD+R or DL DVD-R, with an interactive interface (including a preview), to select the position of the layer break.
PgcEdit project is free and open source (GPL license).
<<lessPgcEdit is also an excellent tool to learn how a DVD works, with his powerful Trace function.
Since v0.6.0, PgcEdit is also the first program able to burn a Double Layer DVD-Video on DL DVD+R or DL DVD-R, with an interactive interface (including a preview), to select the position of the layer break.
PgcEdit project is free and open source (GPL license).
Download (MB)
Added: 2006-06-16 License: GPL (GNU General Public License) Price:
1227 downloads
Mp3Splt 2.1
Mp3splt is a command-line utility that splits MP3 and Ogg files at specified times without decoding and re-encoding. more>>
Mp3Splt is a command line utility to split mp3 and ogg files selecting a begin and an end time position, without decoding. Mp3splt project is very useful to split large mp3/ogg to make smaller files or to split entire albums to obtain original tracks.
If you want to split an album, you can select split points and filenames manually or you can get them automatically from CDDB (internet or a local file) or from .cue files.
Supports also automatic silence split, that can be used also to adjust cddb/cue splitpoints. You can extract tracks from Mp3Wrap or AlbumWrap files in few seconds.
Libmp3splt is an attempt to create a library from mp3splt.
Mp3splt-gtk is a GTK2 gui that uses libmp3splt.
<<lessIf you want to split an album, you can select split points and filenames manually or you can get them automatically from CDDB (internet or a local file) or from .cue files.
Supports also automatic silence split, that can be used also to adjust cddb/cue splitpoints. You can extract tracks from Mp3Wrap or AlbumWrap files in few seconds.
Libmp3splt is an attempt to create a library from mp3splt.
Mp3splt-gtk is a GTK2 gui that uses libmp3splt.
Download (0.12MB)
Added: 2005-11-24 License: GPL (GNU General Public License) Price:
1431 downloads
Volity::WinnersList 0.6.5
Volity::WinnersList is Perl class for Volity game record winners lists. more>>
Volity::WinnersList is Perl class for Volity game record winners lists.
SYNOPSIS
Heres code you might see in a Volity::Game subclass implementing a game where there is one winner and a bunch of losers, the latter of whom are all effectively tied for second place (we assume that the methods called in the first two lines are defined elsewhere):
if ($self->game_has_been_won) {
my ($winner, @losers) = $self->get_winning_seat_order;
$self->winners->add_seat_to_slot($winner, 1);
$self->winners->add_seat_to_slot(@losers, 2);
$self->end;
}
And heres what you might see in a subclass defining a score-using games where each player has a discrete ordinal place, and ties and ties are not possible (again assuming the presence of some magic methods defined somewhere else in the subclass):
if ($self->game_has_been_won) {
my @ordered_seats = $self->get_winning_seat_order;
for (my $index = 0; $index winners->add_seat_to_slot($ordered_seats[$index], $place);
}
$self->end;
}
Attached to every Volity::Game-subclass object is a WinnersList object, accessible through the game objects winners method. When a game wraps up, it should use the methods listed in this document to place the tables seats in a winning order before calling the end method. The referee will then use this information when it builds the game record to send to the Volity bookkeeper.
METHODS
slots
Accessor to the raw list of winner slots. Returns an array of anonymous arrays, each representing a single slot, in winning order: the one at index [0] is the winningest slot, and the one at [-1] is the losingest. Each of these slot-arrays contains a number of Volity::Seat objects.
add_seat_to_slot ($seat, $position)
Adds the given seat to the winners list at the given position. Note that the position is expressed in game-rank, so the first-place position is 1, not 0.
If there are already seats at the current position, the given seat will share the slot with them. As a shortcut, you can add several seats at once to the same slot by passing an arrayref of seats as the first argument.
seats_at_slot ($position)
Returns the list of seats the given position in the winners list. Note that the position is expressed in game-rank, so the first-place position is 1, not 0.
<<lessSYNOPSIS
Heres code you might see in a Volity::Game subclass implementing a game where there is one winner and a bunch of losers, the latter of whom are all effectively tied for second place (we assume that the methods called in the first two lines are defined elsewhere):
if ($self->game_has_been_won) {
my ($winner, @losers) = $self->get_winning_seat_order;
$self->winners->add_seat_to_slot($winner, 1);
$self->winners->add_seat_to_slot(@losers, 2);
$self->end;
}
And heres what you might see in a subclass defining a score-using games where each player has a discrete ordinal place, and ties and ties are not possible (again assuming the presence of some magic methods defined somewhere else in the subclass):
if ($self->game_has_been_won) {
my @ordered_seats = $self->get_winning_seat_order;
for (my $index = 0; $index winners->add_seat_to_slot($ordered_seats[$index], $place);
}
$self->end;
}
Attached to every Volity::Game-subclass object is a WinnersList object, accessible through the game objects winners method. When a game wraps up, it should use the methods listed in this document to place the tables seats in a winning order before calling the end method. The referee will then use this information when it builds the game record to send to the Volity bookkeeper.
METHODS
slots
Accessor to the raw list of winner slots. Returns an array of anonymous arrays, each representing a single slot, in winning order: the one at index [0] is the winningest slot, and the one at [-1] is the losingest. Each of these slot-arrays contains a number of Volity::Seat objects.
add_seat_to_slot ($seat, $position)
Adds the given seat to the winners list at the given position. Note that the position is expressed in game-rank, so the first-place position is 1, not 0.
If there are already seats at the current position, the given seat will share the slot with them. As a shortcut, you can add several seats at once to the same slot by passing an arrayref of seats as the first argument.
seats_at_slot ($position)
Returns the list of seats the given position in the winners list. Note that the position is expressed in game-rank, so the first-place position is 1, not 0.
Download (0.10MB)
Added: 2007-01-05 License: Perl Artistic License Price:
1022 downloads
Stardork 0.6
Stardork project is a Linux console-based space shooter/maze game. more>>
Stardork project is a Linux console-based space shooter/maze game.
Stardork is a Linux console based game where (.)s represent stars and are randomly placed on the screen.
(X) represents your space ship and you move in in all directions, including diagonally, to position yourself to shoot the goal (@).
You can also shoot missles in all directions. If you run into a star you lose power. If you shoot or run into the goal then you move up a level and more random stars are plotted.
This eventually creates a more and more complex maze of stars you must nagivate through to position yourself to shoot the goal.
Beat all 34 levels and you are a master stardork.
<<lessStardork is a Linux console based game where (.)s represent stars and are randomly placed on the screen.
(X) represents your space ship and you move in in all directions, including diagonally, to position yourself to shoot the goal (@).
You can also shoot missles in all directions. If you run into a star you lose power. If you shoot or run into the goal then you move up a level and more random stars are plotted.
This eventually creates a more and more complex maze of stars you must nagivate through to position yourself to shoot the goal.
Beat all 34 levels and you are a master stardork.
Download (0.003MB)
Added: 2006-11-24 License: GPL (GNU General Public License) Price:
1065 downloads
Xastir 1.9.1
Xastir ptoject can receive and plot APRS position packets. more>>
Xastir ptoject can receive and plot APRS position packets. Development is a collaborative effort of programmers from around the world. Xastir supports many map formats and is highly customizable. Check out the "Screen Shots" link to see just a few of the ways that Xastir can be used.
Xastir runs on Windows/MacOSX/Linux/FreeBSD/Solaris/Lindows, with many more possible. It supports 125 map formats, several types of TNCs and weather stations, Festival speech synthesizer, AX.25 networking (Soundmodem/Baycom/SCC!) and seven languages!. On Unix-like operating systems, you can run your weather station or GPS on a separate computer as well, which is good for those hams who are already short on serial ports.
Xastir is FREE! under the GPL license and comes with all source code.
<<lessXastir runs on Windows/MacOSX/Linux/FreeBSD/Solaris/Lindows, with many more possible. It supports 125 map formats, several types of TNCs and weather stations, Festival speech synthesizer, AX.25 networking (Soundmodem/Baycom/SCC!) and seven languages!. On Unix-like operating systems, you can run your weather station or GPS on a separate computer as well, which is good for those hams who are already short on serial ports.
Xastir is FREE! under the GPL license and comes with all source code.
Download (2.1MB)
Added: 2007-05-02 License: GPL (GNU General Public License) Price:
909 downloads

py-ssance3 1
An interesting 2D strategy game by Jambon which is written in Python more>>
py-ssance3 1 lets users enjoy an interesting 2D strategy game by Jambon which is written in Python
How to play : In turn both players put a counter in the column of their choice, the counter slides then up to the lowest possible position in the said column and it belongs then to the adversary to play. The victor is the player who accomplishes the first alignment (horizontal, vertical or diagonal) of three counters of his colour.
Requirements:
- Python
Added: 2009-07-22 License: Freeware Price: FREE
13 downloads
Shatranj 1.11
Shatranj is an bitboard-based, Open-Source, interactive chess programming module. more>>
Shatranj is an bitboard-based, Open-Source, interactive chess programming module which allows manipulation of chess positions and experimentation with search algorithms and evaluation techniques. Shatranjs goal is to write a toolkit to aid in implementing Shannon Type B chess programs.
As such, execution speed becomes less important then code clarity and expressive power of the implementation language. Having been written in an interpreted language, this module allows the chess programmer to manipulate bitboards in a natural, interactive manner much like signal processing toolkits allow communication engineers to manipulate vectors of sounds samples in MATLAB.
The module currenly implements a simple recursive minimax search with alphabeta pruning, iterative deepening, uses short algebraic notation, handles repetition check, and the 50 move rule. Features lacking are quiescent checks, transition tables, negascout and MTD searching.
The chess programming toolkit is available in the form of a Python module called shatranj.py. You will also likely need the opening book as well as some of the pre-built hash tables that are used throughout the module (these will be recalculated if the module cannot find the data file).
Place all three file in the same directory and simply run python on the python module ("python shatranj.py"). As far as requirements, all that is needed is a recent version of the interpreted, high level language called Python (anything after version 2.3 should work fine). If you would like a little bit of a speed boost, shatranj looks for the module Psyco and will use it if it is installed.
Until more documentation becomes available, here is a short sample session:
[Sam-Tannous-Computer:~/shatranj] stannous% python
>>> from shatranj import *
...reading startup data
...total time to read data 0.0774528980255
...found opening book shatranj-book.bin with 37848 positions
>>> position = Position("r1bqk2r/pppp1ppp/2n5/5N2/2B1n3/8/PPP1QPPP/R1B1K2R")
>>> all_pieces = position.piece_bb["b_occupied"] | position.piece_bb["w_occupied"]
>>> other_pieces = position.piece_bb["b_occupied"]
>>> from_square = c4
>>> wtm = 1
>>> mask = position.pinned(from_square,wtm)
>>> ne_pieces = diag_mask_ne[from_square] & all_pieces
>>> nw_pieces = diag_mask_nw[from_square] & all_pieces
>>> moves = ((diag_attacks_ne[from_square][ne_pieces] & other_pieces) |
... (diag_attacks_ne[from_square][ne_pieces] & ~all_pieces) |
... (diag_attacks_nw[from_square][nw_pieces] & other_pieces) |
... (diag_attacks_nw[from_square][nw_pieces] & ~all_pieces)) & mask
>>>
>>> moves
1275777090846720L
>>>
>>> tobase(moves,2)
100100010000101000000000000010100000000000000000000
>>> display(moves)
+---+---+---+---+---+---+---+---+
8 | | . | | . | | . | | . |
+---+---+---+---+---+---+---+---+
7 | . | | . | | . | 1 | . | |
+---+---+---+---+---+---+---+---+
6 | 1 | . | | . | 1 | . | | . |
+---+---+---+---+---+---+---+---+
5 | . | 1 | . | 1 | . | | . | |
+---+---+---+---+---+---+---+---+
4 | | . | | . | | . | | . |
+---+---+---+---+---+---+---+---+
3 | . | 1 | . | 1 | . | | . | |
+---+---+---+---+---+---+---+---+
2 | | . | | . | | . | | . |
+---+---+---+---+---+---+---+---+
1 | . | | . | | . | | . | |
+---+---+---+---+---+---+---+---+
a b c d e f g h
>>> position.show_moves(1)
[Rg1, O-O, f3, a3, Rb1, f4, Ba6,
Bh6, Bd3, Qg4, Qe3, Ne7, Be6, Nxg7,
Qxe4, Ne3, b4, Nh4, b3, Be3, Bg5,
g3, Kf1, Rf1, Nh6, a4, Ng3, Qh5,
Kd1, h4, h3, c3, Bxf7, Nd6, Bb5,
Nd4, Qf3, g4, Qf1, Bb3, Qd1, Qd3,
Qd2, Bd5, Bd2, Bf4]
>>>
>>> # now play a game!
>>> play()
Shatranj version 1.10
g: switch sides m: show legal moves
n: new game l: list game record
d: display board b: show book moves
sd: change search depth (2-16) default=5
q: quit
Shatranj: d
+---+---+---+---+---+---+---+---+
8 | r | n | b | q | k | b | n | r |
+---+---+---+---+---+---+---+---+
7 | p | p | p | p | p | p | p | p |
+---+---+---+---+---+---+---+---+
6 | | . | | . | | . | | . |
+---+---+---+---+---+---+---+---+
5 | . | | . | | . | | . | |
+---+---+---+---+---+---+---+---+
4 | | . | | . | | . | | . |
+---+---+---+---+---+---+---+---+
3 | . | | . | | . | | . | |
+---+---+---+---+---+---+---+---+
2 | P | P | P | P | P | P | P | P |
+---+---+---+---+---+---+---+---+
1 | R | N | B | Q | K | B | N | R |
+---+---+---+---+---+---+---+---+
a b c d e f g h
Shatranj:
<<lessAs such, execution speed becomes less important then code clarity and expressive power of the implementation language. Having been written in an interpreted language, this module allows the chess programmer to manipulate bitboards in a natural, interactive manner much like signal processing toolkits allow communication engineers to manipulate vectors of sounds samples in MATLAB.
The module currenly implements a simple recursive minimax search with alphabeta pruning, iterative deepening, uses short algebraic notation, handles repetition check, and the 50 move rule. Features lacking are quiescent checks, transition tables, negascout and MTD searching.
The chess programming toolkit is available in the form of a Python module called shatranj.py. You will also likely need the opening book as well as some of the pre-built hash tables that are used throughout the module (these will be recalculated if the module cannot find the data file).
Place all three file in the same directory and simply run python on the python module ("python shatranj.py"). As far as requirements, all that is needed is a recent version of the interpreted, high level language called Python (anything after version 2.3 should work fine). If you would like a little bit of a speed boost, shatranj looks for the module Psyco and will use it if it is installed.
Until more documentation becomes available, here is a short sample session:
[Sam-Tannous-Computer:~/shatranj] stannous% python
>>> from shatranj import *
...reading startup data
...total time to read data 0.0774528980255
...found opening book shatranj-book.bin with 37848 positions
>>> position = Position("r1bqk2r/pppp1ppp/2n5/5N2/2B1n3/8/PPP1QPPP/R1B1K2R")
>>> all_pieces = position.piece_bb["b_occupied"] | position.piece_bb["w_occupied"]
>>> other_pieces = position.piece_bb["b_occupied"]
>>> from_square = c4
>>> wtm = 1
>>> mask = position.pinned(from_square,wtm)
>>> ne_pieces = diag_mask_ne[from_square] & all_pieces
>>> nw_pieces = diag_mask_nw[from_square] & all_pieces
>>> moves = ((diag_attacks_ne[from_square][ne_pieces] & other_pieces) |
... (diag_attacks_ne[from_square][ne_pieces] & ~all_pieces) |
... (diag_attacks_nw[from_square][nw_pieces] & other_pieces) |
... (diag_attacks_nw[from_square][nw_pieces] & ~all_pieces)) & mask
>>>
>>> moves
1275777090846720L
>>>
>>> tobase(moves,2)
100100010000101000000000000010100000000000000000000
>>> display(moves)
+---+---+---+---+---+---+---+---+
8 | | . | | . | | . | | . |
+---+---+---+---+---+---+---+---+
7 | . | | . | | . | 1 | . | |
+---+---+---+---+---+---+---+---+
6 | 1 | . | | . | 1 | . | | . |
+---+---+---+---+---+---+---+---+
5 | . | 1 | . | 1 | . | | . | |
+---+---+---+---+---+---+---+---+
4 | | . | | . | | . | | . |
+---+---+---+---+---+---+---+---+
3 | . | 1 | . | 1 | . | | . | |
+---+---+---+---+---+---+---+---+
2 | | . | | . | | . | | . |
+---+---+---+---+---+---+---+---+
1 | . | | . | | . | | . | |
+---+---+---+---+---+---+---+---+
a b c d e f g h
>>> position.show_moves(1)
[Rg1, O-O, f3, a3, Rb1, f4, Ba6,
Bh6, Bd3, Qg4, Qe3, Ne7, Be6, Nxg7,
Qxe4, Ne3, b4, Nh4, b3, Be3, Bg5,
g3, Kf1, Rf1, Nh6, a4, Ng3, Qh5,
Kd1, h4, h3, c3, Bxf7, Nd6, Bb5,
Nd4, Qf3, g4, Qf1, Bb3, Qd1, Qd3,
Qd2, Bd5, Bd2, Bf4]
>>>
>>> # now play a game!
>>> play()
Shatranj version 1.10
g: switch sides m: show legal moves
n: new game l: list game record
d: display board b: show book moves
sd: change search depth (2-16) default=5
q: quit
Shatranj: d
+---+---+---+---+---+---+---+---+
8 | r | n | b | q | k | b | n | r |
+---+---+---+---+---+---+---+---+
7 | p | p | p | p | p | p | p | p |
+---+---+---+---+---+---+---+---+
6 | | . | | . | | . | | . |
+---+---+---+---+---+---+---+---+
5 | . | | . | | . | | . | |
+---+---+---+---+---+---+---+---+
4 | | . | | . | | . | | . |
+---+---+---+---+---+---+---+---+
3 | . | | . | | . | | . | |
+---+---+---+---+---+---+---+---+
2 | P | P | P | P | P | P | P | P |
+---+---+---+---+---+---+---+---+
1 | R | N | B | Q | K | B | N | R |
+---+---+---+---+---+---+---+---+
a b c d e f g h
Shatranj:
Download (0.16MB)
Added: 2007-04-30 License: GPL (GNU General Public License) Price:
554 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above position search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed