Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0 - Classic Sodoku Client #19

Draft
wants to merge 110 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
31d31c2
add Classic 9x9 Sodoku
AlbinoGeek Jan 13, 2021
0453652
add Undo / naive board history
AlbinoGeek Jan 13, 2021
6a94ac4
todo corner numbers
AlbinoGeek Jan 13, 2021
f208d19
mention other 9x9 grid types
AlbinoGeek Jan 13, 2021
5a68216
Merge branch 'feature-classic-sodoku' into develop
AlbinoGeek Jan 13, 2021
86e9807
bump version
AlbinoGeek Jan 13, 2021
869c0b0
fix: markdownlint: Lists ...
AlbinoGeek Jan 13, 2021
6eae6f6
move go sources to cmd/
AlbinoGeek Jan 13, 2021
40e82c9
Merge branch 'move-sources-to-cmd' into develop
AlbinoGeek Jan 13, 2021
fe3d1de
redo history (store all cell data)
AlbinoGeek Jan 13, 2021
6fc4191
add: cell mistake status / highlight
AlbinoGeek Jan 14, 2021
cfafc7a
add: mistakes: duplicates in subgroup
AlbinoGeek Jan 14, 2021
d8b0d41
add: tests for board.Load
AlbinoGeek Jan 14, 2021
99aec70
fix: go vet: unexported struct field json tag
AlbinoGeek Jan 14, 2021
823805f
fix: style: redundant error checking
AlbinoGeek Jan 14, 2021
73ddfec
go update deps
AlbinoGeek Jan 14, 2021
9fec7f2
fix: CI goimports step
AlbinoGeek Jan 14, 2021
eb4520d
add: test for board.Undo
AlbinoGeek Jan 14, 2021
37b85f7
add: benchmark for board.checkSubgridRepeat
AlbinoGeek Jan 14, 2021
085180a
add: mistakes: duplicates in column
AlbinoGeek Jan 14, 2021
6997839
add: test for board.checkColRepeat
AlbinoGeek Jan 14, 2021
4caa611
fix: test for Board.Undo
AlbinoGeek Jan 14, 2021
28fad9d
add: benchmark for board.check
AlbinoGeek Jan 14, 2021
d8d1edf
add: benchmark for board.load
AlbinoGeek Jan 14, 2021
e1c9fc6
fix: reduce allocations by 2/3rds in board.init
AlbinoGeek Jan 14, 2021
6e05ee5
add: bool to toggle highlighting mistakes
AlbinoGeek Jan 14, 2021
0e92537
add: mistakes in README.md
AlbinoGeek Jan 14, 2021
146b337
fix: comments
AlbinoGeek Jan 14, 2021
7baf003
fix: bug where X didn't reset other mistakes
AlbinoGeek Jan 14, 2021
eaed934
move to callback based checkers
AlbinoGeek Jan 15, 2021
617f26a
add: mistakes: duplicates in row
AlbinoGeek Jan 15, 2021
3632ef6
add: test for board.checkRowRepeat
AlbinoGeek Jan 15, 2021
7a3dcf1
add: benchmark for board.checkRowRepeat
AlbinoGeek Jan 15, 2021
edbaa47
add: check button to UI
AlbinoGeek Jan 15, 2021
83e30ea
improve error messages from check
AlbinoGeek Jan 15, 2021
6cd385d
upgrade fyne to 661d93b985d1
AlbinoGeek Jan 15, 2021
c208d77
add: mistakes to CHANGELOG.md
AlbinoGeek Jan 15, 2021
98ae4fe
Merge branch 'feature-mistakes' into develop
AlbinoGeek Jan 15, 2021
73132f6
re-enable coverage
AlbinoGeek Jan 15, 2021
9cfa305
add: coverage to README.md
AlbinoGeek Jan 15, 2021
1f2dace
add: keyboard 1-9, del, backspace controls
AlbinoGeek Jan 15, 2021
f96389c
refactor: calls to SetMistake()
AlbinoGeek Jan 16, 2021
f024a7b
fix: c.selected checked twice
AlbinoGeek Jan 16, 2021
3240567
Merge branch 'refactor-board-select' into develop
AlbinoGeek Jan 16, 2021
20b8650
add: keyboard to CHANGELOG.md
AlbinoGeek Jan 16, 2021
37099cf
add: keyboard to README.md
AlbinoGeek Jan 16, 2021
8a2cc66
fix: benchmarks should report allocations
AlbinoGeek Jan 17, 2021
dc60972
fix: check tests should set callback
AlbinoGeek Jan 17, 2021
181f2f8
refactor: checkRowRepeat
AlbinoGeek Jan 17, 2021
31d5336
refactor: checkColRepeat
AlbinoGeek Jan 18, 2021
717992e
order tests to fail fast
AlbinoGeek Jan 18, 2021
f81d3d4
add: new test: CheckSubgridsExhaustive
AlbinoGeek Jan 18, 2021
ca10f60
fix: consistent use of term "box" (not subgrid)
AlbinoGeek Jan 18, 2021
daf3249
upgrade fyne to 7abf69095e4a
AlbinoGeek Jan 18, 2021
4fe149d
remove comment debug code
AlbinoGeek Jan 18, 2021
589e793
Merge branch 'develop' into refactor-loops
AlbinoGeek Jan 18, 2021
8503670
refactor: checkBoxRepeat
AlbinoGeek Jan 18, 2021
2cc629d
fix: board should be created outside of uiInit
AlbinoGeek Jan 18, 2021
2b89889
add: ui image tests (cell states)
AlbinoGeek Jan 18, 2021
b60ac05
Merge branch 'refactor-loops' into develop
AlbinoGeek Jan 18, 2021
1f45677
add: screenshot to README.md
AlbinoGeek Jan 18, 2021
409cfcb
fix: sodoku
AlbinoGeek Jan 18, 2021
ec78906
add: image test for empty UI
AlbinoGeek Jan 19, 2021
973da38
add: test UICellSelect
AlbinoGeek Jan 19, 2021
9c096c4
upgrade fyne to v2.0.0-rc5
AlbinoGeek Jan 19, 2021
40234dd
bump version
AlbinoGeek Jan 19, 2021
8cc4cb1
fix: testdata image not moved to Master
AlbinoGeek Jan 19, 2021
74e9ab4
cover some of main()
AlbinoGeek Jan 19, 2021
9c7ed48
add: test for increasing board size
AlbinoGeek Jan 19, 2021
93fc07a
fix: bug: board.cellsPer* not updated on load
AlbinoGeek Jan 19, 2021
c3fc631
Merge pull request #18 from AlbinoGeek/add-coverage-1
AlbinoGeek Jan 19, 2021
cb37ca3
add: board reset (via undo to initial state)
AlbinoGeek Jan 19, 2021
b76b8c1
add: reset button to CHANGELOG.md
AlbinoGeek Jan 19, 2021
9915dfe
fix: test should be using board.Reset()
AlbinoGeek Jan 19, 2021
fe03f24
Merge pull request #20 from AlbinoGeek/feature-reset-puzzle
AlbinoGeek Jan 19, 2021
4648828
add: vscode debug config
AlbinoGeek Jan 20, 2021
68418df
fix: wrong slice length in checkBoxRepeat
AlbinoGeek Jan 20, 2021
874e88b
wip: show adaptivegrid change
AlbinoGeek Jan 20, 2021
f6f635c
fix: orientation of cells in test (move to Grid)
AlbinoGeek Jan 20, 2021
8832429
fix: checkColRepeat [closes #21]
AlbinoGeek Jan 20, 2021
b2245cc
Merge pull request #22 from AlbinoGeek/fix-regression-1
AlbinoGeek Jan 20, 2021
6918d1f
update go deps
AlbinoGeek Jan 20, 2021
0d9c782
add: ability to Disable a cell (make it ReadOnly)
AlbinoGeek Jan 20, 2021
845c2fa
add: concept of puzzle solve and completion time
AlbinoGeek Jan 20, 2021
1b25237
add: test BoardSolved
AlbinoGeek Jan 20, 2021
e3015c3
go generate
AlbinoGeek Jan 20, 2021
036ce82
go mod tidy
AlbinoGeek Jan 20, 2021
b987066
fix: use ForegroundColor instead of TextColor
AlbinoGeek Jan 20, 2021
96ed454
change: pad controls
AlbinoGeek Jan 20, 2021
fc44bfa
add: game timer to bottom right
AlbinoGeek Jan 20, 2021
644bd1c
add: test for loading invalid boards
AlbinoGeek Jan 20, 2021
c51c0f6
minor cleanup
AlbinoGeek Jan 20, 2021
3e0fef5
Merge pull request #27 from AlbinoGeek/check-solved
AlbinoGeek Jan 20, 2021
7150ff0
Merge branch 'develop' into add-coverage
AlbinoGeek Jan 20, 2021
a862c46
Merge pull request #28 from AlbinoGeek/add-coverage
AlbinoGeek Jan 20, 2021
a5d4c28
added missing entries to CHANGELOG.md
AlbinoGeek Jan 20, 2021
ba70fc9
referenced issue/PR numbers in CHANGELOG.md
AlbinoGeek Jan 20, 2021
8c913c2
Merge pull request #29 from AlbinoGeek/update-changelog
AlbinoGeek Jan 20, 2021
70a7be1
fix: board cell count error, reversed arg order
AlbinoGeek Jan 27, 2021
a14b814
update fyne
AlbinoGeek Feb 6, 2021
fe2b158
add: board.getBox(int) and test
AlbinoGeek Feb 6, 2021
fe5cbc0
image masters for board.getBox
AlbinoGeek Feb 6, 2021
3823b8d
board key
AlbinoGeek Feb 6, 2021
89080ab
checkBoxRepeat
AlbinoGeek Feb 6, 2021
a29cb0c
checkColRepeat
AlbinoGeek Feb 6, 2021
0d3d696
checkRowRepeat
AlbinoGeek Feb 6, 2021
ed2e5f7
init using new cell odering
AlbinoGeek Feb 6, 2021
d4dc28f
Merge pull request #30 from AlbinoGeek/refactor-cells-ordering
AlbinoGeek Feb 6, 2021
fbcd8cf
add: .codeclimate.yml
AlbinoGeek Feb 6, 2021
d6ff4a7
Merge pull request #31 from AlbinoGeek/codeclimate-rules
AlbinoGeek Feb 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
engines:
markdownlint:
enabled: true
checks:
MD013:
enabled: false
52 changes: 26 additions & 26 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:
run: go vet -tags ci ./...

- name: goimports
run: test -z $(goimports -e -d . | tee /dev/stderr)
run: bash -c "2>&1 goimports -e -d ."

- name: gocyclo
run: gocyclo -over 50 .

Expand All @@ -64,32 +64,32 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

# coverage:
# runs-on: ubuntu-latest
# steps:
# - name: Setup Golang 1.15.x
# if: success()
# uses: actions/setup-go@v2
# with:
# go-version: '^1.15.x'
coverage:
runs-on: ubuntu-latest
steps:
- name: Setup Golang 1.15.x
if: success()
uses: actions/setup-go@v2
with:
go-version: '^1.15.x'

# - name: Checkout repository
# uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2

# - name: Get dependencies
# run: |
# sudo apt-get update
# sudo apt-get install gcc libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libx11-dev xorg-dev
- name: Get dependencies
run: |
sudo apt-get update
sudo apt-get install gcc libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libx11-dev xorg-dev

# - name: Calc coverage
# run: |
# go test -v -covermode=count -coverprofile=coverage.out ./...
- name: Calc coverage
run: |
go test -v -covermode=count -coverprofile=coverage.out ./...

# - name: Convert coverage.out to coverage.lcov
# uses: jandelgado/[email protected]
- name: Convert coverage.out to coverage.lcov
uses: jandelgado/[email protected]

# - name: Coveralls GitHub Action
# uses: coverallsapp/[email protected]
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# path-to-lcov: coverage.lcov
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
35 changes: 35 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch test package",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/cmd"
},
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/cmd"
},
{
"name": "Launch dlv",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceFolder}/cmd",
"env": {},
"args": [],
"showLog": true,
},
]
}
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Changelog

## Unreleased

**Added**

- Button allows you to undo any value set.
- Simple mistakes are highlighted as you play. (#4)
- Button to check for mistakes. (#4)
- Set/Clear values with alpha keys/numpad. (#5)
- Button to reset puzzle to initial state. (#20)
- New Game Timer shown in the bottom right, stops when puzzle solved. (#27)

**Changed**
AlbinoGeek marked this conversation as resolved.
Show resolved Hide resolved

- More uniform Focus/Hover/Selected colours.

**Fixed**
AlbinoGeek marked this conversation as resolved.
Show resolved Hide resolved

- Many slowdowns in check methods. (#11)
- Bug where boxes showed cells in the wrong order in a different orientation. (#21, #22)
AlbinoGeek marked this conversation as resolved.
Show resolved Hide resolved
- Puzzle Check button now also tells you if you have found a possible solution. (#27)

## v0.1

- Initial Tagged Build
- Support for Classic Sodoku (9x9).
- Drag-select multiple boxes.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MAKE = make --no-print-directory

FYNE_CROSS = $(shell go env | awk -F'"' '/GOPATH/ {print $$2}')/bin/fyne-cross

DESCRIBE := $(shell go run gen.go VERSION)
DESCRIBE := $(shell go run cmd/gen.go VERSION)
DESCRIBE_PARTS := $(subst -, ,$(DESCRIBE))

VERSION_TAG := $(word 1,$(DESCRIBE_PARTS))
Expand All @@ -19,8 +19,8 @@ NEXT_MAJOR := $(shell echo $$(($(MAJOR)+1)))
NEXT_MINOR := $(shell echo $$(($(MINOR)+1)))
NEXT_MICRO = $(shell echo $$(($(MICRO)+$(COMMITS_SINCE_TAG))))

BINARYNAME = $(shell go run gen.go PROGRAM)
MODNAME = github.com/AlbinoGeek/$(BINARYNAME)
BINARYNAME = $(shell go run cmd/gen.go PROGRAM)
MODNAME = github.com/AlbinoGeek/$(BINARYNAME)/cmd
APP_NAME = com.github.albinogeek.$(BINARYNAME)
TARGETDIR = _dist

Expand Down
43 changes: 36 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,47 @@
[![Maintainability](https://api.codeclimate.com/v1/badges/be0523753694eee85927/maintainability)](https://codeclimate.com/github/AlbinoGeek/number-place/maintainability)
[![CI](https://github.com/AlbinoGeek/number-place/workflows/CI/badge.svg?branch=main)](#)
[![GoReportCard](https://goreportcard.com/badge/github.com/AlbinoGeek/number-place)](https://goreportcard.com/report/github.com/AlbinoGeek/number-place)
[![Coverage Status](https://coveralls.io/repos/github/AlbinoGeek/number-place/badge.svg?branch=develop)](https://coveralls.io/github/AlbinoGeek/number-place?branch=develop)

[![](cmd/testdata/start.png)](cmd/testdata/start.png)

## Features

Share puzzles simply by copying a string:

```
3,3,3,3,53-6---98-7-195----------6-8--4--7---6-8-3-2---3--1--6-6----------419-8-28---5-79
```

Cells:

- Click/Tap Toggle Select
- Drag to Select Multiple
- Unlimited Undo Levels

Help:

- Highlights Simple Mistakes

### Keyboard Controls

With Cells Selected:

- Use the alpha keys or numpad to set the center value
- Use the `del`ete or `backspace` keys to clear all values

### Puzzles Supported

- [ ] Sodoku
- [ ] Standard Grid (9x9, 3x3 subgrids)
- [ ] Classic
- [ ] Mini Grid (6x6, 3x2 subgrids)
- [ ] Giant Grid (16x16, 4x4 subgrids)
- [ ] Constrainted-Based Gridded Sodoku:
- [ ] Standard Grid (9x9, 3x3 subgrids)
- [X] Sudoku
- [X] Standard Grid (9x9, 3x3 boxes)
- [X] Classic
- [ ] Quadratum latinum (uses roman numerals for values)
- [ ] Alphabetical (uses a key of letters for values)
- [ ] Mini Grid (6x6, 3x2 boxes)
- [ ] Giant Grid (16x16, 4x4 boxes)
- [ ] Constrainted-Based Gridded Sudoku:
- [ ] Standard Grid (9x9, 3x3 boxes)
- [ ] "Killer"
- [ ] Greater Than
- [ ] XV

Expand Down
Loading