Skip to content

Commit

Permalink
refactor: better ui/ux, default stockfish settings, update golang
Browse files Browse the repository at this point in the history
  • Loading branch information
tmountain committed Feb 17, 2021
1 parent bf6a040 commit 24e13d8
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 27 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ dist
### The easy way: zero configuration

With no arguments specified, uchess will attempt to locate stockfish
in your path and run it with difficulty level 20.
in your path and run it with difficulty level 3.

If stockfish cannot be found, uchess provides for an automated installation
on Linux and Windows. Automated install for Mac is a work in progress.

### The manual way: generate a **uchess** config and edit it accordingly.
### The manual way: generate a **uchess** config and edit it accordingly

Mac and Linux

Expand Down Expand Up @@ -293,7 +293,7 @@ cycle forward one move each time tne enter key is pressed.

### Platform Support
**uchess** has been tested and confirmed to work on Linux, MacOS, and Windows
(PowerShell) platforms. It should work with a wide variety of terminals.
(Windows Terminal) platforms. It should work with a wide variety of terminals.

### Project Status
**uchess** is currently in unstable (alpha) status, and its internal APIs
Expand Down
Binary file modified assets/uchess.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tmountain/uchess

go 1.13
go 1.16

require (
github.com/codeclysm/extract/v3 v3.0.2
Expand Down
8 changes: 4 additions & 4 deletions pkg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func HasTheme(name string, themes []ThemeHex) bool {

// DefaultOptions defines any default UCI options
var DefaultOptions = []Option{
{"skill level", "20"}, // stockfish skill level
{"skill level", "3"}, // stockfish skill level
}

// DefaultEngine is a placeholder for the default UCI engine
Expand All @@ -50,10 +50,10 @@ var defaultEngine = UCIEngine{
128, // Hash
false, // Ponder
false, // OwnBook
4, // MultiPV
20, // Depth
1, // MultiPV
1, // Depth
"", // SearchMoves
3000, // MoveTime
100, // MoveTime
DefaultOptions,
}

Expand Down
1 change: 0 additions & 1 deletion pkg/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ func MatchStockfishWin(file string) bool {
func SearchDirForStockfish(dir string) string {
files, err := ioutil.ReadDir(dir)
if err != nil {
fmt.Println(err.Error())
return ""
}

Expand Down
12 changes: 6 additions & 6 deletions pkg/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ func cfgEngines(eng *uci.Engine, cfg *UCIEngine) {
optPonder := uci.CmdSetOption{Name: "ponder", Value: fmt.Sprintf("%v", cfg.Ponder)}
optOwnBook := uci.CmdSetOption{Name: "ownbook", Value: fmt.Sprintf("%v", cfg.OwnBook)}
optMultiPV := uci.CmdSetOption{Name: "multipv", Value: fmt.Sprintf("%v", cfg.MultiPV)}

if err := eng.Run(uci.CmdUCI, uci.CmdIsReady, optHash, optPonder, optOwnBook, optMultiPV, uci.CmdUCINewGame); err != nil {
panic(err)
}

uciArgs := []uci.Cmd{uci.CmdUCI, uci.CmdIsReady, optHash, optPonder, optOwnBook, optMultiPV, uci.CmdUCINewGame}
// Send any custom options that were specified
for _, option := range cfg.Options {
uci.CmdSetOption{Name: option.Name, Value: option.Value}.ProcessResponse(eng)
uciArgs = append(uciArgs, uci.CmdSetOption{Name: option.Name, Value: option.Value})
}

if err := eng.Run(uciArgs...); err != nil {
panic(err)
}
}

Expand Down
12 changes: 6 additions & 6 deletions pkg/theme.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ var ThemeBasic = Theme{
"basic", // Name
tcell.Color252, // MoveLabelBg
tcell.ColorBlack, // MoveLabelFg
tcell.Color172, // SquareDark
tcell.Color215, // SquareLight
tcell.Color85, // SquareHigh
tcell.Color141, // SquareHint
tcell.Color212, // SquareCheck
tcell.Color255, // White
tcell.Color188, // SquareDark
tcell.Color230, // SquareLight
tcell.Color226, // SquareHigh
tcell.Color223, // SquareHint
tcell.Color218, // SquareCheck
tcell.Color232, // White
tcell.Color232, // Black
tcell.Color160, // Msg
tcell.Color247, // Rank
Expand Down
12 changes: 6 additions & 6 deletions pkg/themes/basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "basic",
"moveLabelBg": "#d0d0d0",
"moveLabelFg": "#000000",
"squareDark": "#d78700",
"squareLight": "#ffaf5f",
"squareHigh": "#5fffaf",
"squareHint": "#af87ff",
"squareCheck": "#ff87d7",
"white": "#eeeeee",
"squareDark": "#dfdfdf",
"squareLight": "#ffffdf",
"squareHigh": "#ffff00",
"squareHint": "#ffdfaf",
"squareCheck": "#ffdfdf",
"white": "#080808",
"black": "#080808",
"msg": "#d70000",
"rank": "#9e9e9e",
Expand Down

0 comments on commit 24e13d8

Please sign in to comment.