diff --git a/solutions/go/party-robot/1/party_robot.go b/solutions/go/party-robot/1/party_robot.go new file mode 100644 index 0000000..8de150f --- /dev/null +++ b/solutions/go/party-robot/1/party_robot.go @@ -0,0 +1,21 @@ +package partyrobot + +import "fmt" + +// Welcome greets a person by name. +func Welcome(name string) string { + s := fmt.Sprintf("Welcome to my party, %s!", name) + return s +} + +// HappyBirthday wishes happy birthday to the birthday person and exclaims their age. +func HappyBirthday(name string, age int) string { + s := fmt.Sprintf("Happy birthday %s! You are now %d years old!", name, age) + return s +} + +// AssignTable assigns a table to each guest. +func AssignTable(name string, table int, neighbor, direction string, distance float64) string { + s := fmt.Sprintf("Welcome to my party, %s!\nYou have been assigned to table %03d. Your table is %s, exactly %.1f meters from here.\nYou will be sitting next to %s.", name, table, direction, distance, neighbor) + return s +}