Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7016825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:50:08+00:00 2026-05-27T22:50:08+00:00

Before we implement our own, is there an existing Open Source piece of Java

  • 0

Before we implement our own, is there an existing Open Source piece of Java code that takes a chess FEN string and converts it into an HTML representation of the chess board?

A FEN code looks like this: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

The output would be something like <table><tr><td>♘</td><td>♛</td><td>...

An icons-based solution, or even a solution that produces a big image instead of HTML, could be acceptable too. It is for integration into an Android app.

(Here is an implementation in Python)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:50:09+00:00Added an answer on May 27, 2026 at 10:50 pm

    I found some useful CSS3 from this place: http://designindevelopment.com/css/css3-chess-board/
    So I came up with the following:

    <html>
    <head>
        <style type="text/css">
            .chess_board { border:1px solid #333; }
            .chess_board td {
                background:#fff; background:-moz-linear-gradient(top, #fff, #eee);
                background:-webkit-gradient(linear,0 0, 0 100%, from(#fff), to(#eee));
                box-shadow:inset 0 0 0 1px #fff;
                -moz-box-shadow:inset 0 0 0 1px #fff;
                -webkit-box-shadow:inset 0 0 0 1px #fff;
                height:40px; text-align:center; vertical-align:middle; width:40px; font-size:30px;}
            .chess_board tr:nth-child(odd) td:nth-child(even),
            .chess_board tr:nth-child(even) td:nth-child(odd) {
                background:#ccc; background:-moz-linear-gradient(top, #ccc, #eee);
                background:-webkit-gradient(linear,0 0, 0 100%, from(#ccc), to(#eee));
                box-shadow:inset 0 0 10px rgba(0,0,0,.4);
                -moz-box-shadow:inset 0 0 10px rgba(0,0,0,.4);
                -webkit-box-shadow:inset 0 0 10px rgba(0,0,0,.4); }
        </style>
        <script type="text/javascript">
            function renderFen(fentxt) {
                fentxt = fentxt.replace(/ .*/g, '');
                fentxt = fentxt.replace(/r/g, 'x'); // Convert black rooks to 'x' to avoid mixup with <tr></tr> tags
                fentxt = fentxt.replace(/\//g, '</tr><tr>');
                fentxt = fentxt.replace(/1/g, '<td></td>');
                fentxt = fentxt.replace(/2/g, '<td></td><td></td>');
                fentxt = fentxt.replace(/3/g, '<td></td><td></td><td></td>');
                fentxt = fentxt.replace(/4/g, '<td></td><td></td><td></td><td></td>');
                fentxt = fentxt.replace(/5/g, '<td></td><td></td><td></td><td></td><td></td>');
                fentxt = fentxt.replace(/6/g, '<td></td><td></td><td></td><td></td><td></td><td></td>');
                fentxt = fentxt.replace(/7/g, '<td></td><td></td><td></td><td></td><td></td><td></td><td></td>');
                fentxt = fentxt.replace(/8/g, '<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>');
                fentxt = fentxt.replace(/K/g, '<td>&#9812;</td>');
                fentxt = fentxt.replace(/Q/g, '<td>&#9813;</td>');
                fentxt = fentxt.replace(/R/g, '<td>&#9814;</td>');
                fentxt = fentxt.replace(/B/g, '<td>&#9815;</td>');
                fentxt = fentxt.replace(/N/g, '<td>&#9816;</td>');
                fentxt = fentxt.replace(/P/g, '<td>&#9817;</td>');
                fentxt = fentxt.replace(/k/g, '<td>&#9818;</td>');
                fentxt = fentxt.replace(/q/g, '<td>&#9819;</td>');
                fentxt = fentxt.replace(/x/g, '<td>&#9820;</td>');
                fentxt = fentxt.replace(/b/g, '<td>&#9821;</td>');
                fentxt = fentxt.replace(/n/g, '<td>&#9822;</td>');
                fentxt = fentxt.replace(/p/g, '<td>&#9823;</td>');
                return '<table class="chess_board" cellspacing="0" cellpadding="0"><tr>' + fentxt + '</tr></table>';
            }
        </script>
    </head>
    <body>
        <script type="text/javascript">
            document.write(renderFen('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1'));
        </script>
    </body>
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are looking to implement in memory session replication. Before we do that our
I'm taking a compiler-design class where we have to implement our own compiler (using
I'm trying to implement a requirement in our system that all strings be trimmed
i been thinking of a new programming language. Before trying to implement it i
Before I start, I know there is this post and it doesn't answer my
Before I jump headlong into C#... I've always felt that C, or maybe C++,
i have to implement flash streaming for the relaunch of our video-on-demand system but
I am writing the service to implement the audit in our application wherein users
Intro We have a project to design and implement this semester. For our project,
We are considering migrating to Sql Server 2005 Reporting Services. Many of our existing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.