Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chess-cypher

This is a small toy program built with Java 21 for Stack Overflow's #2 Code Challenge, which invites participants to hide secret messages in board games. We chose the classic chess board to conceal ASCII messages up to 9 characters. Longer messages could be supported by using additional chess board.

The program works as follow:

  1. The user enters an ASCII message up to 9 characters long.
  2. The message is treated as a base-128 number and then converted to base 10.
  3. This value is then converted to base 12.
  4. Each base-12 digit is mapped to a chess piece (6 pieces of each color).
  5. The pieces are placed on the board using a randomized cipher key that determines their positions.

Example

User entered the message: "kasparov"

Here is the message cyphered as a chess board:
|  |  |  |bB|  |  |  |bP|
|bN|  |  |bK|  |  |wN|  |
|  |bN|bN|  |  |  |  |bP|
|  |  |  |  |  |  |  |  |
|bR|  |  |  |  |  |  |  |
|  |  |  |  |  |  |wP|bB|
|  |wP|  |  |  |  |  |bN|
|  |  |wB|wP|  |wN|  |  |

Cypher key: h2,d7,b6,b2,h8,h3,a4,g7,c1,d1,c6,h6,g3,d8,a7,f1,g5,a1,e1,f7,a6,g1,f6,b3,b1,h4,e7,f3,h1,c7,h7,e5,d6,e3,b8,d4,e6,a5,f8,c2,e8,g8,e2,h5,f4,f5,c3,b7,e4,c8,a3,c5,g4,b4,d5,d3,a8,f2,c4,d2,g2,a2,g6,b5

Opportunities for future improvements

  • Implement web interface for message visualization and sharing
  • Support larger messages with additional chess boards

About

Hides ASCII messages in a chess board

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages