language: Go (gc-2010-07-14)
date: 202 days 11 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main
 
import (
        "fmt"
        "rand"
)
 
type Person struct {
        Gender string
        BackLength int
        FrontLength int
}
 
func main() {
        fmt.Println("Welcome to the MULLET Program.\n")
        fmt.Println("Creating a new genome to work with...\n")
        person := new(Person)
        fmt.Println("Person created.")
        person.Gender = "Male"
        person.BackLength = rand.Intn(25)
        person.FrontLength = rand.Intn(25)
        fmt.Println("----------------------------------------")
        fmt.Println("Gender:", person.Gender)
        fmt.Println("BackLength:", person.BackLength)
        fmt.Println("FrontLength:", person.FrontLength)
}