user5784: Does anyone know a chess engine that is not programmed to be as strong as
 possible, but to play "attractive" chess ?
The program should have an aggressive style and play for mate attacks, even
 if the attacking moves are not quite optimal. Or at least, the program
 should trade some panws early to avoid very closed positions which tend
 to take an eternity between engines to be finished.
On the other hand, the program should not play too weak. The rating should
 at least be about 2000 Elo.
Does anyone know such an engine ?

user8309: If you increase Rybka 3 Dynamic's contempt setting, it sacrifices more and more material in attractive style.
The Fritz GUI (sold with Rybka, Komodo, Houdini, Junior, Shredder et al) includes a King's Attack slider in its Handicap and Fun dialog.  The Fritz 10 engine in particular avoided closed positions like the plague, and often played for mate.  It had an 'aggressive' parameter.
Chess Tiger and Gambit Tiger (Chessbase or Lokasoft) had a "Suicidal" option under their Gambit Level parameter.
Junior 7 had a 'sacrifices' parameter.
Deep Sjeng 1.6 comes with gambitkitten, redshift and Tal personalities.
Someone created a Dissident Aggressor personality for Zappa Mexico which is apparently quite wild.
TheKing (a.k.a. Chessmaster) plays for mate even on its default settings.
Amyan has a kinghunting parameter.
Tao 5.6 tends to go for very complex positions with multiple pieces en prise.
The old DOS program Chess System Tal had an attractive style with lots of sacs.
Spark 1.0 and Fruit 2.3.1 had a King Attack parameter.
The Kinghunter personality for Komodo only worked for version 1.0, and they changed the parameters after that.
I think in general the programmers tried to make these engines both strong and aggressive.  All of these (with the exception of Chess System Tal) are at the level of an International Master or higher.  Engines below that designed to have a somewhat attractive style would include: Der Bringer, HeavyChess, Homer, Monarch and Trappy Beowulf.
Another thing you could try is loading some of Chessbase's weaker engines, and increasing the King's Attack slider in Handicap and Fun.  Inmichess, Exchess, Comet and Capture R01 were all in the 2000-2400 range, and were sold by Chessbase in their Young Talents package.

user3831: Many engines have adjustable parameters, which allow to alter their playing style. If you mess around it a bit, you can create whole 'engine personalities'... 
Here, for example, someone though it interesting to create a personality called, the Komodo Kinghunter. Apparently, it does exactly what you are looking for - plays aggressively and not necessarily optimally. Note that I have not tested it myself.
It's different for different engines (I remember most of these at least used to be configurable in stockfish) and graphical interfaces, but 
some typical factors one can usually twiddle with (at worst by going to source code and recompiling) are:
Contempt Factor

The Contempt Factor reflects the estimated superiority/inferiority of the program over its opponent. The Contempt factor is assigned as draw score to avoid (early) draws against apparently weaker opponents, or to prefer draws versus stronger opponents otherwise.

Additionally, if the engine has high contempt for its opponent, it might engage in more attacking style.
Pawn structure

Pawn structure is a term used to describe the positions of all the pawns on the board, ignoring all other pieces. Pawn structure encompasses a broad range of ideas, from the general shape of the pawns (such as closed or open) to specific characteristics of individual pawns.

So here there's a wide range of things to change engines evaluations for - double pawns, passed pawns, general structure, exchanges etc.
Mobility
A factor for how much the engine will value the piece mobility - I suppose more mobility leads to more attacking and unpredictable positions.
Aggressiveness
Self-explanatory; allows to make the engine more or less aggressive.
Cowardice
Self-explanatory; allows to define how defensive towards its own king the program should be.
Source for quotes
EDIT: I was made aware (per Student T's comment), that the engine I initially posted below is not attractive at all and in fact a clone of Rybka. I guess it was too good to be true!
If you are reluctant to do all this fiddling yourself, here's an engine which (again, I have not tried it myself, so cannot substantiate these claims in any way):

Thanks to its finely tuned positional vision, Vitruvius shows a readiness to sacrifice a pawn or two, the exchange and sometimes even a whole piece, for purely positional compensation.

And named among its strengths:

Playing strength above the 3100ELOmark; Detects and exploits zugzwang positions; Very human and speculative approach to the game

Also of interest: this Vitruvius article
Unfortunately, it is not free.

5784: <p>Does anyone know a chess engine that is not programmed to be as strong as
 possible, but to play "attractive" chess ?</p>

<p>The program should have an aggressive style and play for mate attacks, even
 if the attacking moves are not quite optimal. Or at least, the program
 should trade some panws early to avoid very closed positions which tend
 to take an eternity between engines to be finished.</p>

<p>On the other hand, the program should not play too weak. The rating should
 at least be about 2000 Elo.</p>

<p>Does anyone know such an engine ?</p>
 8309: <p>If you increase Rybka 3 Dynamic's contempt setting, it sacrifices more and more material in attractive style.</p>

<p>The Fritz GUI (sold with Rybka, Komodo, Houdini, Junior, Shredder et al) includes a King's Attack slider in its Handicap and Fun dialog.  The Fritz 10 engine in particular avoided closed positions like the plague, and often played for mate.  It had an 'aggressive' parameter.</p>

<p>Chess Tiger and Gambit Tiger (Chessbase or Lokasoft) had a "Suicidal" option under their Gambit Level parameter.</p>

<p>Junior 7 had a 'sacrifices' parameter.</p>

<p>Deep Sjeng 1.6 comes with gambitkitten, redshift and Tal personalities.</p>

<p>Someone created a Dissident Aggressor personality for Zappa Mexico which is apparently quite wild.</p>

<p>TheKing (a.k.a. Chessmaster) plays for mate even on its default settings.</p>

<p>Amyan has a kinghunting parameter.</p>

<p>Tao 5.6 tends to go for very complex positions with multiple pieces en prise.</p>

<p>The old DOS program Chess System Tal had an attractive style with lots of sacs.</p>

<p>Spark 1.0 and Fruit 2.3.1 had a King Attack parameter.</p>

<p>The Kinghunter personality for Komodo only worked for version 1.0, and they changed the parameters after that.</p>

<p>I think in general the programmers tried to make these engines both strong and aggressive.  All of these (with the exception of Chess System Tal) are at the level of an International Master or higher.  Engines below that designed to have a somewhat attractive style would include: Der Bringer, HeavyChess, Homer, Monarch and Trappy Beowulf.</p>

<p>Another thing you could try is loading some of Chessbase's weaker engines, and increasing the King's Attack slider in Handicap and Fun.  Inmichess, Exchess, Comet and Capture R01 were all in the 2000-2400 range, and were sold by Chessbase in their Young Talents package.</p>
 3831: <p>Many engines have adjustable parameters, which allow to alter their playing style. If you mess around it a bit, you can create whole 'engine personalities'... 
Here, for example, someone though it interesting to create a personality called, the <a href="http://rybkaforum.net/cgi-bin/rybkaforum/topic_show.pl?tid=18970" rel="nofollow noreferrer">Komodo Kinghunter</a>. Apparently, it does exactly what you are looking for - plays aggressively and not necessarily optimally. Note that I have not tested it myself.</p>

<p>It's different for different engines (I remember most of these at least used to be configurable in stockfish) and graphical interfaces, but 
some typical factors one can usually twiddle with (at worst by going to source code and recompiling) are:</p>

<p><strong>Contempt Factor</strong></p>

<blockquote>
  <p>The Contempt Factor reflects the estimated superiority/inferiority of the program over its opponent. The Contempt factor is assigned as draw score to avoid (early) draws against apparently weaker opponents, or to prefer draws versus stronger opponents otherwise.</p>
</blockquote>

<p>Additionally, if the engine has high contempt for its opponent, it might engage in more attacking style.</p>

<p><strong>Pawn structure</strong></p>

<blockquote>
  <p>Pawn structure is a term used to describe the positions of all the pawns on the board, ignoring all other pieces. Pawn structure encompasses a broad range of ideas, from the general shape of the pawns (such as closed or open) to specific characteristics of individual pawns.</p>
</blockquote>

<p>So here there's a wide range of things to change engines evaluations for - double pawns, passed pawns, general structure, exchanges etc.</p>

<p><strong>Mobility</strong>
A factor for how much the engine will value the piece mobility - I suppose more mobility leads to more attacking and unpredictable positions.</p>

<p><strong>Aggressiveness</strong>
Self-explanatory; allows to make the engine more or less aggressive.</p>

<p><strong>Cowardice</strong>
Self-explanatory; allows to define how defensive towards its own king the program should be.</p>

<p><a href="https://chessprogramming.wikispaces.com/" rel="nofollow noreferrer">Source for quotes</a></p>

<p><strong>EDIT: I was made aware (per Student T's comment), that the engine I initially posted below is not attractive at all and in fact a clone of Rybka. I guess it was too good to be true!</strong></p>

<p>If you are reluctant to do all this fiddling yourself, <a href="http://www.vitruviuschess.com/index.php" rel="nofollow noreferrer">here's</a> an engine which (again, I have not tried it myself, so cannot substantiate these claims in any way):</p>

<blockquote>
  <p>Thanks to its finely tuned positional vision, Vitruvius shows a readiness to sacrifice a pawn or two, the exchange and sometimes even a whole piece, for purely positional compensation.</p>
</blockquote>

<p>And named among its strengths:</p>

<blockquote>
  <p>Playing strength above the 3100ELOmark; Detects and exploits zugzwang positions; Very human and speculative approach to the game</p>
</blockquote>

<p>Also of interest: <a href="http://www.vitruviuschess.com/article/Human-Test.html" rel="nofollow noreferrer">this Vitruvius article</a></p>

<p>Unfortunately, it is not free.</p>
