OK, here you go. Jmol as a 3D Sudoku visualizer.
As we say in Minnesota, "different".
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.
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
--
Professor of Chemistry, St. Olaf College
1520 St. Olaf Ave., Northfield, MN 55057
"Imagination is more important than knowledge." - Albert Einstein
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
_______________________________________________
Jmol-users mailing list