8 N Queen problem SuperPosition results inprogress

Multiplex

by Nikola Lukic

HTML

<script src="https://maximumroulette.com/visual-js/manifest/manifest_jsfiddle.js"></script>
<script src="https://maximumroulette.com/visual-js/lib/build.js"></script>
<body style="margin:0;padding:0;border:none;background-color:black;">

  <div id="RTC_HELP" style="display:none;height: 400px;overflow: auto;overflow-x: hidden;    padding-left: 50px;"></div>

  <div id="UPLOAD_BOX" style="display:block">
  </div>
  <div id="experiment" style="display:block">
    <video id="webcam" autoplay width="640" height="480" style="display:none;position:absolute;left:0;top:0;"></video>
    <canvas id="canvas-blended" width="640" height="480" style="position:absolute;left:0;top:0;display:none;"></canvas>
    <canvas id="canvas-render" width="640" height="480" style="position:absolute;left:0;top:0;display:none;"></canvas>
  </div>
  <canvas tabindex='1' width="1" height="1" id="HELLO_WORLD"></canvas>
  <div style="display:block;">
    <!--audio controls id="audio_ambient"  >
<source src="http://radio.nessradio.net:8000/nessradio.mp3" type="audio/mpeg">
<source src="http://radio.nessradio.net:8000/nessradio.ogg" type="audio/ogg">
</audio-->
  </div>


</body>

<script>
  ///////////////////////////////////////////
  // Only JS canvas work for 2d graphic 
  ///////////////////////////////////////////
  SYS.DOM.CREATE_SURFACE("SURF", "HELLO_WORLD", 100, 99.4, "DIAMETRIC");
  HELLO_WORLD.ENGINE.CREATE_MODUL("STARTER");
  var STARTER = HELLO_WORLD.ENGINE.MODULES.ACCESS_MODULE("STARTER");
  RESOURCE.Tiles = {
    source: ["https://maximumroulette.com/framework/res/animations/Tiles/boxCrate.png"]
  };

  STARTER.NEW_OBJECT("MESSAGER", -40, 92, 95, 5, 1);
  MESSAGER.CREATE_TEXTBOX("Welcome to Project P vs NP Problem for 1 million javascript ", 10, "black", "#987123");
  MESSAGER.TEXTBOX.EDIT = false;

</script>

CSS

/*
 Code author : Nikola Lukic - zlatnaspirala@gmail.com
 
 Project name : P vs NP Problem for 1 million javascript
 project start at 6/sep/2017 
 
  hipoteza : 
  
  A short hypothesis: if the chaos is unforeseeable, only chaos would exist. I will use instantiation of class cell then random generation will be more varied in the parallel attempts experiment. I will collect result data from whole brainCell set by super position method..
  

  cell + cell + n = brain
  
  I use 3x3 in first attempt.




 Next features : 
 
  - Check duplicate solutions  !DONE
  -Eliminate (break) checking action when situation is clear (for low number queens on table and low free fields array element (single absolute number)) DONE
  
   -collect result data from whole brainCell set 
   
   - First problem : from 16 to 18 solution than program stops with uniq results incremental 
       - make results preview class  to see what is it ... is it 12 uniq res here
  
  - Calculate from fundimental res : reflection and rotation results 
   
  
  
  
 Links :
 http://www.claymath.org/millennium-problems/p-vs-np-problem

Important : Sometimes example may not work. underconstruction ....
 
 
 ----------------------------
 ABOUT RESULTS OBJECTS : 
 ----------------------------
  save to the localStorage and analyze ti later - js Command in visual-js GE is 
  SAVE( stringKEY , object ) also  LOAD (stringKey)
  for CELL root :  RESULTS.DATABASE.ROUND_DATA
 
  js code : 
   GLOBAL.GENERAL_RESULTS.REZULTS = LOAD ("STORAGE_BRAIN_RESULTS")
 
 
 
 
 
 
 Solutions : 
 Source : https://oeis.org/A002562 
 
 [1, 0, 0, 1, 2, 1, 6, 12 , 46, 92, 341, 1787, 9233, 45752, 285053, 1846955, 11977939, 83263591, 621012754, 4878666808, 39333324973, 336376244042, 3029242658210, 28439272956934, 275986683743434, 2789712466510289, 29363495934315694]
 
 

*/

JavaScript

//////////////////////////////////////////
// CLASS : BRAIN_CELL 
//////////////////////////////////////////


window.BRAIN_CELLL = function (_name_) {

 var CELL = this;
 CELL.name = _name_;
 
 CELL.GRAPHIC_CONFIG = {

   fieldMargin : 8,
   fieldWidth : 8,
   Suma_of_fields : null,
   all_fields : [],
   interval : 1 ,
   
 };

CELL.GRAPHIC_CONFIG.Suma_of_fields = Math.pow(CELL.GRAPHIC_CONFIG.fieldMargin, 2)  

 CELL.RESULTS = {
   
   Suma_of_Queens : 0 ,
   Suma_of_BlockedFields : 0 ,
   jobs_is_done : false ,

   DONE : function(){},
   DATABASE : { ROUND_DATA : {  BAD_ATTEMPT : [] , ATTEMPT : [] , SUCCESS : []  , memostack : [] } },
   USED_FIELDS : [],
   FREE_FIELDS : [],
   MAIN_WATCH : new Object(),
   Successed : 0 ,

};

CELL.HANDLER_ARRAY = [];

/////////////////////////////////////////
// UI - PREVIEW TABLE ELEMENT FOR FIELDS
/////////////////////////////////////////

CELL.ANY_NAME_HERE_NEW_STAGE = function ( H , V , step , w  , h , _index ) {

for (var y=0;y<V;y = y + step){
for (var x=0;x<H;x = x + step){
var name1 = "",name2 = "";
if ( x == 0) {
    name1 = "A"; name2 = CELL.GRAPHIC_CONFIG.fieldMargin - y /step
}
else if (x == CELL.GRAPHIC_CONFIG.fieldMargin) {
   name1 = "B"; name2 =  CELL.GRAPHIC_CONFIG.fieldMargin - y /step
}
else if (x == CELL.GRAPHIC_CONFIG.fieldMargin*2) {
   name1 = "C"; name2 =  CELL.GRAPHIC_CONFIG.fieldMargin - y /step
}
else if (x == CELL.GRAPHIC_CONFIG.fieldMargin*3) {
   name1 = "D"; name2 =  CELL.GRAPHIC_CONFIG.fieldMargin - y /step
}
else if (x == CELL.GRAPHIC_CONFIG.fieldMargin*4) {
   name1 = "E"; name2 = CELL.GRAPHIC_CONFIG.fieldMargin - y /step
}
else if (x == CELL.GRAPHIC_CONFIG.fieldMargin*5) {
   name1 = "F" ;name2 =  CELL.GRAPHIC_CONFIG.fieldMargin - y /step
}
else if (x == CELL.GRAPHIC_CONFIG.fieldMargin*6) {
   name1 = "G"; name2 =  CELL.GRAPHIC_CONFIG.fieldMargin - y /step
}
else if (x == CELL.GRAPHIC_CONFIG.fieldMargin*7) {
   name1 = "H"; name2 =  CELL.GRAPHIC_CONFIG.fieldMargin - y /step
}
else if (x...