A simple sudoku game written in V lang
The origin of the name is quite obvious "v" + "sudoku" = "vudoku". This is the project I created to try out v lang again after several months so if you have a thing for spaghetti, feel free to dig into my code 😄.
This is a standard v lang project so building should be quite straightforward.
- Install vlang
- Clone this repo
- Run
v build .
If you don't know sudoku, please read about it here.
When starting the game, you can specify the difficulty by passing an argument to the game. There are 4 levels of difficulty:
- Easy
- Medium
- Hard
- Expert
So let's say you just started out and want to try the expert
level. You would start the game with this command:
./vudoku expert
Note: By default, if you don't specify anything, the game will use easy level
If you wins the game or you just want to restart to a new game, press r
.
To fill a cell with your number, press the number key that you want. You can't use 0
because...there's no 0
in sudoku.
You can use the arrow keys to navigate in the game or if you are a vim user hjkl
ftw!
Otherwise, you can also use mouse to click on the cell you want to edit.
Oh no, you somehow messed up and want to clear the value of a cell that you have filled. No worries, just press c
to clear the current cell that you are on.
If you wife come at you and say "we need to talk" or there's an earthquake at your place and you want to pause the game, just hit p
to pause or resume the game and I hope that you survive the situation.
Key | Function |
---|---|
Arrow keys / h j k l / Mouse left click | Navigate between cells |
Number keys | Fill number into cell |
p | Pause / Resume game |
r | Restart / New game |
c | Clear the current cell |
Vudoku is a project by:
- Viet-Hung Nguyen (@ZeroX-DG)
All pull requests are welcome!
If you wish to support the author, you can buy him a coffee...though he would prefer tea instead, but coffee is fine.