Skip to content

Instantly share code, notes, and snippets.

package partyrobot
import "fmt"
// Welcome greets a person by name.
func Welcome(name string) string {
return fmt.Sprintf("Welcome to my party, %s!", name)
}
// HappyBirthday wishes happy birthday to the birthday person and exclaims their age.
@filipearray
filipearray / techpalace.go
Created May 11, 2024 02:08
Welcome To Tech Palace!
package techpalace
import "strings"
// WelcomeMessage returns a welcome message for the customer.
func WelcomeMessage(customer string) string {
return "Welcome to the Tech Palace, " + strings.ToUpper(customer)
panic("Please implement the WelcomeMessage() function")
}
@filipearray
filipearray / cars.go
Last active May 11, 2024 02:05
Cars Assemble
package cars
// CalculateWorkingCarsPerHour calculates how many working cars are
// produced by the assembly line every hour.
func CalculateWorkingCarsPerHour(productionRate int, successRate float64) float64 {
var onePercentProductionRate float64 = float64(productionRate) / 100
var workingCarsPerHour float64 = onePercentProductionRate * successRate
return workingCarsPerHour
panic("CalculateWorkingCarsPerHour not implemented")
}
@filipearray
filipearray / weather.go
Last active May 11, 2024 01:59
Weather Forecast
// Package weather shows the current condition of the place you want to know about.
package weather
// CurrentCondition variable shows the current condition of the place you want to know about.
var CurrentCondition string
// CurrentLocation variable gets the place you want to know about.
var CurrentLocation string
// Forecast function is responsible for gathering the current condition information of the place you want to know about.
@filipearray
filipearray / annalyn.go
Last active May 11, 2024 02:00
Annalyn's Infiltration
package annalyn
// CanFastAttack can be executed only when the knight is sleeping.
func CanFastAttack(knightIsAwake bool) bool {
canFastAttack := !knightIsAwake
return canFastAttack
panic("Please implement the CanFastAttack() function")
}
// CanSpy can be executed if at least one of the characters is awake.
@filipearray
filipearray / lasagna.go
Last active May 11, 2024 01:57
Gopher's Gorgeous Lasagna
package lasagna
const OvenTime = 40
const layerPreparationTime = 2
// RemainingOvenTime retorna os minutos restantes com base nos minutos `atual` já no forno.
func RemainingOvenTime(actualMinutesInOven int) int {
remainingOvenTime := OvenTime - actualMinutesInOven
return remainingOvenTime
@filipearray
filipearray / greeting.go
Last active May 11, 2024 02:06
Hello, World!
package greeting
// HelloWorld greets the world.
func HelloWorld() string {
return "Hello, World!"
}
@filipearray
filipearray / settings.json
Last active May 11, 2024 02:01
filipearray VSCode Settings
{
"files.autoSave": "afterDelay",
"editor.fontFamily": "JetBrains Mono",
"workbench.colorTheme": "Min Dark",
"editor.lineHeight": 1.8,
"editor.rulers": [80, 120],
"workbench.startupEditor": "newUntitledFile",
"editor.renderLineHighlight": "gutter",
"editor.fontLigatures": true,
"workbench.editor.labelFormat": "short",