From dbfbf0efa28ca81c79b3c851ea23da1772f4d3d2 Mon Sep 17 00:00:00 2001 From: Jake Walker Date: Mon, 24 Jan 2022 09:11:03 +0000 Subject: [PATCH] Fix day checking --- README.md | 5 +++-- main.go | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e707dbb..756e44d 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/main.go b/main.go index a6529d0..1570d31 100644 --- a/main.go +++ b/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{},