$𝖕𝖗𝖑𝖕/𝖕𝖚𝖗𝖊-𝖑𝖔𝖔𝖕-𝖗𝖚𝖑𝖊𝖘.𝖘𝖆𝖕𝖕𝖍𝖎𝖗𝖊 
    0------------------------| Sapphire Rules for Pure Loop Pencil Puzzles |-------------------------
    1--|Ann×mgridofcells,someopen,someblocked;noroworcolumnisentirelyblocked        
    2--|Thesolutionisasingle,non-intersectingconterclockwiseloopthroughallopensquares   
    3                                                                                               
    4--|sol-solutiongivingthedirectionoflooptravel:0123indicate→,respectfully 
    5--|∙∙∙∙-if4,cellisclosed                                                                 
    6                                                                                               
    7Idx={0n1}×{0m1}--|0basedindexingbypairs                                              
    8                                                                                               
    9x0{0n2}idx00=0                                                                       
   10                                                                                               
   11∀⟨xyIdx                                                                                     
   12idxy{0n·m}                                                                             
   13idxy=0⇐⇒x=x0y=0                                                                     
   14solxy{04}                                                                              
   15solxy=4⇐⇒idxy=n·m                                                                  
   16x=0∙∙∙solxy{134}                                                                    
   17x=n1solxy{024}                                                                    
   18y=0∙∙∙solxy{034}                                                                    
   19y=m1solxy∈{124}                                                                    
   20solxy=0y<m1solxy+1{023}                                                    
   21solxy=1y>0∙∙∙solxy1{123}                                                    
   22solxy=2x>0∙∙∙solx1y{012}                                                    
   23solxy=3x<n1solx+1y{013}                                                    
   24⦗solxy⦘¬=4y>0∙∙∙⦗solxy⨫1⦘=0⦗idxy⦘=⦗idxy⨫1⦘+1                               
   25∙∙∙∙y<m1solxy+1=1idxy=idxy+1+1                               
   26∙∙∙∙x>0∙∙∙⦗solx1y=3⦗idxy=idx1y+1                               
   27∙∙∙∙x<n1⦗solx+1y=2⦗idxy=idx+1y+1                               
   28∙∙∙∙x=x0y=0solxy=3solxy+1=1idxy=0                         
   29                                                                                               
   30--|Gettingstuckonalternativetoabove,withoutthe"x=x0..."line                       
   31--|butwiththe"y<m⨫1..."linebeing                                                      
   32--|∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙y<m⨫1⦗solxy+1⦘=1(⦗idxy⦘=⦗idxy+1⦘+1⦗idxy⦘=0)             
   33--|Notsurewherethebuginthealternativeis:hereorinAg                                
   34                                                                                               
   35x{0n1}solx0¬=4(x=0x'{0x1}solx'0=4)⇐⇒idx0=0                       
   36                                                                                               
   37--|addin?tohelpsolver(manyxspeedup);wanttoautomatethisinfuture                   
   38∀⟨xy{0n}×{0m}                                                                             
   39in?xy{01}                                                                              
   40x=0y=0x=ny=min?xy=0                                                          
   41x>0y>0y<m(in?xy=in?x1y⇐⇒solx1y1¬=0solx1y¬=1)                 
   42x>0x<ny>0(in?xy=in?xy1⇐⇒solx1y1¬=3solxy1¬=2)