Sponsored
$4.99 with 58 percent savings
Print List Price: $11.99 Image

These promotions will be applied to this item:

Some promotions may be combined; others are not eligible to be combined with other offers. For details, please see the Terms & Conditions associated with these promotions.

You've subscribed to ! We will preorder your items within 24 hours of when they become available. When new books are released, we'll charge your default payment method for the lowest price available during the pre-order period.
Update your device or payment method, cancel individual pre-orders or your subscription at
Your Memberships & Subscriptions

Buy as Gift

Buy as a gift or purchase for a team or group.
Learn more

How it works

  1. Choose your delivery method
  2. Send now or schedule for later
  3. Add your personal message
  4. Recipients can read on any device

These ebooks can only be redeemed by recipients in the US. Redemption links and eBooks cannot be resold.

Added to

Sorry, there was a problem.

There was an error retrieving your Wish Lists. Please try again.

Sorry, there was a problem.

List unavailable.
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

Sponsored
  • How to Write a JavaScript Chess Engine: How Chess Programs Work

Follow the author

Get new release updates & improved recommendations
Something went wrong. Please try your request again later.

How to Write a JavaScript Chess Engine: How Chess Programs Work

3.7 out of 5 stars (9)

There are a number of reasons why you may be interested in how a chess program is written:
  • You are learning programming and are interested in learning something different.
  • You are a programmer who is interested in developing your programming experience.
  • You are a chess enthusiast and would like to improve your chess by learning how chess programs work.
  • You are interested in developing a chess program and playing against it.
  • You are interested in developing a chess program and having it play other engines.

You do need to be an expert programmer to understand this book. The code is written as simply as possible. The code is designed to be simple even for intermediate and even novice programmers.

If you are not a programmer but are interested in chess, this book may be of interest.

The book includes annotations of the source code for a complete chess engine that the author has developed as a teaching tool. The complete source code is available at GitHub. The program can be edited with any text editor and run on a web page. You can alter the code and see if you can make it stronger.

The program is a derivative of my program referred to in my earlier book How to Write a BitBoard Chess Engine.

The engine is strong enough to beat most social players.

Features of the engine include:

  • It can play a human or itself.
  • It can load positions.
  • It is reasonably fast.
  • It displays the best line of play for both sides.
  • Detects checkmate.
  • Detects draws by repetition, 50 move rule, stalemate or reduction of material.

Evaluation

The engine evaluates elements of a position, including:
  • Material.
  • Piece position.
  • King safety.
  • Pawn structure.
  • Passed pawns etc

Search

The engine uses a standard alpha-beta minimax search including:
  • Cut offs.
  • Move ordering.
  • History moves,
  • Hash tables.
  • Extensions.
  • Reductions.
  • Capture search.

And much more…

Other books on computer chess include:

  • The Joy of Chess Programming
  • Think Like a ComputerOther books on computer chess programming include:
    • How to Write a Chess Program.
    • How to Write a Bitboard Chess Engine.
    • Advanced Chess Programming.
    • How to Write a Complex Chess Engine.
    • How to Write a Simple Chess Neural Network.

      The author is a FIDE chess master and national senior chess champion in addition to being a chess programming enthusiast. He was also an IT trainer for 10 years, teaching programming languages such as C++ to adults.

Sponsored

Product details

  • ASIN ‏ : ‎ B087BJ467C
  • Accessibility ‏ : ‎ Learn more
  • Publication date ‏ : ‎ April 19, 2020
  • Edition ‏ : ‎ 5th
  • Language ‏ : ‎ English
  • File size ‏ : ‎ 509 KB
  • Screen Reader ‏ : ‎ Supported
  • Enhanced typesetting ‏ : ‎ Enabled
  • X-Ray ‏ : ‎ Not Enabled
  • Word Wise ‏ : ‎ Not Enabled
  • Print length ‏ : ‎ 168 pages
  • Page Flip ‏ : ‎ Enabled
  • Best Sellers Rank: #3,167,468 in Kindle Store (See Top 100 in Kindle Store)
  • Customer Reviews:
    3.7 out of 5 stars (9)

About the author

Follow authors to get new release updates, plus improved recommendations.
FM Bill Jordan
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Bill Jordan was taught chess on his 7th birthday by his father using a chess set carved by his grandfather. Since the age of 17 Bill Jordan has represented Australia in international chess events in Malaysia, Yugoslavia, Mexico and China.

Bill became Victorian Junior chess champion seven years later. He later became Australian junior champion, Victorian champion, Australian correspondence champion, 2017 South Australian chess champion and 2019 Australian senior champion.

Bill has been president of the Melbourne chess club, one of the oldest chess clubs in the world. He is an enthusiastic chess software programmer who has taught and written manuals for chess as well as IT and lateral thinking.

Bill Jordan is experienced in individual and group coaching, and has an exceptional understanding of chess.

Customer reviews

3.7 out of 5 stars
9 global ratings
Sponsored

Top reviews from the United States

  • 2 out of 5 stars
    The program is not in a readable form, although the purpose is education, not speed.
    Reviewed in the United States on October 1, 2024
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Your claim that white space and long variable names slows the execution down is bogus. The javascript is immediately translated to internal form. Also, this engine’s main purpose is not speed, it is education. So, the code should be as readable as possible. The minification is not meant to be read and should NEVER be published in a book aimed for education.

    The indentation is horrible.

    I’m using the extinct language Coffeescript. It has a similar mandatory indentation as Python and is transpiled to Javascript. Very readable!

    Finally, why bother with web assembly if your main concern is education, not speed? The reader will not be able to debug. The debugger is a wonderful tool to see the internal values, not only finding errors. You took this possibility away.

    Please, fix these issues in the next edition, and I will buy the book once more.

    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 1 out of 5 stars
    Too much misinformation and bad programming practices
    Reviewed in the United States on March 23, 2023
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    The author uses an HTML table to represent the board, instead of a CSS approach. Tables should only be used *for tabular data*. Furthermore he writes that too much white space in Javascript slows things down. This is simply untrue., and he uses it as the rational for the horrendous programming practice, using non-descriptive variable names, such as individual letters, "a", "b", "c" etc.

    If the Javascript needs to be sent over the wire it can be minified, for instance using webpack and running the build command. The un-minified code however absolutely needs to be easy for the user to read and understand. The rest of the book is not to be trusted.

    One person found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.

Report an issue


Does this item contain inappropriate content?
Do you believe that this item violates a copyright?
Does this item contain quality or formatting issues?