You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. Thanks for opening an issue on Exercism. We are currently in a phase of our journey where we have paused community contributions to allow us to take a breather and redesign our community model. You can learn more in this blog post. As such, all issues and PRs in this repository are being automatically closed.
That doesn't mean we're not interested in your ideas, or that if you're stuck on something we don't want to help. The best place to discuss things is with our community on the Exercism Community Forum. You can use this link to copy this into a new topic there.
Note: If this issue has been pre-approved, please link back to this issue on the forum thread and a maintainer or staff member will reopen it.
package lasagna
import "fmt"
// TODO: define the 'PreparationTime()' function
func PreparationTime(layers []string, avPrepTime int) int {
if avPrepTime == 0 {
return 4
}
return len(layers) * avPrepTime
}
// TODO: define the 'Quantities()' function
func Quantities(layers []string) (noodles int, sauce float64) {
noodleWeight := 50
sauceAmount := 0.2
for i := 0; i < len(layers); i++ {
if layers[i] == "noodles" {
noodles += noodleWeight
}
if layers[i] == "sauce" {
sauce += sauceAmount
}
}
return noodles, sauce
}
// TODO: define the 'AddSecretIngredient()' function
func AddSecretIngredient(friendsList, myList []string) {
myList[len(myList)-1] = friendsList[len(friendsList)-1]
}
// TODO: define the 'ScaleRecipe()' function
func ScaleRecipe(quantities []float64, portions int) []float64 {
scaledAmounts := make([]float64, len(quantities))
fmt.Printf("portions %v", portions/2)
for i := 0; i < len(quantities); i++ {
scaledAmounts[i] = quantities[i] * float64(portions) / 2
}
fmt.Printf("portionList %v", scaledAmounts)
}
The text was updated successfully, but these errors were encountered: