@@ -14,10 +14,9 @@ import (
1414)
1515
1616type Cheat struct {
17- Note string `json:"note"`
18- Data []string `json:"data"`
19- Options map [string ]string `json:"options"`
20- HasOptions bool `json:"hasOptions"`
17+ Note string `json:"note"`
18+ Data []string `json:"data"`
19+ Options map [string ]string `json:"options"`
2120}
2221
2322func main () {
@@ -63,12 +62,11 @@ func main() {
6362 game [currentCheat ] = cheat
6463 } else if scanner .Text () == "" {
6564 // do nothing
66- } else if strings .Contains (scanner .Text (), "?" ) && ! cheat .HasOptions {
67- cheat .HasOptions = true
65+ } else if strings .Contains (scanner .Text (), "?" ) && cheat .Options == nil {
6866 cheat .Options = map [string ]string {}
6967 cheat .Data = append (cheat .Data , scanner .Text ())
7068 game [currentCheat ] = cheat
71- } else if cheat .HasOptions && len (strings .Split (scanner .Text (), " " )[0 ]) < 8 {
69+ } else if cheat .Options != nil && len (strings .Split (scanner .Text (), " " )[0 ]) < 8 {
7270 cheat .Options [strings .Join (strings .Split (scanner .Text (), " " )[1 :], " " )] = strings .Split (scanner .Text (), " " )[0 ]
7371 game [currentCheat ] = cheat
7472 } else {
0 commit comments