Skip to content

Instantly share code, notes, and snippets.

@kpmiller
Created December 29, 2020 18:33
Show Gist options
  • Save kpmiller/5b6bc578be6930e1c4936041e2b4bd93 to your computer and use it in GitHub Desktop.
Save kpmiller/5b6bc578be6930e1c4936041e2b4bd93 to your computer and use it in GitHub Desktop.
A collection of bookmarklets for the ironsudoku.com site
//bookmaklet to fill in current puzzle with all pencil marks
// I don't know the source of this
javascript:javascript:var%20kMax=1;for(i=1;i<10;i++){var%20lMax=1;if(i==kMax)kMax+=3;for(j=1;j<10;j++){if(j==lMax)lMax+=3;if(grid[i][j].value==''){ClearTinySquares(i,j);for(k=1;k<10;k++)grid[i][j]['mini'][k]=1;for(k=1;k<10;k++){var%20tmp=grid[i][k].value;if(tmp!='')grid[i][j]['mini'][tmp]=0;tmp=grid[k][j].value;if(tmp!='')grid[i][j]['mini'][tmp]=0}for(k=kMax-3;k<kMax;k++){for(l=lMax-3;l<lMax;l++){var%20tmp=grid[k][l].value;if(tmp!='')grid[i][j]['mini'][tmp]=0}}}}}PopulatePuzzle(grid);
//bookmarklet to show alert with puzzle in good sudoku format
javascript:(function()%7Bms%20%3D%20master_string%20%2B%20'%2C'%3Bga%20%3D%20ms.split('%2C')%3Bgg%20%3D%20%22%22%3Bfor%20(j%3D0%3B%20j%3C41%3B%20j%2B%2B)%20%7Bi%20%3D%20j*2%3Bif%20(ga%5Bi%5D%20!%3D%20%22%22)%20%7Bs%20%3D%20parseInt(ga%5Bi%5D)%3B%7Delse%20%7Bs%20%3D%200%3B%7Dif%20(ga%5Bi%2B1%5D%20!%3D%20%22%22)%20%7Bt%20%3D%20parseInt(ga%5Bi%2B1%5D)%7Delse%20%7Bt%20%3D%200%3B%7Dk%20%3D%20(s%20%3C%3C%204)%20%7C%20t%3Bgg%20%3D%20gg%20%2B%20String.fromCharCode(k)%3B%7Dccmd%20%3D%20'Check%20out%20this%20puzzle%20in%20GoodSudoku!%20%20playgoodsudoku.com%2Fpuzzle%2F%24'%2Bbtoa(gg)%3Balert(ccmd)%7D)()
//bookmarklet to show alert with puzzle in .ss format
javascript:(function()%7Bga%3Dmaster_string.split('%2C')%3B%0Agg%3D%22%22%3B%0Afor%20(j%3D0%3Bj%3C81%3Bj%2B%2B)%7B%0Aif%20(ga%5Bj%5D%3D%3D%22%22)gg%3Dgg%2B%22.%22%3B%0Aelse%20gg%3Dgg%2Bga%5Bj%5D%3B%0Aif%20(j%3D%3D0)%20continue%3B%0Aelse%20if%20(j%3D%3D80)%20break%3B%0Aelse%20if%20(j%2527%3D%3D26)%20gg%3Dgg%2B%22%5Cn---%2B---%2B---%5Cn%22%3B%0Aelse%20if%20(j%259%3D%3D8)%20gg%3Dgg%2B%22%5Cn%22%3B%0Aelse%20if%20(j%253%3D%3D2)%20gg%3Dgg%20%2B%20%22%7C%22%3B%0A%7D%0Aalert(gg)%3B%7D)()%3B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment