based by https://github.com/romario333/opensudoku.git , add some function.