nimblebun / wordle-cli Goto Github PK
View Code? Open in Web Editor NEWplay wordle in your command line
License: MIT License
play wordle in your command line
License: MIT License
Output:
Caught panic:
runtime error: invalid memory address or nil pointer dereference
Restoring terminal...
goroutine 1 [running]:
runtime/debug.Stack()
/usr/lib/go/src/runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
/usr/lib/go/src/runtime/debug/stack.go:16 +0x19
github.com/charmbracelet/bubbletea.(*Program).StartReturningModel.func3()
/home/max/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:350 +0x95
panic({0x5c5580, 0x78d9c0})
/usr/lib/go/src/runtime/panic.go:1047 +0x266
pkg.nimblebun.works/wordle-cli/game.(*AppModel).save(0xc000136780)
/home/max/git/wordle-cli/game/utils.go:253 +0x27
pkg.nimblebun.works/wordle-cli/game.(*AppModel).enter(0xc000136780)
/home/max/git/wordle-cli/game/utils.go:164 +0x5ec
pkg.nimblebun.works/wordle-cli/game.(*AppModel).handleKeyDown(0xc000136780, 0xc000000228, {0x0, 0xc0000d0000, 0x0})
/home/max/git/wordle-cli/game/model.go:114 +0x14d
pkg.nimblebun.works/wordle-cli/game.(*AppModel).Update(0xc00019c000, {0x5d86c0, 0xc000292030})
/home/max/git/wordle-cli/game/model.go:137 +0x6f
github.com/charmbracelet/bubbletea.(*Program).StartReturningModel(0xc00015a280)
/home/max/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:534 +0x139c
github.com/charmbracelet/bubbletea.(*Program).Start(...)
/home/max/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:543
main.startGame({0x5fbfc5, 0x5ef8a1}, 0xc00010af70, 0xc000126600)
/home/max/git/wordle-cli/main.go:25 +0x54
main.startRandom(<<<<<<<<<<<<0xc00010af70)
/home/max/git/wordle-cli/main.go:40 +0x26
github.com/urfave/cli/v2.(*Command).Run(0xc00019a240, 0xc000126540)
/home/max/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:163 +0x64a
github.com/urfave/cli/v2.(*App).RunContext(0xc000110ea0, {0x64bb90, 0xc00013a010}, {0xc000128000, 0x2, 0x2})
/home/max/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:313 +0x81e
github.com/urfave/cli/v2.(*App).Run(...)
/home/max/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:224
main.main()
/home/max/git/wordle-cli/main.go:68 +0x1f9
From reading the code referenced in the stack trace, my guess is that m.SaveData
on the first line of save()
in game/utils.go
is nil, but I haven't used Go before so that's just a guess.
Edit: adding the following -
if (m.SaveData == nil) {
return
}
to the start of the aforementioned function fixes the problem by not saving the state of random mode games, but I don't know this is the intended behaviour and if it would break other things related to saving because I haven't read enough of the rest of the program. That said, I can submit a pull request if you'd like.
Output of go version
: go version go1.17.6 linux/amd64
OS: Manjaro, kernel version: 5.16.7-1-MANJARO
Let me know if there's any other information that would be helpful for me to provide :)
NYT changed the word list so the official Wordle is offset now by a few words.
The carriage return key doesn't work on the starting word -- but only some words -- in v1.0.2. Type all 5 characters, hit ENTER, and nothing happens. For example, STEAM, SMART, and TRIED do not work, but SOARS and MEATS do. Downgraded to v1.0.1, and it all (valid) words work.
Version: v1.0.2
Go: go1.17.7 linux/amd64
Shell: st + tmux
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.