Skip to content

Instantly share code, notes, and snippets.

@JeremyMorgan
Last active January 28, 2022 23:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JeremyMorgan/1081d3ffb7fe6235a455 to your computer and use it in GitHub Desktop.
Save JeremyMorgan/1081d3ffb7fe6235a455 to your computer and use it in GitHub Desktop.
The most important code I've ever written
package main
import (
"fmt";
)
func loopit(phrase string, repeat int)(string){
var outputphrase string = "";
for i := 0; i < repeat; i++ {
outputphrase = outputphrase + " " + phrase;
}
return string(outputphrase);
}
func main() {
var x[6]string
x[0] = "Cause the players gonna"
x[1] = "And the haters gonna"
x[2] = "I'm just gonna"
x[3] = "Heart-breakers gonna"
x[4] = "And the fakers gonna"
x[5] = "Baby, I'm just gonna"
var y[6]string
y[0] = "play"
y[1] = "hate"
y[2] = "shake"
y[3] = "break"
y[4] = "fake"
y[5] = "shake"
for i := 0; i < 6; i++ {
fmt.Printf("%[1]s %[2]s \n", x[i], loopit(y[i], 5));
if (i == 2 || i == 5){
fmt.Printf("%s \n", loopit("Shake it off",2));
}
}
}
@Naheel-Azawy
Copy link

Such an outstanding piece of engineering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment