1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package main
- import (
- "fmt"
- "red-green/door"
- )
- func main() {
- fmt.Println("Starting testdoor.go")
- d := door.Door{}
- d.Init()
- reset := door.Reset
- bold := door.Color(1, 37, 40)
- bolder := door.ColorText("BLI BOLD YEL ON BLUE")
- d.Write("Welcome to " + bolder + "door32.sys" + reset + door.CRNL + "..." + door.CRNL)
- key := d.WaitKey(120)
- message := fmt.Sprintf("Key %s%d / %x%s"+door.CRNL, bold, key, key, reset)
- d.Write(message)
- b := door.Box{20, 1}
- d.Write(b.Top() + door.CRNL)
- // or %-20s
- message = fmt.Sprintf("%20s", "SHAZAM!")
- d.Write(b.Row(message) + door.CRNL)
- d.Write(b.Middle() + door.CRNL)
- d.Write(b.Row(fmt.Sprintf("%-20s", "Meow?")) + door.CRNL)
- d.Write(b.Bottom() + door.CRNL)
- left := d.TimeLeft()
- message = fmt.Sprintf("You have %0.2f minutes / %0.2f seconds remaining..."+door.CRNL, left.Minutes(), left.Seconds())
- d.Write(message)
- d.Write("Returning you to the BBS..." + door.CRNL)
- d.WaitKey(3)
- left = d.TimeLeft()
- message = fmt.Sprintf("You had %0.2f minutes / %0.2f seconds remaining!"+door.CRNL, left.Minutes(), left.Seconds())
- d.Write(message)
- fmt.Println("Ending testdoor.go")
- }
|