

} // end of 3 x 3 box // we have selected one number

Sudoku = 0 // vertical row int brow = (position/27)* 243 // row block 0f 3Ĭolumn = ( byte) (((position%9)/3)* 27) // Column block of 3 byte incount Sudoku = 0 // horizontal row byte column = ( byte) (position%9) Sudoku = 0 // Can't select any in box byte row = ( byte) (position/9) Sudoku = sudoku // copy existing to next step for(count = 0 count < 9 count++) Step += 1 // we can select so write this step to the sudoku array int count = 0 Return step // end of number not possible or is selected Public static byte select( byte sudoku, byte number, byte position, byte step) The operational code needed to run the game is in: The code can be written and hacked with a text editor using javac to compile and java to run the application. I do use Eclipse but I decided to use Java Foundation Classes (JFC) and Swing. Let's hope it will be “Write Once, Run Anywhere”, not “Write Once, Debug Everywhere”. I have been learning Java so I decided to rewrite my Sudoku program and make it truly platform independent. This could be software written in an interpreted language This does require individual compilation for each platform that it supports.Īnother approach is to use code that can be directly run on any platform without special preparation.

My approach received much criticism as the “same code” could not be compiled directly into a platform application. I documented this in a previous article: cross_platform.aspx. To allow the code to execute successfully on Windows and Linux, I decided to use the portability of the C++ language. I wrote the original code for my Sudoku program using Visual Basic on Microsoft's Visual Studio IDE.
