OK, here you go. Jmol as a 3D Sudoku visualizer.
As we say in Minnesota, "different".

http://www.stolaf.edu/people/hansonr/sudoku

Jmol is being used for the "3D view". The code is writing the applet using innerHTML the "new" way that Jmol.js can now do, adding a loadInline parameter to the tag so that both the data and the script can be actuated simultaneously. The applet is not there initially, only when requested. The display of different sections of the data is simply done by "selecting" specific "atoms" and displaying them or not. The simple function that adds the parameter to the Jmol.js-boilerplate HTML is:

function addParam(sappcode,sname,svalue){
return sappcode.replace(/\<param/,"<param name=\""+sname+"\" value=\""+svalue+"\" />\n<param")
}

where "sappcode" is the code returned from jmolApplet:

        jmolSetDocument(0)
        var s=jmolApplet(450,"set perspectivedepth OFF;"+script)
        s=addParam(s,"loadInline",smodel.replace(/\n/g,"|"))
        s=addParam(s,"messageCallback","clickModel")
        document.getElementById("apphere").innerHTML=s


Bob




Bob Hanson wrote:

This is going to sound totally off topic, but bear me out.

Has anyone gotten into Sudoku? http://en.wikipedia.org/wiki/Sudoku

I've just realized that Jmol is the perfect application for
demonstrating the fundamental set-based mathematics of Sudoku.

The idea is to solve the Sudoku VISUALLY -- no numbers -- using a 9x9x9
block of "atoms" and message callbacks.

I know, it sounds totally ridiculous.

Bob



--

Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107
Professor of Chemistry, St. Olaf College
1520 St. Olaf Ave., Northfield, MN 55057
mailto:[EMAIL PROTECTED]
http://www.stolaf.edu/people/hansonr

"Imagination is more important than knowledge."  - Albert Einstein


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to