Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions 14-arrays/06-challenge-moodly/challenge/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
// Follow me on twitter: https://twitter.com/inancgumus

package main
import (
"fmt"
"math/rand"
"os"
)

// ---------------------------------------------------------
// EXERCISE: Moodly
Expand Down Expand Up @@ -46,4 +51,14 @@ package main
// ---------------------------------------------------------

func main() {
name := os.Args
if len(os.Args) == 1 {
fmt.Print("[Your Name]")
return
}
moodly := [5]string{" feels happy 😀", " feels awesome 😎", " feels good 👍", " feels sad 😞", " feels terrible 😩","feels bad 👎"}
r := rand.Intn(5)
fmt.Printf("%s%s", name, moodly[r])
}