From 60c9d29c10cf4e67cd5b5447973ba78048ed3fc2 Mon Sep 17 00:00:00 2001 From: Vitor Fernandes Date: Sat, 26 Mar 2016 11:18:57 +0000 Subject: [PATCH] Added final touches --- css.css | 16 +++++++++++----- sudoku.js | 17 ++++++++--------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/css.css b/css.css index 0b91fba..603ea29 100644 --- a/css.css +++ b/css.css @@ -35,6 +35,8 @@ table.par{ color: black; vertical-align: middle; text-align: center; + margin-left: -5px; + margin-top: -7px; } table{ @@ -47,11 +49,15 @@ table.impar{ color:black; vertical-align: middle; text-align: center; + margin-left: -5px; + margin-top: -5px; } -td{ - min-width: 15px; - height: 15px; - border: dashed; +td.block{ + min-width: 30px; + font-size: 2em; + font-weight: bolder; + height: 30px; + border: solid; border-width: thin; -} \ No newline at end of file +} diff --git a/sudoku.js b/sudoku.js index 807eabe..07df3b0 100644 --- a/sudoku.js +++ b/sudoku.js @@ -69,7 +69,7 @@ Sudoku.prototype.checkLine=function(pos,val){ Sudoku.prototype.checkBlock=function(pos,val){ var p=Sudoku.getPosXY(pos); var pi,pj;//variaveis que identificam o bloco - if(p.x<3)pi=0;else if(p.x>=3 && p.x<6)pi=1;else pi=2; + if(p.x<3)pi=0;else if(p.x>=3 && p.x<6)pi=1;else pi=2; if(p.y<3)pj=0;else if(p.y>=3 && p.y<6)pj=1;else pj=2; var ci=0; var pii=pi*3; @@ -90,7 +90,7 @@ Sudoku.prototype.checkBlock=function(pos,val){ /** * Método que reinicia o vector com os valores do sudoku - * @return + * @return */ Sudoku.prototype.clear=function(){ var dx=Sudoku.DIMX; @@ -104,7 +104,7 @@ Sudoku.prototype.clear=function(){ * Método que efectua uma limpeza nos n valores anteriores à posição pos * @param pos Posição para a qual se pretende iniciar o reset de valores * @param n Número de celulas que irão ser limpas - * @return + * @return */ Sudoku.prototype.clearLastValues=function(pos,n){ var min=Math.max(0,n); @@ -161,12 +161,12 @@ Sudoku.prototype.buildSudoku=function(){ /** * Método que devolve os blocos do sudoku sob a forma de HTML * @param x Ponto x do bloco - * @param y Ponto y do bloco + * @param y Ponto y do bloco * @return String com o código em HTML do bloco */ Sudoku.prototype.getHTMLBlock=function(x,y){ var pi,pj;//variaveis que identificam o bloco - if(x<3)pi=0;else if(x>=3 && x<6)pi=1;else pi=2; + if(x<3)pi=0;else if(x>=3 && x<6)pi=1;else pi=2; if(y<3)pj=0;else if(y>=3 && y<6)pj=1;else pj=2; var ci=0; var pii=pi*3; @@ -179,7 +179,7 @@ Sudoku.prototype.getHTMLBlock=function(x,y){ li+=9; str+="\n\t\n\t"; } - str+="\n\t\t"+this._mat[li+ci+pii]+""; + str+="\n\t\t"+this._mat[li+ci+pii]+""; ci++; } str+="\n\t\n"; @@ -188,7 +188,7 @@ Sudoku.prototype.getHTMLBlock=function(x,y){ /** * Método que devolve uma instância do sudoku em função do seu nível de dificuldade - * @param level + * @param level * @return */ Sudoku.prototype.getSudoku=function(level){ @@ -203,7 +203,7 @@ Sudoku.prototype.getSudoku=function(level){ mclone[i]=this._mat[i]; } else{ - mclone[i]="_"; + mclone[i]=" "; } } ninst._mat=mclone; @@ -255,4 +255,3 @@ Sudoku.prototype.toString=function(){ } return st; }; -