Fix day checking
This commit is contained in:
parent
f596b23055
commit
dbfbf0efa2
|
@ -12,9 +12,10 @@ and [Lip Gloss](https://github.com/charmbracelet/lipgloss).
|
|||
|
||||
## Features
|
||||
|
||||
- [x] Statistics are saved to `~/.wordle.json` for use in other programs.
|
||||
- [x] Same word list as the official website.
|
||||
- [x] Statistics are saved to `~/.wordle.json` for use in other programs
|
||||
- [x] Same word list as the official website
|
||||
- [ ] Leaderboard of people on current tilde
|
||||
- [ ] Update checking
|
||||
- [ ] Export to sharable message/emojis
|
||||
- [ ] Share to Mastodon
|
||||
- [ ] Play previous days
|
||||
|
|
5
main.go
5
main.go
|
@ -19,7 +19,8 @@ type model struct {
|
|||
|
||||
func initialModel() model {
|
||||
m := model{
|
||||
board: game.NewBoard(),
|
||||
board: game.NewBoard(),
|
||||
buffer: []rune{},
|
||||
}
|
||||
|
||||
lastGame, err := score.GetLastGame()
|
||||
|
@ -28,7 +29,7 @@ func initialModel() model {
|
|||
return m
|
||||
}
|
||||
|
||||
if lastGame != nil {
|
||||
if lastGame != nil && lastGame.Day == m.board.Day {
|
||||
m.error = fmt.Sprintf("Come back tomorrow for a new word")
|
||||
m.board = &game.Board{
|
||||
Guesses: [6]game.Guess{},
|
||||
|
|
Loading…
Reference in New Issue