adding cs142 code

This commit is contained in:
dm
2016-04-06 20:45:34 -07:00
parent 552d456d53
commit 8e52ce1982
174 changed files with 14064 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
include $(GOROOT)/src/Make.inc
TARG=trivia
GOFILES=\
trivia.go
include $(GOROOT)/src/Make.cmd
+29
View File
@@ -0,0 +1,29 @@
package main
import "fmt"
type QA struct {
question string
answer string
}
func main() {
fmt.Printf("%48s\n", "Basic BYU Trivia")
fmt.Printf("%25s %38s\n\n", "Questions", "Answers")
qas := []QA{
{"What was the original name of BYU?", "Brigham Young Academy"},
{"When was BYU established?", "1875"},
{"Who was the first \"permanent\" principal of BYA?",
"Karl G. Maeser"},
{"When did BYA become BYU?", "1903"},
{"To what sports conference do we belong?",
"Mountain West Conference (MWC)"},
{"WHen did BYU win the national football title?", "1984"},
{"Who won the Heisman Trophy in 1990?", "Ty Detmer"},
}
for _, v := range qas {
fmt.Printf("%-48s %s\n", v.question, v.answer)
}
}