aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/main.go b/main.go
index a8db9ac..5bd752f 100644
--- a/main.go
+++ b/main.go
@@ -54,6 +54,7 @@ func GetKey(t *term.Term) []byte {
}
func main() {
+restart:
var startlevel int
if len(os.Args) > 1 {
startlevel, _ = strconv.Atoi(os.Args[1])
@@ -189,7 +190,18 @@ func main() {
if topout {
ppos(4, 15, " GAME OVER ")
- return
+ break
}
}
+ ppos(6, 15, " replay? [Y/n] ")
+ t.Restore() // return from raw mode
+ var yes string
+ fmt.Scanln(&yes)
+ if len(yes) < 1 {
+ goto restart
+ }
+ if yes[0] == 'n' || yes[0] == 'N' {
+ return
+ }
+ goto restart
}